From e2f781a7a76a3e08849f31d5d7c0e6420f31bd4d Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Tue, 17 May 2022 12:24:56 -0500 Subject: [PATCH 1/3] Update description of end-of-parameters token (#8824) --- .../About/about_Parsing.md | 76 +++++++++++++------ .../About/about_Parsing.md | 76 +++++++++++++------ .../About/about_Parsing.md | 76 +++++++++++++------ .../About/about_Parsing.md | 76 +++++++++++++------ .../About/about_Parsing.md | 76 +++++++++++++------ 5 files changed, 265 insertions(+), 115 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Parsing.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Parsing.md index 4fd68546e9f2..d73b54a412bf 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Parsing.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Parsing.md @@ -1,7 +1,7 @@ --- description: Describes how PowerShell parses commands. Locale: en-US -ms.date: 05/16/2022 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_parsing?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: about Parsing @@ -200,15 +200,14 @@ prevent PowerShell from misinterpreting the parentheses. icacls X:\VMS /grant Dom\HVAdmin:`(CI`)`(OI`)F ``` -Beginning in PowerShell 3.0, you can use the _stop-parsing_ (`--%`) and -_end-of-parameters_ tokens (`--`) to stop PowerShell from interpreting input as -PowerShell commands or expressions. +### The stop-parsing token + +Beginning in PowerShell 3.0, you can use the _stop-parsing_ (`--%`) token to +stop PowerShell from interpreting input as PowerShell commands or expressions. > [!NOTE] > The stop-parsing token is only intended for use on Windows platforms. -### The stop-parsing token - When calling a native command, place the stop-parsing token before the program arguments. This technique is much easier than using escape characters to prevent misinterpretation. @@ -239,23 +238,6 @@ variable the token is passed through as-is. You cannot use stream redirection (like `>file.txt`) because they are passed verbatim as arguments to the target command. -### The end-of-parameters token - -The end-of-parameters token (`--`) indicates that all arguments following it -are to be passed in their actual form as though double quotes were placed -around them. For example, using `--` you can output the string `-InputObject` -without using quotes or having it interpreted as a parameter: - -```powershell -Write-Output -- -InputObject -``` - -```Output --InputObject -``` - -This is a convention specified in the POSIX Shell and Utilities specification. - ### Passing arguments that contain quote characters Some native commands expect arguments that contain quote characters. Normally, @@ -299,6 +281,54 @@ Arg 0 is <"C:\Program Files (x86)\Microsoft\"> You can build `TestExe` from the source code. See [TestExe](https://github.com/PowerShell/PowerShell/blob/master/test/tools/TestExe/TestExe.cs). +## Passing arguments to PowerShell commands + +Beginning in PowerShell 3.0, you can use the _end-of-parameters_ token (`--`) +to stop PowerShell from interpreting input as PowerShell parameters. This is a +convention specified in the POSIX Shell and Utilities specification. + +The end-of-parameters token (`--`) indicates that all arguments following it +are to be passed in their actual form as though double quotes were placed +around them. For example, using `--` you can output the string `-InputObject` +without using quotes or having it interpreted as a parameter: + +```powershell +Write-Output -- -InputObject +``` + +```Output +-InputObject +``` + +Unlike the stop-parsing (`--%`) token, any values following the `--` token can +be interpreted as expressions by PowerShell. + +```powershell +Write-Output -- -InputObject $env:PROCESSOR_ARCHITECTURE +``` + +```Output +-InputObject +AMD64 +``` + +This behavior only applies to PowerShell commands. If you use the `--` token +when calling an external command, the `--` string is passed as an argument to +that command. + +```powershell +TestExe -echoargs -a -b -- -c +``` + +The output shows that `--` is passed as an argument to `TestExe`. + +```Output +Arg 0 is <-a> +Arg 1 is <-b> +Arg 2 is <--> +Arg 3 is <-c> +``` + ## See also - [about_Command_Syntax](about_Command_Syntax.md) diff --git a/reference/7.0/Microsoft.PowerShell.Core/About/about_Parsing.md b/reference/7.0/Microsoft.PowerShell.Core/About/about_Parsing.md index c15fb9099f4b..f488e90d602d 100644 --- a/reference/7.0/Microsoft.PowerShell.Core/About/about_Parsing.md +++ b/reference/7.0/Microsoft.PowerShell.Core/About/about_Parsing.md @@ -1,7 +1,7 @@ --- description: Describes how PowerShell parses commands. Locale: en-US -ms.date: 05/16/2022 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_parsing?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 title: about Parsing @@ -200,15 +200,14 @@ prevent PowerShell from misinterpreting the parentheses. icacls X:\VMS /grant Dom\HVAdmin:`(CI`)`(OI`)F ``` -Beginning in PowerShell 3.0, you can use the _stop-parsing_ (`--%`) and -_end-of-parameters_ tokens (`--`) to stop PowerShell from interpreting input as -PowerShell commands or expressions. +### The stop-parsing token + +Beginning in PowerShell 3.0, you can use the _stop-parsing_ (`--%`) token to +stop PowerShell from interpreting input as PowerShell commands or expressions. > [!NOTE] > The stop-parsing token is only intended for use on Windows platforms. -### The stop-parsing token - When calling a native command, place the stop-parsing token before the program arguments. This technique is much easier than using escape characters to prevent misinterpretation. @@ -239,23 +238,6 @@ variable the token is passed through as-is. You cannot use stream redirection (like `>file.txt`) because they are passed verbatim as arguments to the target command. -### The end-of-parameters token - -The end-of-parameters token (`--`) indicates that all arguments following it -are to be passed in their actual form as though double quotes were placed -around them. For example, using `--` you can output the string `-InputObject` -without using quotes or having it interpreted as a parameter: - -```powershell -Write-Output -- -InputObject -``` - -```Output --InputObject -``` - -This is a convention specified in the POSIX Shell and Utilities specification. - ### Passing arguments that contain quote characters Some native commands expect arguments that contain quote characters. Normally, @@ -300,6 +282,54 @@ Arg 0 is <"C:\Program Files (x86)\Microsoft\"> You can build `TestExe` from the source code. See [TestExe](https://github.com/PowerShell/PowerShell/blob/master/test/tools/TestExe/TestExe.cs). +## Passing arguments to PowerShell commands + +Beginning in PowerShell 3.0, you can use the _end-of-parameters_ token (`--`) +to stop PowerShell from interpreting input as PowerShell parameters. This is a +convention specified in the POSIX Shell and Utilities specification. + +The end-of-parameters token (`--`) indicates that all arguments following it +are to be passed in their actual form as though double quotes were placed +around them. For example, using `--` you can output the string `-InputObject` +without using quotes or having it interpreted as a parameter: + +```powershell +Write-Output -- -InputObject +``` + +```Output +-InputObject +``` + +Unlike the stop-parsing (`--%`) token, any values following the `--` token can +be interpreted as expressions by PowerShell. + +```powershell +Write-Output -- -InputObject $env:PROCESSOR_ARCHITECTURE +``` + +```Output +-InputObject +AMD64 +``` + +This behavior only applies to PowerShell commands. If you use the `--` token +when calling an external command, the `--` string is passed as an argument to +that command. + +```powershell +TestExe -echoargs -a -b -- -c +``` + +The output shows that `--` is passed as an argument to `TestExe`. + +```Output +Arg 0 is <-a> +Arg 1 is <-b> +Arg 2 is <--> +Arg 3 is <-c> +``` + ## See also - [about_Command_Syntax](about_Command_Syntax.md) diff --git a/reference/7.1/Microsoft.PowerShell.Core/About/about_Parsing.md b/reference/7.1/Microsoft.PowerShell.Core/About/about_Parsing.md index 27673c04cdd4..a3908f5d2ec1 100644 --- a/reference/7.1/Microsoft.PowerShell.Core/About/about_Parsing.md +++ b/reference/7.1/Microsoft.PowerShell.Core/About/about_Parsing.md @@ -1,7 +1,7 @@ --- description: Describes how PowerShell parses commands. Locale: en-US -ms.date: 05/16/2022 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_parsing?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: about Parsing @@ -200,15 +200,14 @@ prevent PowerShell from misinterpreting the parentheses. icacls X:\VMS /grant Dom\HVAdmin:`(CI`)`(OI`)F ``` -Beginning in PowerShell 3.0, you can use the _stop-parsing_ (`--%`) and -_end-of-parameters_ tokens (`--`) to stop PowerShell from interpreting input as -PowerShell commands or expressions. +### The stop-parsing token + +Beginning in PowerShell 3.0, you can use the _stop-parsing_ (`--%`) token to +stop PowerShell from interpreting input as PowerShell commands or expressions. > [!NOTE] > The stop-parsing token is only intended for use on Windows platforms. -### The stop-parsing token - When calling a native command, place the stop-parsing token before the program arguments. This technique is much easier than using escape characters to prevent misinterpretation. @@ -239,23 +238,6 @@ variable the token is passed through as-is. You cannot use stream redirection (like `>file.txt`) because they are passed verbatim as arguments to the target command. -### The end-of-parameters token - -The end-of-parameters token (`--`) indicates that all arguments following it -are to be passed in their actual form as though double quotes were placed -around them. For example, using `--` you can output the string `-InputObject` -without using quotes or having it interpreted as a parameter: - -```powershell -Write-Output -- -InputObject -``` - -```Output --InputObject -``` - -This is a convention specified in the POSIX Shell and Utilities specification. - ### Passing arguments that contain quote characters Some native commands expect arguments that contain quote characters. Normally, @@ -300,6 +282,54 @@ Arg 0 is <"C:\Program Files (x86)\Microsoft\"> You can build `TestExe` from the source code. See [TestExe](https://github.com/PowerShell/PowerShell/blob/master/test/tools/TestExe/TestExe.cs). +## Passing arguments to PowerShell commands + +Beginning in PowerShell 3.0, you can use the _end-of-parameters_ token (`--`) +to stop PowerShell from interpreting input as PowerShell parameters. This is a +convention specified in the POSIX Shell and Utilities specification. + +The end-of-parameters token (`--`) indicates that all arguments following it +are to be passed in their actual form as though double quotes were placed +around them. For example, using `--` you can output the string `-InputObject` +without using quotes or having it interpreted as a parameter: + +```powershell +Write-Output -- -InputObject +``` + +```Output +-InputObject +``` + +Unlike the stop-parsing (`--%`) token, any values following the `--` token can +be interpreted as expressions by PowerShell. + +```powershell +Write-Output -- -InputObject $env:PROCESSOR_ARCHITECTURE +``` + +```Output +-InputObject +AMD64 +``` + +This behavior only applies to PowerShell commands. If you use the `--` token +when calling an external command, the `--` string is passed as an argument to +that command. + +```powershell +TestExe -echoargs -a -b -- -c +``` + +The output shows that `--` is passed as an argument to `TestExe`. + +```Output +Arg 0 is <-a> +Arg 1 is <-b> +Arg 2 is <--> +Arg 3 is <-c> +``` + ## See also - [about_Command_Syntax](about_Command_Syntax.md) diff --git a/reference/7.2/Microsoft.PowerShell.Core/About/about_Parsing.md b/reference/7.2/Microsoft.PowerShell.Core/About/about_Parsing.md index c989823195a1..57cb810b11c4 100644 --- a/reference/7.2/Microsoft.PowerShell.Core/About/about_Parsing.md +++ b/reference/7.2/Microsoft.PowerShell.Core/About/about_Parsing.md @@ -1,7 +1,7 @@ --- description: Describes how PowerShell parses commands. Locale: en-US -ms.date: 05/16/2022 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_parsing?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 title: about Parsing @@ -200,15 +200,14 @@ prevent PowerShell from misinterpreting the parentheses. icacls X:\VMS /grant Dom\HVAdmin:`(CI`)`(OI`)F ``` -Beginning in PowerShell 3.0, you can use the _stop-parsing_ (`--%`) and -_end-of-parameters_ tokens (`--`) to stop PowerShell from interpreting input as -PowerShell commands or expressions. +### The stop-parsing token + +Beginning in PowerShell 3.0, you can use the _stop-parsing_ (`--%`) token to +stop PowerShell from interpreting input as PowerShell commands or expressions. > [!NOTE] > The stop-parsing token is only intended for use on Windows platforms. -### The stop-parsing token - When calling a native command, place the stop-parsing token before the program arguments. This technique is much easier than using escape characters to prevent misinterpretation. @@ -239,23 +238,6 @@ variable the token is passed through as-is. You cannot use stream redirection (like `>file.txt`) because they are passed verbatim as arguments to the target command. -### The end-of-parameters token - -The end-of-parameters token (`--`) indicates that all arguments following it -are to be passed in their actual form as though double quotes were placed -around them. For example, using `--` you can output the string `-InputObject` -without using quotes or having it interpreted as a parameter: - -```powershell -Write-Output -- -InputObject -``` - -```Output --InputObject -``` - -This is a convention specified in the POSIX Shell and Utilities specification. - ### Passing arguments that contain quote characters Some native commands expect arguments that contain quote characters. Normally, @@ -300,6 +282,54 @@ Arg 0 is <"C:\Program Files (x86)\Microsoft\"> You can build `TestExe` from the source code. See [TestExe](https://github.com/PowerShell/PowerShell/blob/master/test/tools/TestExe/TestExe.cs). +## Passing arguments to PowerShell commands + +Beginning in PowerShell 3.0, you can use the _end-of-parameters_ token (`--`) +to stop PowerShell from interpreting input as PowerShell parameters. This is a +convention specified in the POSIX Shell and Utilities specification. + +The end-of-parameters token (`--`) indicates that all arguments following it +are to be passed in their actual form as though double quotes were placed +around them. For example, using `--` you can output the string `-InputObject` +without using quotes or having it interpreted as a parameter: + +```powershell +Write-Output -- -InputObject +``` + +```Output +-InputObject +``` + +Unlike the stop-parsing (`--%`) token, any values following the `--` token can +be interpreted as expressions by PowerShell. + +```powershell +Write-Output -- -InputObject $env:PROCESSOR_ARCHITECTURE +``` + +```Output +-InputObject +AMD64 +``` + +This behavior only applies to PowerShell commands. If you use the `--` token +when calling an external command, the `--` string is passed as an argument to +that command. + +```powershell +TestExe -echoargs -a -b -- -c +``` + +The output shows that `--` is passed as an argument to `TestExe`. + +```Output +Arg 0 is <-a> +Arg 1 is <-b> +Arg 2 is <--> +Arg 3 is <-c> +``` + ## Experimental feature Powershell 7.2 includes the **PSNativeCommandArgumentPassing** experimental diff --git a/reference/7.3/Microsoft.PowerShell.Core/About/about_Parsing.md b/reference/7.3/Microsoft.PowerShell.Core/About/about_Parsing.md index f417b8d37541..8dd1b9f124b9 100644 --- a/reference/7.3/Microsoft.PowerShell.Core/About/about_Parsing.md +++ b/reference/7.3/Microsoft.PowerShell.Core/About/about_Parsing.md @@ -1,7 +1,7 @@ --- description: Describes how PowerShell parses commands. Locale: en-US -ms.date: 05/16/2022 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_parsing?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 title: about Parsing @@ -200,15 +200,14 @@ prevent PowerShell from misinterpreting the parentheses. icacls X:\VMS /grant Dom\HVAdmin:`(CI`)`(OI`)F ``` -Beginning in PowerShell 3.0, you can use the _stop-parsing_ (`--%`) and -_end-of-parameters_ tokens (`--`) to stop PowerShell from interpreting input as -PowerShell commands or expressions. +### The stop-parsing token + +Beginning in PowerShell 3.0, you can use the _stop-parsing_ (`--%`) token to +stop PowerShell from interpreting input as PowerShell commands or expressions. > [!NOTE] > The stop-parsing token is only intended for use on Windows platforms. -### The stop-parsing token - When calling a native command, place the stop-parsing token before the program arguments. This technique is much easier than using escape characters to prevent misinterpretation. @@ -239,23 +238,6 @@ variable the token is passed through as-is. You cannot use stream redirection (like `>file.txt`) because they are passed verbatim as arguments to the target command. -### The end-of-parameters token - -The end-of-parameters token (`--`) indicates that all arguments following it -are to be passed in their actual form as though double quotes were placed -around them. For example, using `--` you can output the string `-InputObject` -without using quotes or having it interpreted as a parameter: - -```powershell -Write-Output -- -InputObject -``` - -```Output --InputObject -``` - -This is a convention specified in the POSIX Shell and Utilities specification. - ### Passing arguments that contain quote characters Some native commands expect arguments that contain quote characters. Normally, @@ -300,6 +282,54 @@ Arg 0 is <"C:\Program Files (x86)\Microsoft\"> You can build `TestExe` from the source code. See [TestExe](https://github.com/PowerShell/PowerShell/blob/master/test/tools/TestExe/TestExe.cs). +## Passing arguments to PowerShell commands + +Beginning in PowerShell 3.0, you can use the _end-of-parameters_ token (`--`) +to stop PowerShell from interpreting input as PowerShell parameters. This is a +convention specified in the POSIX Shell and Utilities specification. + +The end-of-parameters token (`--`) indicates that all arguments following it +are to be passed in their actual form as though double quotes were placed +around them. For example, using `--` you can output the string `-InputObject` +without using quotes or having it interpreted as a parameter: + +```powershell +Write-Output -- -InputObject +``` + +```Output +-InputObject +``` + +Unlike the stop-parsing (`--%`) token, any values following the `--` token can +be interpreted as expressions by PowerShell. + +```powershell +Write-Output -- -InputObject $env:PROCESSOR_ARCHITECTURE +``` + +```Output +-InputObject +AMD64 +``` + +This behavior only applies to PowerShell commands. If you use the `--` token +when calling an external command, the `--` string is passed as an argument to +that command. + +```powershell +TestExe -echoargs -a -b -- -c +``` + +The output shows that `--` is passed as an argument to `TestExe`. + +```Output +Arg 0 is <-a> +Arg 1 is <-b> +Arg 2 is <--> +Arg 3 is <-c> +``` + ## Experimental feature Powershell 7.2 includes the **PSNativeCommandArgumentPassing** experimental From b49734dc4d7870a592189ccd478cfc3161d58ef5 Mon Sep 17 00:00:00 2001 From: "Mikey Lombardi (He/Him)" Date: Tue, 17 May 2022 15:25:29 -0500 Subject: [PATCH 2/3] (GH-8799) Clean up formatting for non-core reference (#8825) * (GH-8799) Clean up formatting for non-core reference * Update reference/5.1/PSWorkflow/About/about_WorkflowCommonParameters.md Co-authored-by: Sean Wheeler --- .../5.1/CimCmdlets/Remove-CimInstance.md | 18 +- reference/5.1/ISE/Import-IseSnippet.md | 14 +- .../Export-Counter.md | 33 +- .../Get-Counter.md | 7 +- .../Import-Counter.md | 28 +- .../Add-Content.md | 4 +- .../Clear-EventLog.md | 16 +- .../Get-PSDrive.md | 10 +- .../Get-PSProvider.md | 4 +- .../Get-Process.md | 69 ++-- .../Get-Service.md | 123 +++---- .../Get-WmiObject.md | 63 ++-- .../Invoke-WmiMethod.md | 75 +++-- .../New-EventLog.md | 45 +-- .../New-ItemProperty.md | 54 +-- .../Remove-Computer.md | 17 +- .../Remove-PSDrive.md | 67 ++-- .../Resolve-Path.md | 6 +- .../Start-Service.md | 4 +- .../About/about_Certificate_Provider.md | 80 ++--- .../ConvertFrom-Csv.md | 10 +- .../ConvertTo-Html.md | 27 +- .../Format-List.md | 50 +-- .../Format-Wide.md | 52 +-- .../Get-Unique.md | 27 +- .../Out-GridView.md | 32 +- .../Microsoft.PowerShell.Utility/Set-Date.md | 17 +- .../Unblock-File.md | 24 +- .../Set-WSManInstance.md | 192 ++++++----- .../5.1/PSScheduledJob/Get-JobTrigger.md | 32 +- .../5.1/PSScheduledJob/New-JobTrigger.md | 48 +-- .../5.1/PSScheduledJob/Set-JobTrigger.md | 95 +++--- .../About/about_ActivityCommonParameters.md | 311 +++++++++--------- .../About/about_WorkflowCommonParameters.md | 198 +++++------ .../5.1/PSWorkflow/New-PSWorkflowSession.md | 77 +++-- .../7.0/CimCmdlets/Remove-CimInstance.md | 13 +- .../Get-Counter.md | 7 +- .../Add-Content.md | 4 +- .../Get-PSDrive.md | 4 +- .../Get-PSProvider.md | 4 +- .../Get-Process.md | 56 ++-- .../Get-Service.md | 32 +- .../New-ItemProperty.md | 57 ++-- .../Remove-PSDrive.md | 55 ++-- .../Resolve-Path.md | 6 +- .../Start-Service.md | 4 +- .../About/about_Certificate_Provider.md | 84 ++--- .../ConvertFrom-Csv.md | 10 +- .../ConvertTo-Html.md | 33 +- .../Export-Csv.md | 86 ++--- .../Format-List.md | 50 +-- .../Format-Wide.md | 52 +-- .../Get-Unique.md | 27 +- .../Out-GridView.md | 19 +- .../Microsoft.PowerShell.Utility/Set-Date.md | 17 +- .../Microsoft.PowerShell.Utility/Test-Json.md | 8 +- .../Unblock-File.md | 24 +- .../Set-WSManInstance.md | 192 ++++++----- .../7.1/CimCmdlets/Remove-CimInstance.md | 14 +- .../Get-Counter.md | 8 +- .../Add-Content.md | 4 +- .../Get-PSDrive.md | 5 +- .../Get-PSProvider.md | 4 +- .../Get-Process.md | 56 ++-- .../Get-Service.md | 32 +- .../New-ItemProperty.md | 58 ++-- .../Remove-PSDrive.md | 56 ++-- .../Resolve-Path.md | 7 +- .../Start-Service.md | 4 +- .../About/about_Certificate_Provider.md | 90 ++--- .../ConvertFrom-Csv.md | 10 +- .../ConvertTo-Html.md | 31 +- .../Format-List.md | 50 +-- .../Format-Wide.md | 52 +-- .../Get-Unique.md | 28 +- .../Out-GridView.md | 20 +- .../Microsoft.PowerShell.Utility/Set-Date.md | 17 +- .../Microsoft.PowerShell.Utility/Test-Json.md | 17 +- .../Unblock-File.md | 24 +- .../Set-WSManInstance.md | 193 ++++++----- .../7.2/CimCmdlets/Remove-CimInstance.md | 14 +- .../Get-Counter.md | 8 +- .../Add-Content.md | 4 +- .../Get-PSDrive.md | 5 +- .../Get-PSProvider.md | 4 +- .../Get-Process.md | 56 ++-- .../Get-Service.md | 32 +- .../New-ItemProperty.md | 58 ++-- .../Remove-PSDrive.md | 56 ++-- .../Resolve-Path.md | 6 +- .../Start-Service.md | 4 +- .../About/about_Certificate_Provider.md | 90 ++--- .../ConvertFrom-Csv.md | 10 +- .../ConvertTo-Html.md | 33 +- .../Format-List.md | 50 +-- .../Format-Wide.md | 52 +-- .../Get-Unique.md | 28 +- .../Out-GridView.md | 20 +- .../Microsoft.PowerShell.Utility/Set-Date.md | 17 +- .../Microsoft.PowerShell.Utility/Test-Json.md | 17 +- .../Unblock-File.md | 24 +- .../Set-WSManInstance.md | 193 ++++++----- .../7.3/CimCmdlets/Remove-CimInstance.md | 14 +- .../Get-Counter.md | 8 +- .../Add-Content.md | 4 +- .../Get-PSDrive.md | 5 +- .../Get-PSProvider.md | 4 +- .../Get-Process.md | 56 ++-- .../Get-Service.md | 32 +- .../New-ItemProperty.md | 58 ++-- .../Remove-PSDrive.md | 54 +-- .../Resolve-Path.md | 6 +- .../Start-Service.md | 4 +- .../About/about_Certificate_Provider.md | 90 ++--- .../ConvertFrom-Csv.md | 10 +- .../ConvertTo-Html.md | 33 +- .../Format-List.md | 50 +-- .../Format-Wide.md | 52 +-- .../Get-Unique.md | 28 +- .../Out-GridView.md | 20 +- .../Microsoft.PowerShell.Utility/Set-Date.md | 17 +- .../Microsoft.PowerShell.Utility/Test-Json.md | 17 +- .../Unblock-File.md | 24 +- .../Set-WSManInstance.md | 195 ++++++----- 124 files changed, 2667 insertions(+), 2448 deletions(-) diff --git a/reference/5.1/CimCmdlets/Remove-CimInstance.md b/reference/5.1/CimCmdlets/Remove-CimInstance.md index 9ad6ec4a99da..144efefff3e8 100644 --- a/reference/5.1/CimCmdlets/Remove-CimInstance.md +++ b/reference/5.1/CimCmdlets/Remove-CimInstance.md @@ -2,7 +2,7 @@ external help file: Microsoft.Management.Infrastructure.CimCmdlets.dll-Help.xml Locale: en-US Module Name: CimCmdlets -ms.date: 06/21/2021 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/cimcmdlets/remove-ciminstance?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Remove-CimInstance @@ -151,7 +151,7 @@ Accept wildcard characters: False ### -Namespace -Specifies the namespace for the CIM operation. The default namespace is **root/cimv2**. You can use +Specifies the namespace for the CIM operation. The default namespace is `root/cimv2`. You can use tab completion to browse the list of namespaces, because PowerShell gets a list of namespaces from the local WMI server to provide the list of namespaces. @@ -170,7 +170,7 @@ Accept wildcard characters: False ### -OperationTimeoutSec Specifies the amount of time that the cmdlet waits for a response from the computer. By default, the -value of this parameter is 0, which means that the cmdlet uses the default timeout value for the +value of this parameter is `0`, which means that the cmdlet uses the default timeout value for the server. If the **OperationTimeoutSec** parameter is set to a value less than the robust connection retry @@ -195,10 +195,10 @@ Accept wildcard characters: False Specifies a query to run on the CIM server. You can specify the query dialect using the **QueryDialect** parameter. -If the value specified contains double quotes ("), single quotes ('), or a backslash (`\`), you must -escape those characters by prefixing them with the backslash (`\`) character. If the value specified -uses the WQL LIKE operator, then you must escape the following characters by enclosing them in -square brackets (`[]`): percent (%), underscore (`_`), or opening square bracket (`[`). +If the value specified contains double quotes (`"`), single quotes (`'`), or a backslash (`\`), you +must escape those characters by prefixing them with the backslash (`\`) character. If the value +specified uses the WQL `LIKE` operator, then you must escape the following characters by enclosing +them in square brackets (`[]`): percent (`%`), underscore (`_`), or opening square bracket (`[`). ```yaml Type: System.String @@ -215,7 +215,7 @@ Accept wildcard characters: False ### -QueryDialect Specifies the query language used for the Query parameter. The acceptable values for this parameter -are: **WQL** or **CQL**. The default value is **WQL**. +are: `WQL` or `CQL`. The default value is `WQL`. ```yaml Type: System.String @@ -245,7 +245,7 @@ By default, if you do not specify this parameter, the DMTF standard resource URI ResourceURI can only be used with CIM sessions created using the WSMan protocol, or when specifying the ComputerName parameter, which creates a CIM session using WSMan. If you specify this parameter without specifying the ComputerName parameter, or if you specify a CIM session created using DCOM -protocol, you will get an error, because the DCOM protocol does not support the ResourceURI +protocol, you get an error, because the DCOM protocol does not support the **ResourceURI** parameter. If both the **ResourceUri** parameter and the **Filter** parameter are specified, the **Filter** diff --git a/reference/5.1/ISE/Import-IseSnippet.md b/reference/5.1/ISE/Import-IseSnippet.md index 74c4cc99f330..7e57d2e1ec66 100644 --- a/reference/5.1/ISE/Import-IseSnippet.md +++ b/reference/5.1/ISE/Import-IseSnippet.md @@ -2,7 +2,7 @@ external help file: ISE-help.xml Locale: en-US Module Name: ISE -ms.date: 06/09/2017 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/ise/import-isesnippet?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Import-IseSnippet @@ -75,7 +75,7 @@ Import-IseSnippet -Module SnippetModule -ListAvailable ### Example 3: Find snippets in modules -This example gets snippets in all installed modules in the PSModulePath environment variable. +This example gets snippets in all installed modules in the **PSModulePath** environment variable. ```powershell ($env:PSModulePath).split(";") | @@ -97,9 +97,9 @@ you don't need to run a command like this because modules that have snippets wil ### Example 5: Copy all module snippets -This example copies the snippet files from all installed modules into the Snippets directory of the -current user. Unlike imported snippets, which affect only the current session, copied snippets are -available in every Windows PowerShell ISE session. +This example copies the snippet files from all installed modules into the `Snippets` directory of +the current user. Unlike imported snippets, which affect only the current session, copied snippets +are available in every Windows PowerShell ISE session. ```powershell ($env:PSModulePath).split(";") | @@ -135,8 +135,8 @@ Accept wildcard characters: False Imports snippets from the specified module into the current session. Wildcard characters are not supported. -This parameter imports snippets from Snippet.ps1xml files in the Snippets subdirectory in the module -path, such as `$home\Documents\WindowsPowerShell\Modules\\Snippets`. +This parameter imports snippets from `Snippet.ps1xml` files in the Snippets subdirectory in the +module path, such as `$home\Documents\WindowsPowerShell\Modules\\Snippets`. This parameter is designed to be used by module authors in a startup script, such as a script specified in the **ScriptsToProcess** key of a module manifest. Snippets in a module are not diff --git a/reference/5.1/Microsoft.PowerShell.Diagnostics/Export-Counter.md b/reference/5.1/Microsoft.PowerShell.Diagnostics/Export-Counter.md index 4c86bcb0f8d7..3f5d3a8cda29 100644 --- a/reference/5.1/Microsoft.PowerShell.Diagnostics/Export-Counter.md +++ b/reference/5.1/Microsoft.PowerShell.Diagnostics/Export-Counter.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Diagnostics.dll-help.xml Locale: en-US Module Name: Microsoft.PowerShell.Diagnostics -ms.date: 10/12/2020 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.diagnostics/export-counter?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Export-Counter @@ -22,9 +22,9 @@ Export-Counter [-Path] [-FileFormat ] [-MaxSize ] ## DESCRIPTION -The `Export-Counter` cmdlet exports performance counter data (PerformanceCounterSampleSet objects) -to log files in binary performance log (.blg), comma-separated value (.csv), or tab-separated value -(.tsv) format. You use this cmdlet to log performance counter data. +The `Export-Counter` cmdlet exports performance counter data (**PerformanceCounterSampleSet** +objects) to log files in binary performance log (`.blg`), comma-separated value (`.csv`), or +tab-separated value (`.tsv`) format. You use this cmdlet to log performance counter data. The `Export-Counter` cmdlet is designed to export data that is returned by the `Get-Counter` and `Import-Counter` cmdlets. @@ -42,8 +42,8 @@ Get-Counter "\Processor(*)\% Processor Time" | Export-Counter -Path $home\Counte ``` The command uses the `Get-Counter` cmdlet to collect processor time data. It uses a pipeline -operator (|) to send the data to the `Export-Counter` cmdlet. The `Export-Counter` command uses the -**Path** variable to specify the output file. +operator (`|`) to send the data to the `Export-Counter` cmdlet. The `Export-Counter` command uses +the **Path** variable to specify the output file. Because the data set might be very large, this example sends the data to `Export-Counter` through the pipeline. If the data were saved in a variable, you might use a disproportionate amount of @@ -74,7 +74,7 @@ The first command uses the `Get-Counter` cmdlet to collect working set counter d remote computer. The command saves the data in the `$C` variable. The second command uses a pipeline operator (`|`) to send the data in `$C` to the `Export-Counter` -cmdlet, which saves it in the `Workingset.blg` file in the Perf share of the Server01 computer. +cmdlet, which saves it in the `Workingset.blg` file in the `Perf` share of the Server01 computer. ```powershell $C = Get-Counter -ComputerName Server01 -Counter "\Process(*)\Working Set - Private" -MaxSamples $C | Export-Counter -Path \\Server01\Perf\WorkingSet.blg @@ -90,7 +90,7 @@ This example shows how to use the `Import-Counter` and `Export-Counter` cmdlets data. The first command uses the `Import-Counter` cmdlet to import performance counter data from the -DiskSpace.blg log. It saves the data in the `$All` variable. This file contains samples of the +`DiskSpace.blg` log. It saves the data in the `$All` variable. This file contains samples of the "LogicalDisk\% Free Space" counter on more than 200 remote computers in the enterprise. The second command uses the `Where-Object` cmdlet to select objects with **CookedValue** of less @@ -98,7 +98,7 @@ than 15 (percent). The command saves the results in the `$LowSpace` variable. The third command uses a pipeline operator (`|`) to send the data in the `$LowSpace` variable to the `Export-Counter` cmdlet. The command uses the **Path** parameter to indicate that the selected data -should be logged in the LowDiskSpace.blg file. +should be logged in the `LowDiskSpace.blg` file. ```powershell $All = Import-Counter DiskSpace.blg @@ -110,8 +110,8 @@ $LowSpace | Export-Counter -Path LowDiskSpace.blg ### -Circular -Indicates that the output file is a circular log with first in, first out (FIFO) format. -When you include this parameter, the **MaxSize** parameter is required. +Indicates that the output file is a circular log with first in, first out (FIFO) format. When you +include this parameter, the **MaxSize** parameter is required. ```yaml Type: System.Management.Automation.SwitchParameter @@ -131,11 +131,11 @@ Specifies the output format of the output log file. The acceptable values for this parameter are: -- CSV -- TSV -- BLG +- `CSV` +- `TSV` +- `BLG` -The default value is BLG. +The default value is `BLG`. ```yaml Type: System.String @@ -151,7 +151,8 @@ Accept wildcard characters: False ### -Force -Overwrites and replaces an existing file if one exists in the location specified by the **Path** parameter. +Overwrites and replaces an existing file if one exists in the location specified by the **Path** +parameter. ```yaml Type: System.Management.Automation.SwitchParameter diff --git a/reference/5.1/Microsoft.PowerShell.Diagnostics/Get-Counter.md b/reference/5.1/Microsoft.PowerShell.Diagnostics/Get-Counter.md index 90cfeaf1b6a8..85fb7cb1e487 100644 --- a/reference/5.1/Microsoft.PowerShell.Diagnostics/Get-Counter.md +++ b/reference/5.1/Microsoft.PowerShell.Diagnostics/Get-Counter.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Diagnostics.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Diagnostics -ms.date: 06/21/2021 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.diagnostics/get-counter?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-Counter @@ -411,7 +411,7 @@ Path InstanceName CookedValue `Get-Counter` uses the **Counter** parameter to specify the counter `\Processor(*)\% Processor Time`. The values are stored in the `$Counter` variable. The objects stored in `$Counter.CounterSamples` are sent down the pipeline. `Where-Object` uses a script block -to compare each objects value against a specified value of 20. The `$_.CookedValue` is a variable +to compare each objects value against a specified value of `20`. The `$_.CookedValue` is a variable for the current object in the pipeline. Counters with a **CookedValue** that is less than 20 are displayed. @@ -599,7 +599,8 @@ Accept wildcard characters: False This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, --WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/5.1/Microsoft.PowerShell.Diagnostics/Import-Counter.md b/reference/5.1/Microsoft.PowerShell.Diagnostics/Import-Counter.md index e1be213735e7..fb35a202cfe7 100644 --- a/reference/5.1/Microsoft.PowerShell.Diagnostics/Import-Counter.md +++ b/reference/5.1/Microsoft.PowerShell.Diagnostics/Import-Counter.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Diagnostics.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Diagnostics -ms.date: 09/28/2021 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.diagnostics/import-counter?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Import-Counter @@ -18,8 +18,8 @@ the log. ### GetCounterSet (Default) ``` -Import-Counter [-Path] [-StartTime ] [-EndTime ] [-Counter ] - [-MaxSamples ] [] +Import-Counter [-Path] [-StartTime ] [-EndTime ] +[-Counter ] [-MaxSamples ] [] ``` ### ListSetSet @@ -111,7 +111,7 @@ $i | Export-Counter -Path .\Interrupts.csv -Format CSV ``` The first command uses `Import-Counter` to import all of the performance counter data from the -`ProcessorData.blg files`. The command saves the data in the `$data` variable. +`ProcessorData.blg` files. The command saves the data in the `$data` variable. The second command displays the counter paths in the `$data` variable. To get the display shown in the command output, the example uses the `Format-Table` cmdlet to format as a table the counter @@ -125,9 +125,9 @@ The fourth command displays the selected counter paths in the `$intCtrs` variabl The fifth command uses the `Import-Counter` cmdlet to import the data. It uses the `$intCtrs` variable as the value of the **Counter** parameter to import only data for the counter paths in -$IntCtrs. +`$intCtrs`. -The sixth command uses the Export-Counter cmdlet to export the data to the `Interrupts.csv` file. +The sixth command uses the `Export-Counter` cmdlet to export the data to the `Interrupts.csv` file. ### Example 4: Display all counter paths in a group of imported counter sets @@ -177,9 +177,9 @@ counter sets that are represented in a counter data file. The second command gets all of the counter paths from the list set. -### Example 5: Import counter data from a range of time stamps +### Example 5: Import counter data from a range of timestamps -This example imports only the counter data that has a time stamp between the starting an ending +This example imports only the counter data that has a timestamp between the starting an ending ranges specified in the command. ```powershell @@ -188,10 +188,10 @@ $start = [datetime]"7/9/2008 3:47:00 PM"; $end = [datetime]"7/9/2008 3:47:59 PM" Import-Counter -Path Disk.blg -StartTime $start -EndTime $end ``` -The first command lists in a table the time stamps of all of the data in the `ProcessorData.blg` +The first command lists in a table the timestamps of all of the data in the `ProcessorData.blg` file. -The second command saves particular time stamps in the `$start` and `$end` variables. The strings +The second command saves particular timestamps in the `$start` and `$end` variables. The strings are cast to **DateTime** objects. The third command uses the `Import-Counter` cmdlet to get only counter data that has a time stamp @@ -200,7 +200,8 @@ parameters of `Import-Counter` to specify the range. ### Example 6: Import a specified number of the oldest samples from a performance counter log file -This example shows how to import the five oldest and five newest samples from a performance counter log file. +This example shows how to import the five oldest and five newest samples from a performance counter +log file. ```powershell Import-Counter -Path "Disk.blg" -MaxSamples 5 @@ -267,7 +268,7 @@ Specifies, as a string array, the performance counters. By default, `Import-Coun data from all counters in the input files. Enter one or more counter paths. Wildcards are permitted in the Instance part of the path. -Each counter path has the following format. The ComputerName value is required in the path. For +Each counter path has the following format. The `ComputerName` value is required in the path. For instance: - `\\\()\` @@ -405,7 +406,8 @@ Accept wildcard characters: False This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, --WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/5.1/Microsoft.PowerShell.Management/Add-Content.md b/reference/5.1/Microsoft.PowerShell.Management/Add-Content.md index 02f007d3fedc..c446a72a7ef5 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Add-Content.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Add-Content.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 11/03/2021 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/add-content?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Add-Content @@ -146,7 +146,7 @@ Mode LastWriteTime Length Name `IsReadOnlyTextFile.txt` in the current directory. - The `Set-ItemProperty` cmdlet uses the **Name** and **Value** parameters to change the file's **IsReadOnly** property to True. -- The `Get-ChildItem` cmdlet shows the file is empty (0) and has the read-only attribute (`r`). +- The `Get-ChildItem` cmdlet shows the file is empty (`0`) and has the read-only attribute (`r`). - The `Add-Content` cmdlet uses the **Path** parameter to specify the file. The **Value** parameter includes the text string to append to the file. The **Force** parameter writes the text to the read-only file. diff --git a/reference/5.1/Microsoft.PowerShell.Management/Clear-EventLog.md b/reference/5.1/Microsoft.PowerShell.Management/Clear-EventLog.md index 834e8cac28e8..8857348c0cc5 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Clear-EventLog.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Clear-EventLog.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 06/09/2017 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/clear-eventlog?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Clear-EventLog @@ -15,7 +15,8 @@ Clears all entries from specified event logs on the local or remote computers. ## SYNTAX ``` -Clear-EventLog [-LogName] [[-ComputerName] ] [-WhatIf] [-Confirm] [] +Clear-EventLog [-LogName] [[-ComputerName] ] [-WhatIf] [-Confirm] +[] ``` ## DESCRIPTION @@ -24,9 +25,9 @@ The `Clear-EventLog` cmdlet deletes all of the entries from the specified event computer or on remote computers. To use `Clear-EventLog`, you must be a member of the Administrators group on the affected computer. -The cmdlets that contain the **EventLog** noun (the EventLog cmdlets) work only on classic event +The cmdlets that contain the `EventLog` noun (the `EventLog` cmdlets) work only on classic event logs. To get events from logs that use the Windows Event Log technology in Windows Vista and later -versions of Windows, use the Get-WinEvent cmdlet. +versions of Windows, use the `Get-WinEvent` cmdlet. ## EXAMPLES @@ -97,7 +98,7 @@ before they were displayed. Specifies a remote computer. The default is the local computer. Type the NetBIOS name, an Internet Protocol (IP) address, or a fully qualified domain name of a -remote computer. To specify the local computer, type the computer name, a dot (.), or "localhost". +remote computer. To specify the local computer, type the computer name, a dot (`.`), or `localhost`. This parameter does not rely on Windows PowerShell remoting. You can use the **ComputerName** parameter of `Get-EventLog` even if your computer is not configured to run remote commands. @@ -154,8 +155,7 @@ Accept wildcard characters: False ### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. +Shows what would happen if the cmdlet runs. The cmdlet is not run. ```yaml Type: System.Management.Automation.SwitchParameter @@ -191,7 +191,7 @@ This cmdlet does not generate any output. ## NOTES - To use `Clear-EventLog` on Windows Vista and later versions of Windows, start Windows PowerShell - with the "Run as administrator" option. + with the **Run as administrator** option. ## RELATED LINKS diff --git a/reference/5.1/Microsoft.PowerShell.Management/Get-PSDrive.md b/reference/5.1/Microsoft.PowerShell.Management/Get-PSDrive.md index 605b5524a9ec..67c078be118a 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Get-PSDrive.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Get-PSDrive.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 06/09/2017 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/get-psdrive?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-PSDrive @@ -17,15 +17,13 @@ Gets drives in the current session. ### Name (Default) ``` -Get-PSDrive [[-Name] ] [-Scope ] [-PSProvider ] [-UseTransaction] - [] +Get-PSDrive [[-Name] ] [-Scope ] [-PSProvider ] [] ``` ### LiteralName ``` -Get-PSDrive [-LiteralName] [-Scope ] [-PSProvider ] [-UseTransaction] - [] +Get-PSDrive [-LiteralName] [-Scope ] [-PSProvider ] [] ``` ## DESCRIPTION @@ -215,7 +213,7 @@ Accept wildcard characters: False ### -Name Specifies, as a string array, the name or name of drives that this cmdlet gets in the operation. -Type the drive name or letter without a colon (:). +Type the drive name or letter without a colon (`:`). ```yaml Type: System.String[] diff --git a/reference/5.1/Microsoft.PowerShell.Management/Get-PSProvider.md b/reference/5.1/Microsoft.PowerShell.Management/Get-PSProvider.md index d74050a9f4bc..b7ce408dddea 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Get-PSProvider.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Get-PSProvider.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 05/26/2021 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/get-psprovider?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-PSProvider @@ -108,7 +108,7 @@ PS C:\> (get-psprovider FileSystem).home C:\Users\User01 ``` -This example shows that the tilde symbol (~) represents the value of the **Home** property of the +This example shows that the tilde symbol (`~`) represents the value of the **Home** property of the FileSystem provider. The **Home** property value is optional, but for the **FileSystem** provider, it is defined as `$env:homedrive\$env:homepath` or `$home`. diff --git a/reference/5.1/Microsoft.PowerShell.Management/Get-Process.md b/reference/5.1/Microsoft.PowerShell.Management/Get-Process.md index d48726914699..15ad5a17aa96 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Get-Process.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Get-Process.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 06/09/2017 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/get-process?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-Process @@ -17,7 +17,8 @@ Gets the processes that are running on the local computer or a remote computer. ### Name (Default) ``` -Get-Process [[-Name] ] [-ComputerName ] [-Module] [-FileVersionInfo] [] +Get-Process [[-Name] ] [-ComputerName ] [-Module] [-FileVersionInfo] +[] ``` ### NameWithUserName @@ -35,7 +36,8 @@ Get-Process -Id [-IncludeUserName] [] ### Id ``` -Get-Process -Id [-ComputerName ] [-Module] [-FileVersionInfo] [] +Get-Process -Id [-ComputerName ] [-Module] [-FileVersionInfo] +[] ``` ### InputObjectWithUserName @@ -48,7 +50,7 @@ Get-Process -InputObject [-IncludeUserName] [] ``` Get-Process -InputObject [-ComputerName ] [-Module] [-FileVersionInfo] - [] +[] ``` ## DESCRIPTION @@ -83,8 +85,8 @@ Get-Process winword, explorer | Format-List * This command gets all available data about the Winword and Explorer processes on the computer. It uses the **Name** parameter to specify the processes, but it omits the optional parameter name. The -pipeline operator `|` passes the data to the `Format-List` cmdlet, which displays all available -properties `*` of the Winword and Explorer process objects. +pipeline operator (`|`) passes the data to the `Format-List` cmdlet, which displays all available +properties (`*`) of the Winword and Explorer process objects. You can also identify the processes by their process IDs. For instance, `Get-Process -Id 664, 2060`. @@ -95,7 +97,7 @@ Get-Process | Where-Object {$_.WorkingSet -gt 20000000} ``` This command gets all processes that have a working set greater than 20 MB. It uses the -`Get-Process` cmdlet to get all running processes. The pipeline operator `|` passes the process +`Get-Process` cmdlet to get all running processes. The pipeline operator (`|`) passes the process objects to the `Where-Object` cmdlet, which selects only the object with a value greater than 20,000,000 bytes for the **WorkingSet** property. @@ -157,10 +159,10 @@ ProductVersion FileVersion FileName ``` This command uses the **FileVersionInfo** parameter to get the version information for the -powershell.exe file that is the main module for the PowerShell process. +`powershell.exe` file that is the main module for the PowerShell process. To run this command with processes that you do not own on Windows Vista and later versions of -Windows, you must open PowerShell with the Run as administrator option. +Windows, you must open PowerShell with the **Run as administrator** option. ### Example 7: Get modules loaded with the specified process @@ -169,10 +171,10 @@ Get-Process SQL* -Module ``` This command uses the **Module** parameter to get the modules that have been loaded by the process. -This command gets the modules for the processes that have names that begin with SQL. +This command gets the modules for the processes that have names that begin with `SQL`. To run this command on Windows Vista and later versions of Windows with processes that you do not -own, you must start PowerShell with the Run as administrator option. +own, you must start PowerShell with the **Run as administrator** option. ### Example 8: Find the owner of a process @@ -208,16 +210,16 @@ User : user01 ``` The first command shows how to find the owner of a process. The **IncludeUserName** parameter -requires elevated user rights (Run as Administrator). The output reveals that the owner is -Domain01\user01. +requires elevated user rights (**Run as Administrator**). The output reveals that the owner is +`Domain01\user01`. The second and third command are another way to find the owner of a process. The second command uses `Get-WmiObject` to get the PowerShell process. It saves it in the `$p` variable. -The third command uses the GetOwner method to get the owner of the process in `$p`. The output -reveals that the owner is Domain01\user01. +The third command uses the **GetOwner** method to get the owner of the process in `$p`. The output +reveals that the owner is `Domain01\user01`. ### Example 9: Use an automatic variable to identify the process hosting the current session @@ -271,7 +273,7 @@ Specifies the computers for which this cmdlet gets active processes. The default computer. Type the NetBIOS name, an IP address, or a fully qualified domain name (FQDN) of one or more -computers. To specify the local computer, type the computer name, a dot (.), or localhost. +computers. To specify the local computer, type the computer name, a dot (`.`), or `localhost`. This parameter does not rely on Windows PowerShell remoting. You can use the **ComputerName** parameter of this cmdlet even if your computer is not configured to run remote commands. @@ -293,8 +295,8 @@ Accept wildcard characters: False Indicates that this cmdlet gets the file version information for the program that runs in the process. -On Windows Vista and later versions of Windows, you must open PowerShell with the Run as -administrator option to use this parameter on processes that you do not own. +On Windows Vista and later versions of Windows, you must open PowerShell with the **Run as +administrator** option to use this parameter on processes that you do not own. You cannot use the **FileVersionInfo** and **ComputerName** parameters of the `Get-Process` cmdlet in the same command. @@ -401,7 +403,7 @@ Accept wildcard characters: False ### -Name Specifies one or more processes by process name. You can type multiple process names (separated by -commas) and use wildcard characters. The parameter name ("Name") is optional. +commas) and use wildcard characters. The parameter name (`Name`) is optional. ```yaml Type: System.String[] @@ -439,26 +441,27 @@ use the **Module** parameter, without the **FileVersionInfo** parameter, it retu ## NOTES -- You can also refer to this cmdlet by its built-in aliases, ps and gps. For more information, see - [about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). +- You can also refer to this cmdlet by its built-in aliases, `ps` and `gps`. For more information, + see [about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). - On computers that are running a 64-bit version of Windows, the 64-bit version of PowerShell gets only 64-bit process modules and the 32-bit version of PowerShell gets only 32-bit process modules. - You can use the properties and methods of the Windows Management Instrumentation (WMI) - Win32_Process object in PowerShell. For information, see `Get-WmiObject` and the WMI SDK. + **Win32_Process** object in PowerShell. For information, see `Get-WmiObject` and the WMI SDK. - The default display of a process is a table that includes the following columns. For a description of all of the properties of process objects, see [Process Properties](/dotnet/api/system.diagnostics.process). - - Handles: The number of handles that the process has opened. - - NPM(K): The amount of non-paged memory that the process is using, in kilobytes. - - PM(K): The amount of pageable memory that the process is using, in kilobytes. - - WS(K): The size of the working set of the process, in kilobytes. - The working set consists of the pages of memory that were recently referenced by the process. - - VM(M): The amount of virtual memory that the process is using, in megabytes. - Virtual memory includes storage in the paging files on disk. - - CPU(s): The amount of processor time that the process has used on all processors, in seconds. - - ID: The process ID (PID) of the process. - - ProcessName: The name of the process. For explanations of the concepts related to processes, see - the Glossary in Help and Support Center and the Help for Task Manager. + - **Handles**: The number of handles that the process has opened. + - **NPM(K)**: The amount of non-paged memory that the process is using, in kilobytes. + - **PM(K)**: The amount of pageable memory that the process is using, in kilobytes. + - **WS(K)**: The size of the working set of the process, in kilobytes. The working set consists of + the pages of memory that were recently referenced by the process. + - **VM(M)**: The amount of virtual memory that the process is using, in megabytes. Virtual memory + includes storage in the paging files on disk. + - **CPU(s)**: The amount of processor time that the process has used on all processors, in + seconds. + - **ID**: The process ID (PID) of the process. + - **ProcessName**: The name of the process. For explanations of the concepts related to processes, + see the Glossary in Help and Support Center and the Help for Task Manager. - You can also use the built-in alternate views of the processes available with `Format-Table`, such as **StartTime** and **Priority**, and you can design your own views. diff --git a/reference/5.1/Microsoft.PowerShell.Management/Get-Service.md b/reference/5.1/Microsoft.PowerShell.Management/Get-Service.md index ef2ac7550337..4d8136eef2e4 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Get-Service.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Get-Service.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 09/30/2021 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/get-service?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-Service @@ -38,7 +38,8 @@ Get-Service [-ComputerName ] [-DependentServices] [-RequiredServices] ## DESCRIPTION The `Get-Service` cmdlet gets objects that represent the services on a local computer or on a remote -computer, including running and stopped services. +computer, including running and stopped services. By default, when `Get-Service` is run without +parameters, all the local computer's services are returned. You can direct this cmdlet to get only particular services by specifying the service name or the display name of the services, or you can pipe service objects to this cmdlet. @@ -47,51 +48,52 @@ display name of the services, or you can pipe service objects to this cmdlet. ### Example 1: Get all services on the computer +This example gets all of the services on the computer. It behaves as though you typed +`Get-Service *`. The default display shows the status, service name, and display name of each +service. + ```powershell Get-Service ``` -This command gets all of the services on the computer. It behaves as though you typed -`Get-Service *`. The default display shows the status, service name, and display name of each -service. - ### Example 2: Get services that begin with a search string +This example retrieves services with service names that begin with `WMI` (Windows Management +Instrumentation). + ```powershell Get-Service "wmi*" ``` -This command retrieves services with service names that begin with WMI (the acronym for Windows -Management Instrumentation). - ### Example 3: Display services that include a search string +This example displays services with a display name that includes the word `network`. Searching the +display name finds network-related services even when the service name doesn't include `Net`, such as +xmlprov, the Network Provisioning Service. + ```powershell Get-Service -Displayname "*network*" ``` -This command displays services with a display name that includes the word network. Searching the -display name finds network-related services even when the service name does not include "Net", such -as xmlprov, the Network Provisioning Service. - ### Example 4: Get services that begin with a search string and an exclusion +This example only gets the services with service names that begin with `win`, except for the WinRM +service. + ```powershell Get-Service -Name "win*" -Exclude "WinRM" ``` -These commands get only the services with service names that begin with win, except for the WinRM -service. - ### Example 5: Display services that are currently active +This example displays only the services with a status of `Running`. + ```powershell Get-Service | Where-Object {$_.Status -eq "Running"} ``` -This command displays only the services that are currently active. It uses the `Get-Service` cmdlet -to get all of the services on the computer. The pipeline operator (`|`) passes the results to the -Where-Object cmdlet, which selects only the services with a Status property that equals Running. +`Get-Service` gets all the services on the computer and sends the objects down the pipeline. The +`Where-Object` cmdlet, selects only the services with a **Status** property that equals `Running`. Status is only one property of service objects. To see all of the properties, type `Get-Service | Get-Member`. @@ -110,6 +112,8 @@ PowerShell. ### Example 7: List the services on the local computer that have dependent services +This example gets services that have dependent services. + ```powershell Get-Service | Where-Object {$_.DependentServices} | @@ -129,16 +133,24 @@ NoOfDependentServices : 1 ... ``` -The first command uses the `Get-Service` cmdlet to get the services on the computer. A pipeline -operator (|) sends the services to the `Where-Object` cmdlet, which selects the services whose -**DependentServices** property is not null. +The `Get-Service` cmdlet gets all the services on the computer and sends the objects down the +pipeline. The `Where-Object` cmdlet selects the services whose **DependentServices** property isn't +null. -Another pipeline operator sends the results to the Format-List cmdlet. The command uses its -**Property** parameter to display the name of the service, the name of the dependent services, and a -calculated property that displays the number of dependent services that each service has. +The results are sent down the pipeline to the `Format-List` cmdlet. The **Property** parameter +displays the name of the service, the name of the dependent services, and a calculated property that +displays the number of dependent services for each service. ### Example 8: Sort services by property value +This example shows that when you sort services in ascending order by the value of their **Status** +property, stopped services appear before running services. This happens because the value of +**Status** is an enumeration, in which `Stopped` has a value of `1`, and `Running` has a value of +`4`. For more information, see +[ServiceControllerStatus](/dotnet/api/system.serviceprocess.servicecontrollerstatus). + +To list running services first, use the **Descending** parameter of the `Sort-Object` cmdlet. + ```powershell Get-Service "s*" | Sort-Object status ``` @@ -161,12 +173,6 @@ Running SENS System Event Notification Running seclogon Secondary Logon ``` -This command shows that when you sort services in ascending order by the value of their **Status** -property, stopped services appear before running services. This happens because the value of Status -is an enumeration, in which Stopped has a value of 1, and Running has a value of 4. - -To list running services first, use the **Descending** parameter of the Sort-Object cmdlet. - ### Example 9: Get services on multiple computers ```powershell @@ -183,7 +189,7 @@ Server02 Running WinRM Windows Remote Management (WS-Management) ``` This command uses the `Get-Service` cmdlet to run a `Get-Service Winrm` command on two remote -computers and the local computer ("localhost"). +computers and the local computer (`localhost`). The command runs on the remote computers, and the results are returned to the local computer. A pipeline operator (`|`) sends the results to the `Format-Table` cmdlet, which formats the services @@ -192,23 +198,22 @@ displayed in the table, including the **MachineName** property. ### Example 10: Get the dependent services of a service +This example gets the services that the WinRM service requires. The value of the service's +**ServicesDependedOn** property is returned. + ```powershell Get-Service "WinRM" -RequiredServices ``` -This command gets the services that the WinRM service requires. - -The command returns the value of the **ServicesDependedOn** property of the service. - ### Example 11: Get a service through the pipeline operator +This example gets the WinRM service on the local computer. The service name string, enclosed in +quotation marks, is sent down the pipeline to `Get-Service`. + ```powershell "WinRM" | Get-Service ``` -This command gets the WinRM service on the local computer. This example shows that you can pipe a -service name string (enclosed in quotation marks) to `Get-Service`. - ## PARAMETERS ### -ComputerName @@ -216,7 +221,7 @@ service name string (enclosed in quotation marks) to `Get-Service`. Gets the services running on the specified computers. The default is the local computer. Type the NetBIOS name, an IP address, or a fully qualified domain name (FQDN) of a remote computer. -To specify the local computer, type the computer name, a dot (`.`), or localhost. +To specify the local computer, type the computer name, a dot (`.`), or `localhost`. This parameter does not rely on Windows PowerShell remoting. You can use the **ComputerName** parameter of `Get-Service` even if your computer is not configured to run remote commands. @@ -237,8 +242,6 @@ Accept wildcard characters: False Indicates that this cmdlet gets only the services that depend upon the specified service. -By default, this cmdlet gets all services. - ```yaml Type: System.Management.Automation.SwitchParameter Parameter Sets: (All) @@ -254,7 +257,7 @@ Accept wildcard characters: False ### -DisplayName Specifies, as a string array, the display names of services to be retrieved. Wildcards are -permitted. By default, this cmdlet gets all services on the computer. +permitted. ```yaml Type: System.String[] @@ -272,7 +275,7 @@ Accept wildcard characters: True Specifies, as a string array, a service or services that this cmdlet excludes from the operation. The value of this parameter qualifies the **Name** parameter. Enter a name element or pattern, such -as "s*". Wildcards are permitted. +as `s*`. Wildcards are permitted. ```yaml Type: System.String[] @@ -290,7 +293,7 @@ Accept wildcard characters: True Specifies, as a string array, a service or services that this cmdlet includes in the operation. The value of this parameter qualifies the **Name** parameter. Enter a name element or pattern, such as -"s*". Wildcards are permitted. +`s*`. Wildcards are permitted. ```yaml Type: System.String[] @@ -307,8 +310,8 @@ Accept wildcard characters: True ### -InputObject Specifies **ServiceController** objects representing the services to be retrieved. Enter a variable -that contains the objects, or type a command or expression that gets the objects. You can also pipe -a service object to this cmdlet. +that contains the objects, or type a command or expression that gets the objects. You can pipe a +service object to this cmdlet. ```yaml Type: System.ServiceProcess.ServiceController[] @@ -324,8 +327,7 @@ Accept wildcard characters: False ### -Name -Specifies the service names of services to be retrieved. Wildcards are permitted. By default, this -cmdlet gets all of the services on the computer. +Specifies the service names of services to be retrieved. Wildcards are permitted. ```yaml Type: System.String[] @@ -341,10 +343,8 @@ Accept wildcard characters: True ### -RequiredServices -Indicates that this cmdlet gets only the services that this service requires. - -This parameter gets the value of the **ServicesDependedOn** property of the service. By default, -this cmdlet gets all services. +Indicates that this cmdlet gets only the services that this service requires. This parameter gets +the value of the **ServicesDependedOn** property of the service. ```yaml Type: System.Management.Automation.SwitchParameter @@ -362,7 +362,8 @@ Accept wildcard characters: True This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, --WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS @@ -378,18 +379,20 @@ This cmdlet returns objects that represent the services on the computer. ## NOTES -You can also refer to `Get-Service` by its built-in alias, `gsv`. For more information, see [about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). +You can also refer to `Get-Service` by its built-in alias, `gsv`. For more information, see +[about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). This cmdlet can display services only when the current user has permission to see them. If this cmdlet does not display services, you might not have permission to see them. To find the service name and display name of each service on your system, type `Get-Service`. The -service names appear in the Name column, and the display names appear in the DisplayName column. +service names appear in the **Name** column, and the display names appear in the **DisplayName** +column. -When you sort in ascending order by status value, "Stopped" services appear before "Running" -services. The Status property of a service is an enumerated value in which the names of the statuses -represent integer values. The sort is based on the integer value, not the name. "Running" appears -before "Stopped" because "Stopped" has a value of "1", and "Running" has a value of "4". +When you sort in ascending order by status value, `Stopped` services appear before `Running` +services. The **Status** property of a service is an enumerated value in which the names of the +statuses represent integer values. The sort is based on the integer value, not the name. `Running` +appears before `Stopped` because `Stopped` has a value of `1`, and `Running` has a value of `4`. ## RELATED LINKS diff --git a/reference/5.1/Microsoft.PowerShell.Management/Get-WmiObject.md b/reference/5.1/Microsoft.PowerShell.Management/Get-WmiObject.md index 47fd4596a5c2..d07d294e7ba3 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Get-WmiObject.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Get-WmiObject.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 09/27/2019 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/get-wmiobject?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-WmiObject @@ -137,7 +137,7 @@ State : Running Status : OK ``` -A pipeline operator (|) sends the output to the `Format-List` cmdlet, which adds the +A pipeline operator (`|`) sends the output to the `Format-List` cmdlet, which adds the **PSComputerName** property to the default output. **PSComputerName** is an alias of the **__Server** property of the objects that `Get-WmiObject` returns. This alias was introduced in PowerShell 3.0. @@ -255,17 +255,18 @@ When you use the **AsJob** parameter, the command returns an object that represe job and then displays the command prompt. You can continue to work in the session while the job finishes. If `Get-WmiObject` is used on a remote computer, the job is created on the local computer, and the results from remote computers are automatically returned to the local computer. To -manage the job, use the cmdlets that contain the Job cmdlets. To get the job results, use the +manage the job, use the cmdlets that contain the `Job` noun. To get the job results, use the `Receive-Job` cmdlet. > [!NOTE] -> To use this parameter with remote computers, the local and remote computers must be configured -> for remoting. Additionally, you must start Windows PowerShell by using the "Run as administrator" +> To use this parameter with remote computers, the local and remote computers must be configured for +> remoting. Additionally, you must start Windows PowerShell by using the **Run as administrator** > option in Windows Vista and later versions of Windows. For more information, see > [about_Remote_Requirements](../Microsoft.PowerShell.Core/about/about_Remote_Requirements.md). -For more information about Windows PowerShell background jobs, see [about_Jobs](../Microsoft.PowerShell.Core/about/about_Jobs.md) -and [about_Remote_Jobs](../Microsoft.PowerShell.Core/about/about_Remote_Jobs.md). +For more information about Windows PowerShell background jobs, see +[about_Jobs](../Microsoft.PowerShell.Core/about/about_Jobs.md) and +[about_Remote_Jobs](../Microsoft.PowerShell.Core/about/about_Remote_Jobs.md). ```yaml Type: System.Management.Automation.SwitchParameter @@ -284,18 +285,18 @@ Accept wildcard characters: False Specifies the authentication level to be used with the WMI connection. Valid values are: -- -1: Unchanged -- 0: Default -- 1: None (No authentication in performed.) -- 2: Connect (Authentication is performed only when the client establishes a relationship with the - application.) -- 3: Call (Authentication is performed only at the beginning of each call when the application +- `-1`: **Unchanged** +- `0`: **Default** +- `1`: **None** (No authentication in performed.) +- `2`: **Connect** (Authentication is performed only when the client establishes a relationship with + the application.) +- `3`: **Call** (Authentication is performed only at the beginning of each call when the application receives the request.) -- 4: Packet (Authentication is performed on all the data that is received from the client.) -- 5: PacketIntegrity (All the data that is transferred between the client and the application is - authenticated and verified.) -- 6: PacketPrivacy (The properties of the other authentication levels are used, and all the data is - encrypted.) +- `4`: **Packet** (Authentication is performed on all the data that is received from the client.) +- `5`: **PacketIntegrity** (All the data that is transferred between the client and the application + is authenticated and verified.) +- `6`: **PacketPrivacy** (The properties of the other authentication levels are used, and all the + data is encrypted.) ```yaml Type: System.Management.AuthenticationLevel @@ -354,7 +355,7 @@ Specifies the target computer for the management operation. Enter a fully qualif local computer, the fully qualified domain name is required. The default is the local computer. To specify the local computer, such as in a list of computer -names, use "localhost", the local computer name, or a dot (.). +names, use `localhost`, the local computer name, or a dot (`.`). This parameter does not rely on Windows PowerShell remoting, which uses WS-Management. You can use the **ComputerName** parameter of `Get-WmiObject` even if your computer is not configured to run @@ -375,7 +376,7 @@ Accept wildcard characters: False ### -Credential Specifies a user account that has permission to perform this action. The default is the current -user. Type a user name, such as "User01", "Domain01\User01", or User@Contoso.com. Or, enter a +user. Type a user name, such as `User01`, `Domain01\User01`, or `User@Contoso.com`. Or, enter a **PSCredential** object, such as an object that is returned by the `Get-Credential` cmdlet. When you type a user name, you are prompted for a password. Credentials cannot be used when targeting the local computer. @@ -431,7 +432,7 @@ Specifies a **Where** clause to use as a filter. Uses the syntax of the WMI Quer > [!IMPORTANT] > Do not include the **Where** keyword in the value of the parameter. For example, the following -> commands return only the logical disks that have a **DeviceID** of 'c:' and services that have the +> commands return only the logical disks that have a **DeviceID** of `c:` and services that have the > name 'WinRM' without using the **Where** keyword. `Get-WmiObject Win32_LogicalDisk -filter "DeviceID = 'c:' "` @@ -456,12 +457,12 @@ Specifies the impersonation level to use. The acceptable values for this parameter are: -- 0: Default. Reads the local registry for the default impersonation level. The default is usually - set to **Impersonate**. -- 1: Anonymous. Hides the credentials of the caller. -- 2: Identify. Allows objects to query the credentials of the caller. -- 3: Impersonate. Allows objects to use the credentials of the caller. -- 4: Delegate. Allows objects to permit other objects to use the credentials of the caller. +- `0`: **Default**. Reads the local registry for the default impersonation level. The default is + usually set to **Impersonate**. +- `1`: **Anonymous**. Hides the credentials of the caller. +- `2`: **Identify**. Allows objects to query the credentials of the caller. +- `3`: **Impersonate**. Allows objects to use the credentials of the caller. +- `4`: **Delegate**. Allows objects to permit other objects to use the credentials of the caller. ```yaml Type: System.Management.ImpersonationLevel @@ -500,8 +501,7 @@ Accept wildcard characters: False ### -Locale -Specifies the preferred locale for WMI objects. -Enter a value in MS_\ format. +Specifies the preferred locale for WMI objects. Enter a value in `MS_` format. ```yaml Type: System.String @@ -604,7 +604,8 @@ Accept wildcard characters: False This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, --WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS @@ -626,7 +627,7 @@ member of the local administrators group on the remote computer. Or, the default the WMI namespace of the remote repository can be changed to give access rights to other accounts. Only some of the properties of each WMI class are displayed by default. The set of properties that -is displayed for each WMI class is specified in the Types.ps1xml configuration file. To get all +is displayed for each WMI class is specified in the `Types.ps1xml` configuration file. To get all properties of a WMI object, use the `Get-Member` or `Format-List` cmdlets. ## RELATED LINKS diff --git a/reference/5.1/Microsoft.PowerShell.Management/Invoke-WmiMethod.md b/reference/5.1/Microsoft.PowerShell.Management/Invoke-WmiMethod.md index aa6de920bfdc..e0b0bacfd158 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Invoke-WmiMethod.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Invoke-WmiMethod.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 06/09/2017 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/invoke-wmimethod?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Invoke-WmiMethod @@ -155,8 +155,8 @@ PSComputerName : This command starts an instance of Notepad by calling the `Create` method of the **Win32_Process** class. -The **ReturnValue** property is populated with a 0, and the **ProcessId** property is populated with -an integer (the next process ID number) if the command is completed. +The **ReturnValue** property is populated with a `0`, and the **ProcessId** property is populated +with an integer (the next process ID number) if the command is completed. ### Example 3: Rename a file @@ -181,7 +181,7 @@ ReturnValue : 0 This command renames a file. It uses the **Path** parameter to reference an instance of the **CIM_DataFile** class. Then, it applies the Rename method to that particular instance. -The **ReturnValue** property is populated with a 0 if the command is completed. +The **ReturnValue** property is populated with a `0` if the command is completed. ### Example 4: Passing an array of values using `-ArgumentList` @@ -198,16 +198,16 @@ Invoke-WmiMethod -class Win32_SecurityDescriptorHelper -Name BinarySDToSDDL -Arg ### -ArgumentList Specifies the parameters to pass to the called method. The value of this parameter must be an array -of objects, and they must appear in the order required by the called method. The -`Invoke-CimCommand` cmdlet does not have these limitations. +of objects, and they must appear in the order required by the called method. The `Invoke-CimCommand` +cmdlet does not have these limitations. To determine the order in which to list those objects, run the `GetMethodParameters()` method on the WMI class, as illustrated in Example 1, near the end of this topic. > [!IMPORTANT] -> If the first value is an array that contains more than one element, a second value of $null is -> required. Otherwise, the command generates an error, such as "Unable to cast object of type -> 'System.Byte' to type 'System.Array'.". See example 4 above. +> If the first value is an array that contains more than one element, a second value of `$null` is +> required. Otherwise, the command generates an error, such as +> `Unable to cast object of type 'System.Byte' to type 'System.Array'.`. See example 4 above. ```yaml Type: System.Object[] @@ -230,14 +230,17 @@ When you use the **AsJob** parameter, the command returns an object that represe job and then displays the command prompt. You can continue to work in the session while the job finishes. If `Invoke-WmiMethod` is used against a remote computer, the job is created on the local computer, and the results from remote computers are automatically returned to the local computer. To -manage the job, use the cmdlets that contain the Job noun (the Job cmdlets). To get the job results, -use the Receive-Job cmdlet. +manage the job, use the cmdlets that contain the `Job` noun (the Job cmdlets). To get the job +results, use the `Receive-Job` cmdlet. To use this parameter with remote computers, the local and remote computers must be configured for -remoting. Additionally, you must start Windows PowerShell by using the Run as administrator option -in Windows Vista and later versions of Windows. For more information, see [about_Remote_Requirements](../Microsoft.PowerShell.Core/About/about_Remote_Requirements.md). +remoting. Additionally, you must start Windows PowerShell by using the **Run as administrator** +option in Windows Vista and later versions of Windows. For more information, see +[about_Remote_Requirements](../Microsoft.PowerShell.Core/About/about_Remote_Requirements.md). -For more information about Windows PowerShell background jobs, see [about_Jobs](../Microsoft.PowerShell.Core/About/about_Jobs.md) and about_Remote_Jobs. +For more information about Windows PowerShell background jobs, see +[about_Jobs](../Microsoft.PowerShell.Core/About/about_Jobs.md) and +[about_Remote_Jobs](../Microsoft.PowerShell.Core/About/about_Remote_Jobs.md). ```yaml Type: System.Management.Automation.SwitchParameter @@ -256,18 +259,18 @@ Accept wildcard characters: False Specifies the authentication level to be used with the WMI connection. The acceptable values for this parameter are: -- -1: Unchanged -- 0: Default -- 1: None (No authentication in performed.) -- 2: Connect (Authentication is performed only when the client establishes a relationship with the - application.) -- 3: Call (Authentication is performed only at the beginning of each call when the application +- `-1`: **Unchanged** +- `0`: **Default** +- `1`: **None** (No authentication in performed.) +- `2`: **Connect** (Authentication is performed only when the client establishes a relationship with + the application.) +- `3`: **Call** (Authentication is performed only at the beginning of each call when the application receives the request.) -- 4: Packet (Authentication is performed on all the data that is received from the client.) -- 5: PacketIntegrity (All the data that is transferred between the client and the application is - authenticated and verified.) -- 6: PacketPrivacy (The properties of the other authentication levels are used, and all the data is - encrypted.) +- `4`: **Packet** (Authentication is performed on all the data that is received from the client.) +- `5`: **PacketIntegrity** (All the data that is transferred between the client and the application + is authenticated and verified.) +- `6`: **PacketPrivacy** (The properties of the other authentication levels are used, and all the + data is encrypted.) ```yaml Type: System.Management.AuthenticationLevel @@ -286,9 +289,9 @@ Accept wildcard characters: False Specifies the authority to use to authenticate the WMI connection. You can specify standard Windows NT LAN Manager (NTLM) or Kerberos authentication. To use NTLM, set the authority setting to -ntlmdomain:\, where \ identifies a valid NTLM domain name. To use -Kerberos, specify kerberos:\. You cannot include the authority setting when -you connect to the local computer. +`ntlmdomain:`, where `` identifies a valid NTLM domain name. To use +Kerberos, specify `kerberos:\`. You cannot include the authority setting +when you connect to the local computer. ```yaml Type: System.String @@ -324,7 +327,7 @@ Specifies, as a string array, the computers that this cmdlet runs the command on local computer. Type the NetBIOS name, an IP address, or a fully qualified domain name of one or more computers. To -specify the local computer, type the computer name, a dot (.), or localhost. +specify the local computer, type the computer name, a dot (`.`), or `localhost`. This parameter does not rely on Windows PowerShell remoting. You can use the **ComputerName** parameter even if your computer is not configured to run remote commands. @@ -345,7 +348,7 @@ Accept wildcard characters: False Specifies a user account that has permission to perform this action. The default is the current user. Type a user name, such as `User01`, `Domain01\User01`, or `User@Contoso.com`. Or, enter a -**PSCredential** object, such as an object that is returned by the Get-Credential cmdlet. When you +**PSCredential** object, such as an object that is returned by the `Get-Credential` cmdlet. When you type a user name, you will be prompted for a password. ```yaml @@ -381,12 +384,12 @@ Accept wildcard characters: False Specifies the impersonation level to use. The acceptable values for this parameter are: -- 0: Default (Reads the local registry for the default impersonation level, which is usually set to - "3: Impersonate".) -- 1: Anonymous (Hides the credentials of the caller.) -- 2: Identify (Allows objects to query the credentials of the caller.) -- 3: Impersonate (Allows objects to use the credentials of the caller.) -- 4: Delegate (Allows objects to permit other objects to use the credentials of the caller.) +- `0`: **Default** (Reads the local registry for the default impersonation level, which is usually + set to `3`: **Impersonate**.) +- `1`: **Anonymous** (Hides the credentials of the caller.) +- `2`: **Identify** (Allows objects to query the credentials of the caller.) +- `3`: **Impersonate** (Allows objects to use the credentials of the caller.) +- `4`: **Delegate** (Allows objects to permit other objects to use the credentials of the caller.) ```yaml Type: System.Management.ImpersonationLevel diff --git a/reference/5.1/Microsoft.PowerShell.Management/New-EventLog.md b/reference/5.1/Microsoft.PowerShell.Management/New-EventLog.md index bd899ae56a5a..c06fd57a2b7d 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/New-EventLog.md +++ b/reference/5.1/Microsoft.PowerShell.Management/New-EventLog.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 01/22/2019 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/new-eventlog?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: New-EventLog @@ -17,8 +17,8 @@ Creates a new event log and a new event source on a local or remote computer. ``` New-EventLog [-LogName] [-Source] [[-ComputerName] ] - [-CategoryResourceFile ] [-MessageResourceFile ] [-ParameterResourceFile ] - [] +[-CategoryResourceFile ] [-MessageResourceFile ] [-ParameterResourceFile ] +[] ``` ## DESCRIPTION @@ -26,15 +26,16 @@ New-EventLog [-LogName] [-Source] [[-ComputerName] [-PSProvider ] [-Scope ] [-Force] [-WhatIf] [-Confirm] - [-UseTransaction] [] +Remove-PSDrive [-Name] [-PSProvider ] [-Scope ] [-Force] [-WhatIf] +[-Confirm] [-UseTransaction] [] ``` ### LiteralName ``` -Remove-PSDrive [-LiteralName] [-PSProvider ] [-Scope ] [-Force] [-WhatIf] - [-Confirm] [-UseTransaction] [] +Remove-PSDrive [-LiteralName] [-PSProvider ] [-Scope ] [-Force] +[-WhatIf] [-Confirm] [-UseTransaction] [] ``` ## DESCRIPTION -The `Remove-PSDrive` cmdlet deletes temporary PowerShell drives that were created by using the `New-PSDrive` cmdlet. +The `Remove-PSDrive` cmdlet deletes temporary PowerShell drives that were created by using the +`New-PSDrive` cmdlet. -Beginning in Windows PowerShell 3.0, `Remove-PSDrive` also disconnects mapped network drives, including, but not limited to, drives created by using the `Persist` parameter of `New-PSDrive`. +Beginning in Windows PowerShell 3.0, `Remove-PSDrive` also disconnects mapped network drives, +including, but not limited to, drives created by using the **Persist** parameter of `New-PSDrive`. `Remove-PSDrive` cannot delete Windows physical or logical drives. -Beginning in Windows PowerShell 3.0, when an external drive is connected to the computer, PowerShell automatically adds a PSDrive to the file system that represents the new drive. -You do not need to restart PowerShell. -Similarly, when an external drive is disconnected from the computer, PowerShell automatically deletes the PSDrive that represents the removed drive. +Beginning in Windows PowerShell 3.0, when an external drive is connected to the computer, PowerShell +automatically adds a PSDrive to the file system that represents the new drive. You do not need to +restart PowerShell. Similarly, when an external drive is disconnected from the computer, PowerShell +automatically deletes the PSDrive that represents the removed drive. ## EXAMPLES ### Example 1: Remove a file system drive -This command removes a temporary file system drive named "smp". +This command removes a temporary file system drive named `smp`. ```powershell Remove-PSDrive -Name smp @@ -52,7 +55,7 @@ Remove-PSDrive -Name smp ### Example 2: Remove mapped network drives -This command uses `Remove-PSDrive` to disconnect the X: and S: mapped network drives. +This command uses `Remove-PSDrive` to disconnect the `X:` and `S:` mapped network drives. ```powershell Get-PSDrive X, S | Remove-PSDrive @@ -80,10 +83,9 @@ Accept wildcard characters: False Specifies the name of the drive. -The value of **LiteralName** is used exactly as typed. -No characters are interpreted as wildcards. -If the name includes escape characters, enclose it in single quotation marks ('). -Single quotation marks instruct PowerShell not to interpret any characters as escape sequences. +The value of **LiteralName** is used exactly as typed. No characters are interpreted as wildcards. +If the name includes escape characters, enclose it in single quotation marks (`'`). Single quotation +marks instruct PowerShell not to interpret any characters as escape sequences. ```yaml Type: System.String[] @@ -99,8 +101,7 @@ Accept wildcard characters: False ### -Name -Specifies the names of the drives to remove. -Do not type a colon (:) after the drive name. +Specifies the names of the drives to remove. Do not type a colon (`:`) after the drive name. ```yaml Type: System.String[] @@ -116,8 +117,8 @@ Accept wildcard characters: True ### -PSProvider -Specifies an array of **PSProvider** objects. -This cmdlet removes and disconnects all of the drives associated with the specified PowerShell provider. +Specifies an array of **PSProvider** objects. This cmdlet removes and disconnects all of the drives +associated with the specified PowerShell provider. ```yaml Type: System.String[] @@ -133,9 +134,10 @@ Accept wildcard characters: False ### -Scope -Specifies a scope for the drive. -The acceptable values for this parameter are: Global, Local, and Script, or a number relative to the current scope. Scopes number 0 through the number of scopes. The current scope number is 0 and its parent is 1. -For more information, see [about_Scopes](../Microsoft.PowerShell.Core/About/about_Scopes.md). +Specifies a scope for the drive. The acceptable values for this parameter are: `Global`, `Local`, +and `Script`, or a number relative to the current scope. Scopes number `0` through the number of +scopes. The current scope number is `0` and its parent is `1`. For more information, see +[about_Scopes](../Microsoft.PowerShell.Core/About/about_Scopes.md). ```yaml Type: System.String @@ -151,9 +153,9 @@ Accept wildcard characters: False ### -UseTransaction -Includes the command in the active transaction. -This parameter is valid only when a transaction is in progress. -For more information, see [about_Transactions](../Microsoft.PowerShell.Core/About/about_Transactions.md). +Includes the command in the active transaction. This parameter is valid only when a transaction is +in progress. For more information, see +[about_Transactions](../Microsoft.PowerShell.Core/About/about_Transactions.md). ```yaml Type: System.Management.Automation.SwitchParameter @@ -185,8 +187,7 @@ Accept wildcard characters: False ### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. +Shows what would happen if the cmdlet runs. The cmdlet is not run. ```yaml Type: System.Management.Automation.SwitchParameter @@ -202,13 +203,17 @@ Accept wildcard characters: False ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). ## INPUTS ### System.Management.Automation.PSDriveInfo -You can pipe a drive object, such as one from the `Get-PSDrive` cmdlet, to the `Remove-PSDrive` cmdlet. +You can pipe a drive object, such as one from the `Get-PSDrive` cmdlet, to the `Remove-PSDrive` +cmdlet. ## OUTPUTS @@ -218,7 +223,9 @@ This cmdlet does not return any output. ## NOTES -- The `Remove-PSDrive` cmdlet is designed to work with the data exposed by any PowerShell provider. To list the providers in your session, use the `Get-PSProvider` cmdlet. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). +- The `Remove-PSDrive` cmdlet is designed to work with the data exposed by any PowerShell provider. + To list the providers in your session, use the `Get-PSProvider` cmdlet. For more information, see + [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). ## RELATED LINKS diff --git a/reference/5.1/Microsoft.PowerShell.Management/Resolve-Path.md b/reference/5.1/Microsoft.PowerShell.Management/Resolve-Path.md index 49ece00091ff..62b1ddbd1d68 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Resolve-Path.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Resolve-Path.md @@ -113,7 +113,7 @@ PS C:\> Resolve-Path -LiteralPath 'test[xml]' Specifies a user account that has permission to perform this action. The default is the current user. -Type a user name, such as User01 or Domain01\User01, or pass a **PSCredential** object. You can +Type a user name, such as `User01` or `Domain01\User01`, or pass a **PSCredential** object. You can create a **PSCredential** object using the `Get-Credential` cmdlet. If you type a user name, this cmdlet prompts you for a password. @@ -135,8 +135,8 @@ Accept wildcard characters: False Specifies the path to be resolved. The value of the **LiteralPath** parameter is used exactly as typed. No characters are interpreted as wildcard characters. If the path includes escape characters, -enclose it in single quotation marks. Single quotation marks tell PowerShell not to interpret any -characters as escape sequences. +enclose it in single quotation marks (`'`). Single quotation marks tell PowerShell not to interpret +any characters as escape sequences. ```yaml Type: System.String[] diff --git a/reference/5.1/Microsoft.PowerShell.Management/Start-Service.md b/reference/5.1/Microsoft.PowerShell.Management/Start-Service.md index 0ed3fa68b5f7..868bf0f1f3f2 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Start-Service.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Start-Service.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 06/09/2017 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/start-service?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Start-Service @@ -78,7 +78,7 @@ Start-Service -InputObject $s -PassThru | Format-List >> services.txt First we use `Get-Service` to get an object that represent the WMI service and store it in the `$s` variable. Next, we start the service. Without the **PassThru** parameter, `Start-Service` does not -create any output. The pipeline operator (|) passes the object output by `Start-Service` to the +create any output. The pipeline operator (`|`) passes the object output by `Start-Service` to the `Format-List` cmdlet to format the object as a list of its properties. The append redirection operator (`>>`) redirects the output to the services.txt file. The output is added to the end of the existing file. diff --git a/reference/5.1/Microsoft.PowerShell.Security/About/about_Certificate_Provider.md b/reference/5.1/Microsoft.PowerShell.Security/About/about_Certificate_Provider.md index 654559558640..046987c8dfea 100644 --- a/reference/5.1/Microsoft.PowerShell.Security/About/about_Certificate_Provider.md +++ b/reference/5.1/Microsoft.PowerShell.Security/About/about_Certificate_Provider.md @@ -1,7 +1,7 @@ --- description: Information about the Certificate provider. Locale: en-US -ms.date: 05/12/2022 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.security/about/about_certificate_provider?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: about Certificate Provider @@ -29,8 +29,8 @@ Provides access to X.509 certificate stores and certificates in PowerShell. The PowerShell **Certificate** provider lets you get, add, change, clear, and delete certificates and certificate stores in PowerShell. -The **Certificate** drive is a hierarchical namespace containing the -certificate stores and certificates on your computer. +The **Certificate** drive is a hierarchical namespace containing the certificate +stores and certificates on your computer. The **Certificate** provider supports the following cmdlets, which are covered in this article. @@ -76,9 +76,9 @@ the `Cert:` drive. Set-Location Cert: ``` -You can also work with the certificate provider from any other PowerShell -drive. To reference an alias from another location, use the `Cert:` drive name -in the path. +You can also work with the certificate provider from any other PowerShell drive. +To reference an alias from another location, use the `Cert:` drive name in the +path. ```powershell PS Cert:\> Set-Location -Path LocalMachine\Root @@ -161,8 +161,9 @@ Get-ChildItem -Path cert:\LocalMachine\My, cert:\LocalMachine\WebHosting ` ### Find expired certificates on remote computers This command uses the `Invoke-Command` cmdlet to run a `Get-ChildItem` command -on the Srv01 and Srv02 computers. A value of zero (0) in the **ExpiringInDays** -parameter gets certificates on the Srv01 and Srv02 computers that have expired. +on the Srv01 and Srv02 computers. A value of zero (`0`) in the +**ExpiringInDays** parameter gets certificates on the Srv01 and Srv02 computers +that have expired. ```powershell Invoke-Command -ComputerName Srv01, Srv02 {Get-ChildItem -Path cert:\* ` @@ -192,8 +193,8 @@ Get-ChildItem -Path cert:\* -Recurse -DNSName "*fabrikam*" ` ## Opening the Certificates MMC Snap-in -The `Invoke-Item` cmdlet will use the default application to open a path -you specify. For certificates, the default application is the Certificates MMC +The `Invoke-Item` cmdlet will use the default application to open a path you +specify. For certificates, the default application is the Certificates MMC snap-in. This command opens the Certificates MMC snap-in to manage the specified @@ -205,8 +206,8 @@ Invoke-Item cert:\CurrentUser\my\6B8223358119BB08840DEE50FD8AF9EA776CE66B ## Copying Certificates -Copying certificates is not supported by the **Certificate** provider. When -you attempt to copy a certificate, you see this error. +Copying certificates is not supported by the **Certificate** provider. When you +attempt to copy a certificate, you see this error. ``` $path = "Cert:\LocalMachine\Root\E2C0F6662D3C569705B4B31FE2CBF3434094B254" @@ -238,8 +239,8 @@ This command uses the **SSLServerAuthentication** parameter of the `Get-ChildItem` cmdlet to get SSL server authentication certificates in the `My` certificate store. -The returned certificates are piped to the `Move-Item` cmdlet, which moves -the certificates to the `WebHosting` store. +The returned certificates are piped to the `Move-Item` cmdlet, which moves the +certificates to the `WebHosting` store. ```powershell Get-ChildItem cert:\LocalMachine\My -SSLServerAuthentication | Move-Item ` @@ -249,12 +250,12 @@ Get-ChildItem cert:\LocalMachine\My -SSLServerAuthentication | Move-Item ` ## Deleting Certificates and Private Keys The `Remove-Item` cmdlet will remove certificates that you specify. The -`-DeleteKey` dynamic parameter deletes the private key. +**DeleteKey** dynamic parameter deletes the private key. ### Delete a Certificate from the CA store -This command deletes a certificate from the CA certificate store, but leaves -the associated private key intact. +This command deletes a certificate from the CA certificate store, but leaves the +associated private key intact. In the `Cert:` drive, the `Remove-Item` cmdlet supports only the **DeleteKey**, **Path**, **WhatIf**, and **Confirm** parameters. All other parameters are @@ -327,9 +328,9 @@ This command uses the **ExpiringInDays** parameter of the `Get-ChildItem` cmdlet with a value of `0` to get certificates in the `WebHosting` store that have expired. -The variable containing the returned certificates is piped to the -`Remove-Item` cmdlet, which deletes them. The command uses the **DeleteKey** -parameter to delete the private key along with the certificate. +The variable containing the returned certificates is piped to the `Remove-Item` +cmdlet, which deletes them. The command uses the **DeleteKey** parameter to +delete the private key along with the certificate. ```powershell $expired = Get-ChildItem cert:\LocalMachine\WebHosting -ExpiringInDays 0 @@ -347,8 +348,8 @@ cmdlet to create a certificate for testing purposes. In the `Cert:` drive, the `New-Item` cmdlet creates certificate stores in the `LocalMachine` store location. It supports the **Name**, **Path**, **WhatIf**, and **Confirm** parameters. All other parameters are ignored. The command -returns a **System.Security.Cryptography.X509Certificates.X509Store** -that represents the new certificate store. +returns a **System.Security.Cryptography.X509Certificates.X509Store** that +represents the new certificate store. This command creates a new certificate store named `CustomStore` in the `LocalMachine` store location. @@ -364,8 +365,8 @@ This command creates a new certificate store named `HostingStore` in the The command uses the `Invoke-Command` cmdlet to run a `New-Item` command on the Server01 computer. The command returns a -**System.Security.Cryptography.X509Certificates.X509Store** that represents -the new certificate store. +**System.Security.Cryptography.X509Certificates.X509Store** that represents the +new certificate store. ```powershell Invoke-Command { New-Item -Path cert:\LocalMachine\CustomStore } ` @@ -403,16 +404,16 @@ Invoke-Command { Remove-Item -Path cert:\LocalMachine\TestStore -Recurse } ` ## Dynamic parameters -Dynamic parameters are cmdlet parameters that are added by a PowerShell -provider and are available only when the cmdlet is being used in the -provider-enabled drive. These parameters are valid in all subdirectories of the -**Certificate** provider, but are effective only on certificates. +Dynamic parameters are cmdlet parameters that are added by a PowerShell provider +and are available only when the cmdlet is being used in the provider-enabled +drive. These parameters are valid in all subdirectories of the **Certificate** +provider, but are effective only on certificates. > [!NOTE] > Parameters that perform filtering against the **EnhancedKeyUsageList** -> property also return items with an empty **EnhancedKeyUsageList** property -> value. Certificates that have an empty **EnhancedKeyUsageList** can be used -> for all purposes. +> property also return items with an empty **EnhancedKeyUsageList** +> property value. Certificates that have an empty **EnhancedKeyUsageList** can +> be used for all purposes. ### CodeSigningCert @@ -430,14 +431,15 @@ This parameter gets certificates that have `Code Signing` in their - [Remove-Item](xref:Microsoft.PowerShell.Management.Remove-Item) -This parameter deletes the associated private key when it deletes the certificate. +This parameter deletes the associated private key when it deletes the +certificate. > [!IMPORTANT] > To delete a private key that is associated with a user certificate in the > `Cert:\CurrentUser` store on a remote computer, you must use delegated -> credentials. The `Invoke-Command` cmdlet supports credential delegation -> using the **CredSSP** parameter. You should consider any security risks -> before using `Remove-Item` with `Invoke-Command` and credential delegation. +> credentials. The `Invoke-Command` cmdlet supports credential delegation using +> the **CredSSP** parameter. You should consider any security risks before using +> `Remove-Item` with `Invoke-Command` and credential delegation. This parameter was introduced in PowerShell 3.0. @@ -494,10 +496,10 @@ This parameter allows you to specify the type of item created by `New-Item`. In a `Certificate` drive, the following values are allowed: -- Certificate Provider -- Certificate -- Store -- StoreLocation +- `Certificate Provider` +- `Certificate` +- `Store` +- `StoreLocation` #### Cmdlets Supported diff --git a/reference/5.1/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md b/reference/5.1/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md index 60d48ea86a6c..d309843fe44f 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 10/22/2021 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/convertfrom-csv?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: ConvertFrom-Csv @@ -147,11 +147,9 @@ generate objects from the CSV strings. ### -Delimiter -Specifies the delimiter that separates the property values in the CSV strings. -The default is a comma (,). - -Enter a character, such as a colon (:). -To specify a semicolon (;) enclose it in single quotation marks. +Specifies the delimiter that separates the property values in the CSV strings. The default is a +comma (`,`). Enter a character, such as a colon (`:`). To specify a semicolon (`;`) enclose it in +single quotation marks. If you specify a character other than the actual string delimiter in the file, `ConvertFrom-Csv` cannot create the objects from the CSV strings and will return the CSV strings. diff --git a/reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Html.md b/reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Html.md index 77a3ab23ce9b..4db4095e248e 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Html.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Html.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 08/10/2020 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/convertto-html?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: ConvertTo-Html @@ -71,7 +71,7 @@ the `Out-File` cmdlet to send the HTML code to the `aliases.htm` file. ### Example 3: Create a web page to display PowerShell events ```powershell -`Get-EventLog` -LogName "Windows PowerShell" | ConvertTo-Html | Out-File pslog.htm +Get-EventLog -LogName "Windows PowerShell" | ConvertTo-Html | Out-File pslog.htm ``` This command creates an HTML page called `pslog.htm` that displays the events in the Windows @@ -102,7 +102,7 @@ on the computer. The command uses the pipeline operator (`|`) to send the proces The command uses the **Property** parameter to select three properties of the process objects to be included in the table. The command uses the **Title** parameter to specify a title for the HTML page. The command also uses the `Out-File` cmdlet to send the resulting HTML to a file named -Proc.htm. +`Proc.htm`. The second command uses the `Invoke-Item` cmdlet to open the `Proc.htm` in the default browser. @@ -156,7 +156,7 @@ Get-Date | ConvertTo-Html -Fragment ``` This command uses `ConvertTo-Html` to generate an HTML table of the current date. The command uses -the `Get-Date` cmdlet to get the current date. It uses a pipeline operator (|) to send the results +the `Get-Date` cmdlet to get the current date. It uses a pipeline operator (`|`) to send the results to the `ConvertTo-Html` cmdlet. The `ConvertTo-Html` command includes the **Fragment** parameter, which limits the output to an HTML @@ -193,12 +193,13 @@ Invoke-Item Services.htm ``` This command creates and opens a Web page that displays the services on the computer that begin with -A. It uses the **Title**, **Body**, **PreContent**, and **PostContent** parameters of +`A`. It uses the **Title**, **Body**, **PreContent**, and **PostContent** parameters of `ConvertTo-Html` to customize the output. The first part of the command uses the `Get-Service` cmdlet to get the services on the computer that -begin with A. The command uses a pipeline operator (`|`) to send the results to the `ConvertTo-Html` -cmdlet. The command also uses the `Out-File` cmdlet to send the output to the Services.htm file. +begin with `A`. The command uses a pipeline operator (`|`) to send the results to the +`ConvertTo-Html` cmdlet. The command also uses the `Out-File` cmdlet to send the output to the +`Services.htm` file. A semicolon (`;`) ends the first command and starts a second command, which uses the `Invoke-Item` cmdlet to open the `Services.htm` file in the default browser. @@ -267,7 +268,7 @@ Accept wildcard characters: False ### -Fragment -Generates only an HTML table. The HTML, HEAD, TITLE, and BODY tags are omitted. +Generates only an HTML table. The ``, ``, ``, and `<BODY>` tags are omitted. ```yaml Type: System.Management.Automation.SwitchParameter @@ -360,10 +361,10 @@ Includes the specified properties of the objects in the HTML. The value of the * parameter can be a new calculated property. The calculated property can be a script block or a hash table. Valid key-value pairs are: -- Expression - `<string>` or `<script block>` -- FormatString - `<string>` -- Width - `<int32>` - must be greater than `0` -- Alignment - value can be `Left`, `Center`, or `Right` +- `Expression` - `<string>` or `<script block>` +- `FormatString` - `<string>` +- `Width` - `<int32>` - must be greater than `0` +- `Alignment` - value can be `Left`, `Center`, or `Right` For more information, see [about_Calculated_Properties](../Microsoft.PowerShell.Core/About/about_Calculated_Properties.md). @@ -432,7 +433,7 @@ quite different. submit the processes on a computer to `ConvertTo-Html`, the resulting table displays an object array and its properties. - To comply with the XHTML Strict DTD, the DOCTYPE tag is modified accordingly: + To comply with the XHTML Strict DTD, the `DOCTYPE` tag is modified accordingly: `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"\>` diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Format-List.md b/reference/5.1/Microsoft.PowerShell.Utility/Format-List.md index 1376b77b9a7f..ce67dae664e6 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Format-List.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Format-List.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 12/19/2018 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/format-list?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Format-List @@ -23,7 +23,7 @@ Format-List [[-Property] <Object[]>] [-GroupBy <Object>] [-View <string>] [-Show The `Format-List` cmdlet formats the output of a command as a list of properties in which each property is displayed on a separate line. You can use `Format-List` to format and display all or -selected properties of an object as a list (format-list *). +selected properties of an object as a list (`Format-List -Property *`). Because more space is available for each item in a list than in a table, PowerShell displays more properties of the object in the list, and the property values are less likely to be truncated. @@ -38,7 +38,7 @@ Get-Service | Format-List This command formats information about services on the computer as a list. By default, the services are formatted as a table. The `Get-Service` cmdlet gets objects representing the services on the -computer. The pipeline operator (|) passes the results through the pipeline to `Format-List`. +computer. The pipeline operator (`|`) passes the results through the pipeline to `Format-List`. Then, the `Format-List` command formats the service information in a list and sends it to the default output cmdlet for display. @@ -62,12 +62,12 @@ the formatted output to the default output cmdlet for display. This command displays the name, base priority, and priority class of each process on the computer. ```powershell -Get-Process | Format-List -Property name, basepriority, priorityclass +Get-Process | Format-List -Property Name, BasePriority, PriorityClass ``` It uses the `Get-Process` cmdlet to get an object representing each process. The pipeline operator -(|) passes the process objects through the pipeline to `Format-List`. `Format-List` formats the -processes as a list of the specified properties. The *Property* parameter name is optional, so you +(`|`) passes the process objects through the pipeline to `Format-List`. `Format-List` formats the +processes as a list of the specified properties. The **Property** parameter name is optional, so you can omit it. ### Example 4: Format all properties for a process @@ -79,9 +79,9 @@ Get-Process winlogon | Format-List -Property * ``` It uses the Get-Process cmdlet to get an object representing the Winlogon process. The pipeline -operator (|) passes the Winlogon process object through the pipeline to `Format-List`. The command -uses the *Property* parameter to specify the properties and the \* to indicate all properties. -Because the name of the *Property* parameter is optional, you can omit it and type the command as +operator (`|`) passes the Winlogon process object through the pipeline to `Format-List`. The command +uses the **Property** parameter to specify the properties and the `*` to indicate all properties. +Because the name of the **Property** parameter is optional, you can omit it and type the command as `Format-List *`. `Format-List` automatically sends the results to the default output cmdlet for display. @@ -129,12 +129,12 @@ Accept wildcard characters: False ### -Expand Specifies the formatted collection object, as well as the objects in the collection. This parameter -is designed to format objects that support the ICollection (System.Collections) interface. The -default value is EnumOnly. The acceptable values for this parameter are: +is designed to format objects that support the **System.Collections.ICollection** interface. The +default value is `EnumOnly`. The acceptable values for this parameter are: -- EnumOnly. Displays the properties of the objects in the collection. -- CoreOnly. Displays the properties of the collection object. -- Both. Displays the properties of the collection object and the properties of objects in the +- `EnumOnly`. Displays the properties of the objects in the collection. +- `CoreOnly`. Displays the properties of the collection object. +- `Both`. Displays the properties of the collection object and the properties of objects in the collection. ```yaml @@ -176,9 +176,9 @@ property of the output. The value of the **GroupBy** parameter can be a new calculated property. The calculated property can be a script block or a hash table. Valid key-value pairs are: -- Name (or Label) - `<string>` -- Expression - `<string>` or `<script block>` -- FormatString - `<string>` +- `Name` (or `Label`) - `<string>` +- `Expression` - `<string>` or `<script block>` +- `FormatString` - `<string>` For more information, see [about_Calculated_Properties](../Microsoft.PowerShell.Core/About/about_Calculated_Properties.md). @@ -218,15 +218,15 @@ Specifies the object properties that appear in the display and the order in whic Wildcards are permitted. If you omit this parameter, the properties that appear in the display depend on the object being -displayed. The parameter name "Property" is optional. You cannot use the **Property** and **View** +displayed. The parameter name **Property** is optional. You cannot use the **Property** and **View** parameters in the same command. The value of the **Property** parameter can be a new calculated property. The calculated property can be a script block or a hash table. Valid key-value pairs are: -- Name (or Label) - `<string>` -- Expression - `<string>` or `<script block>` -- FormatString - `<string>` +- `Name` (or `Label`) - `<string>` +- `Expression` - `<string>` or `<script block>` +- `FormatString` - `<string>` For more information, see [about_Calculated_Properties](../Microsoft.PowerShell.Core/About/about_Calculated_Properties.md). @@ -299,17 +299,17 @@ You can pipe any object to `Format-List`. ## NOTES -You can also refer to Format-List by its built-in alias, FL. For more information, see +You can also refer to `Format-List` by its built-in alias, `fl`. For more information, see [about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). The format cmdlets, such as `Format-List`, arrange the data to be displayed but do not display it. -The data is displayed by the output features of PowerShell and by the cmdlets that contain the Out -verb (the Out cmdlets), such as `Out-Host` or `Out-File`. +The data is displayed by the output features of PowerShell and by the cmdlets that contain the `Out` +verb (the `Out` cmdlets), such as `Out-Host` or `Out-File`. If you do not use a format cmdlet, PowerShell applies that default format for each object that it displays. -The **GroupBy** parameter assumes that the objects are sorted. Use Sort-Object before using +The **GroupBy** parameter assumes that the objects are sorted. Use `Sort-Object` before using `Format-List` to group the objects. The **View** parameter lets you specify an alternate format for the table. You can use the views diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Format-Wide.md b/reference/5.1/Microsoft.PowerShell.Utility/Format-Wide.md index 0be18cb153af..3b4cb5709f11 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Format-Wide.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Format-Wide.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 08/10/2020 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/format-wide?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Format-Wide @@ -36,23 +36,23 @@ screen. Get-ChildItem | Format-Wide -Column 3 ``` -The Get-ChildItem cmdlet gets objects representing each file in the directory. The pipeline -operator (|) passes the file objects through the pipeline to `Format-Wide`, which formats them for +The `Get-ChildItem` cmdlet gets objects representing each file in the directory. The pipeline +operator (`|`) passes the file objects through the pipeline to `Format-Wide`, which formats them for output. The **Column** parameter specifies the number of columns. ### Example 2: Format names of registry keys -This command displays the names of registry keys in the HKEY_CURRENT_USER\Software\Microsoft key. +This command displays the names of registry keys in the `HKEY_CURRENT_USER\Software\Microsoft` key. ```powershell Get-ChildItem HKCU:\software\microsoft | Format-Wide -Property pschildname -AutoSize ``` -The Get-ChildItem cmdlet gets objects representing the keys. The path is specified as HKCU:, one of -the drives exposed by the PowerShell Registry provider, followed by the key path. The pipeline -operator (|) passes the registry key objects through the pipeline to `Format-Wide`, which formats -them for output. The **Property** parameter specifies the name of the property, and the -**AutoSize** parameter adjusts the columns for readability. +The `Get-ChildItem` cmdlet gets objects representing the keys. The path is specified as `HKCU:`, one +of the drives exposed by the PowerShell Registry provider, followed by the key path. The pipeline +operator (`|`) passes the registry key objects through the pipeline to `Format-Wide`, which formats +them for output. The **Property** parameter specifies the name of the property, and the **AutoSize** +parameter adjusts the columns for readability. ### Example 3: Troubleshooting format errors @@ -131,14 +131,14 @@ Accept wildcard characters: False ### -Expand Formats the collection object, as well as the objects in the collection. This parameter is designed -to format objects that support the ICollection (System.Collections) interface. The default value is -**EnumOnly**. +to format objects that support the **System.Collections.ICollection** interface. The default value +is `EnumOnly`. Valid values are: -- EnumOnly: Displays the properties of the objects in the collection. -- CoreOnly: Displays the properties of the collection object. -- Both: Displays the properties of the collection object and the properties of objects in the +- `EnumOnly`: Displays the properties of the objects in the collection. +- `CoreOnly`: Displays the properties of the collection object. +- `Both`: Displays the properties of the collection object and the properties of objects in the collection. ```yaml @@ -181,9 +181,9 @@ of the output. The value of the **GroupBy** parameter can be a new calculated property. The calculated property can be a script block or a hash table. Valid key-value pairs are: -- Name (or Label) - `<string>` -- Expression - `<string>` or `<script block>` -- FormatString - `<string>` +- `Name` (or `Label`) - `<string>` +- `Expression` - `<string>` or `<script block>` +- `FormatString` - `<string>` For more information, see [about_Calculated_Properties](../Microsoft.PowerShell.Core/About/about_Calculated_Properties.md). @@ -219,18 +219,17 @@ Accept wildcard characters: False ### -Property -Specifies the object property that appears in the display. -Wildcards are permitted. +Specifies the object property that appears in the display. Wildcards are permitted. If you omit this parameter, the properties that appear in the display depend on the object being -displayed. The parameter name "Property" is optional. You cannot use the **Property** and **View** +displayed. The parameter name **Property** is optional. You cannot use the **Property** and **View** parameters in the same command. -The value of the **Property** parameter can be a new calculated property. The calculated property can -be a script block or a hash table. Valid key-value pairs are: +The value of the **Property** parameter can be a new calculated property. The calculated property +can be a script block or a hash table. Valid key-value pairs are: -- Expression - `<string>` or `<script block>` -- FormatString - `<string>` +- `Expression` - `<string>` or `<script block>` +- `FormatString` - `<string>` For more information, see [about_Calculated_Properties](../Microsoft.PowerShell.Core/About/about_Calculated_Properties.md). @@ -303,7 +302,8 @@ You can pipe any object to `Format-Wide`. ## NOTES -You can also refer to `Format-Wide` by its built-in alias, `fw`. For more information, see [about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). +You can also refer to `Format-Wide` by its built-in alias, `fw`. For more information, see +[about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). The **GroupBy** parameter assumes that the objects are sorted. Use `Sort-Object` before using `Format-Custom` to group the objects. @@ -314,7 +314,7 @@ in new PS1XML files and use the `Update-FormatData` cmdlet to include them in Po The alternate view for the **View** parameter must use table format; if it does not, the command fails. If the alternate view is a list, use `Format-List`. If the alternate view is neither a list -nor a table, use Format-Custom. +nor a table, use `Format-Custom`. ## RELATED LINKS diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Get-Unique.md b/reference/5.1/Microsoft.PowerShell.Utility/Get-Unique.md index 3606b158ae91..9a3754a99a7e 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Get-Unique.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Get-Unique.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 03/12/2019 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/get-unique?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-Unique @@ -47,10 +47,10 @@ $A = $( foreach ($line in Get-Content C:\Test1\File1.txt) { $A.count ``` -The first command gets the content of the File.txt file. It converts each line of text to lowercase -letters and then splits each word onto a separate line at the space (" "). Then, it sorts the -resulting list alphabetically (the default) and uses the `Get-Unique` cmdlet to eliminate any -duplicate words. The results are stored in the `$A` variable. +The first command gets the content of the `File.txt` file. It converts each line of text to +lowercase letters and then splits each word onto a separate line at the space (`" "`). Then, it +sorts the resulting list alphabetically (the default) and uses the `Get-Unique` cmdlet to eliminate +any duplicate words. The results are stored in the `$A` variable. The second command uses the **Count** property of the collection of strings in `$A` to determine how many items are in `$A`. @@ -86,7 +86,7 @@ includes files and directories. Get-ChildItem | Sort-Object {$_.GetType()} | Get-Unique -OnType ``` -The pipeline operator (|) sends the results to the `Sort-Object` cmdlet. The `$_.GetType()` +The pipeline operator (`|`) sends the results to the `Sort-Object` cmdlet. The `$_.GetType()` statement applies the **GetType** method to each file or directory. Then, `Sort-Object` sorts the items by type. Another pipeline operator sends the results to `Get-Unique`. The **OnType** parameter directs `Get-Unique` to return only one object of each type. @@ -99,11 +99,11 @@ This command gets the names of processes running on the computer with duplicates Get-Process | Sort-Object | Select-Object processname | Get-Unique -AsString ``` -The `Get-Process` command gets all of the processes on the computer. The pipeline operator (|) +The `Get-Process` command gets all of the processes on the computer. The pipeline operator (`|`) passes the result to `Sort-Object`, which, by default, sorts the processes alphabetically by -ProcessName. The results are piped to the `Select-Object` cmdlet, which selects only the values of -the ProcessName property of each object. The results are then piped to `Get-Unique` to eliminate -duplicates. +**ProcessName**. The results are piped to the `Select-Object` cmdlet, which selects only the values +of the **ProcessName** property of each object. The results are then piped to `Get-Unique` to +eliminate duplicates. The **AsString** parameter tells `Get-Unique` to treat the **ProcessName** values as strings. Without this parameter, `Get-Unique` treats the **ProcessName** values as objects and returns only @@ -187,10 +187,11 @@ The type of object that `Get-Unique` returns is determined by the input. ## NOTES -You can also refer to `Get-Unique` by its built-in alias, `gu`. For more information, see [about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). +You can also refer to `Get-Unique` by its built-in alias, `gu`. For more information, see +[about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). -To sort a list, use Sort-Object. You can also use the **Unique** parameter of `Sort-Object` to find -the unique items in a list. +To sort a list, use `Sort-Object`. You can also use the **Unique** parameter of `Sort-Object` to +find the unique items in a list. ## RELATED LINKS diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Out-GridView.md b/reference/5.1/Microsoft.PowerShell.Utility/Out-GridView.md index b07fdcc2467f..04f4e3eaf161 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Out-GridView.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Out-GridView.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 10/28/2019 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/out-gridview?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Out-GridView @@ -43,10 +43,10 @@ Nano Server. You can use the following features of the table to examine your data: -- Hide, Show, and Reorder Columns +- Hide, show, and reorder columns - Sort rows -- Quick Filter -- Add Criteria Filter +- Quick filter +- Add criteria filter - Copy and paste For full instructions, see the [Notes](#notes) section of this article. @@ -63,14 +63,16 @@ Get-Process | Out-GridView ### Example 2: Use a variable to output processes to a grid view -This example also gets the processes running on the local computer and sends them to a grid view window. +This example also gets the processes running on the local computer and sends them to a grid view +window. ```powershell $P = Get-Process $P | Out-GridView ``` -The output of the `Get-Process` cmdlet is saved in the `$P` variable. Then, `$P` is piped to `Out-GridView`. +The output of the `Get-Process` cmdlet is saved in the `$P` variable. Then, `$P` is piped to +`Out-GridView`. ### Example 3: Display a selected properties in a grid view @@ -139,7 +141,8 @@ parameter. ### Example 8: Create a Windows shortcut to `Out-GridView` -This example shows how to use the **Wait** parameter of `Out-GridView` to create a Windows shortcut to the `Out-GridView` window. +This example shows how to use the **Wait** parameter of `Out-GridView` to create a Windows shortcut +to the `Out-GridView` window. ```powershell pwsh -Command "Get-Service | Out-GridView -Wait" @@ -157,8 +160,8 @@ Specifies object that the cmdlet accepts as input for `Out-GridView`. When you use the **InputObject** parameter to send a collection of objects to `Out-GridView`, `Out-GridView` treats the collection as one collection object, and it displays one row that -represents the collection. To display the each object in the collection, use a pipeline operator (|) -to send objects to `Out-GridView`. +represents the collection. To display the each object in the collection, use a pipeline operator +(`|`) to send objects to `Out-GridView`. ```yaml Type: System.Management.Automation.PSObject @@ -180,10 +183,10 @@ the pipeline, click to select the items and then click OK. The values of this parameter determine how many items you can send down the pipeline. -- None. No items. This is the default value. -- Single. Zero items or one item. Use this value when the next command can take only one input +- `None`. No items. This is the default value. +- `Single`. Zero items or one item. Use this value when the next command can take only one input object. -- Multiple. Zero, one, or many items. Use this value when the next command can take multiple input +- `Multiple`. Zero, one, or many items. Use this value when the next command can take multiple input objects. This value is equivalent to the **Passthru** parameter. This parameter was introduced in Windows PowerShell 3.0. @@ -265,7 +268,8 @@ Accept wildcard characters: False This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, --WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS @@ -350,7 +354,7 @@ include the typed text appear in the table. - Search for text. To search for text in the table, in the Filter box, type the text to find. - Search for multiple words. To search for multiple words in the table, type the words separated by - spaces. `Out-GridView` displays rows that include all the words (logical AND). + spaces. `Out-GridView` displays rows that include all the words (logical **AND**). - Search for literal phrases. To search for phrases that include spaces or special characters, enclose the phrase in quotation marks. `Out-GridView` displays rows that include an exact match for the phrase. diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Set-Date.md b/reference/5.1/Microsoft.PowerShell.Utility/Set-Date.md index ca1d79f98e5f..1853521cda2c 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Set-Date.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Set-Date.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 04/30/2019 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/set-date?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Set-Date @@ -30,6 +30,7 @@ Set-Date [-Adjust] <TimeSpan> [-DisplayHint <DisplayHintType>] [-WhatIf] [-Confi The `Set-Date` cmdlet changes the system date and time on the computer to a date and time that you specify. + You can specify a new date and/or time by typing a string or by passing a **DateTime** or **TimeSpan** object to `Set-Date`. To specify a new date or time, use the **Date** parameter. To specify a change interval, use the **Adjust** parameter. @@ -38,12 +39,11 @@ To specify a change interval, use the **Adjust** parameter. ### Example 1: Add three days to the system date -This command adds three days to the current system date. -It does not affect the time. -The command uses the **Date** parameter to specify the date. +This command adds three days to the current system date. It does not affect the time. The command +uses the **Date** parameter to specify the date. The `Get-Date` cmdlet returns the current date as a **DateTime** object. The **DateTime** object's -**AddDays** method adds a specified number of days (3) to the current **DateTime** object. +**AddDays** method adds a specified number of days (`3`) to the current **DateTime** object. ```powershell Set-Date -Date (Get-Date).AddDays(3) @@ -137,9 +137,9 @@ Accept wildcard characters: False Specifies which elements of the date and time are displayed.The acceptable values for this parameter are: -- **Date** - displays only the date. -- **Time** - displays only the time. -- **DateTime** - displays the date and time. +- `Date` - displays only the date. +- `Time` - displays only the time. +- `DateTime` - displays the date and time. This parameter affects only the display. It does not affect the **DateTime** object that `Get-Date` retrieves. @@ -216,7 +216,6 @@ You can pipe a date to `Set-Date`. - You can use standard .NET methods with the **DateTime** and **TimeSpan** objects used with `Set-Date`, such as **AddDays**, **AddMonths**, and **FromFileTime**. For more information, see [DateTime Methods](/dotnet/api/system.datetime) and - [TimeSpan Methods](/dotnet/api/system.timespan) in the .NET SDK. ## RELATED LINKS diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Unblock-File.md b/reference/5.1/Microsoft.PowerShell.Utility/Unblock-File.md index fb5f1121d0f3..c9730c1e986a 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Unblock-File.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Unblock-File.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 06/09/2017 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/unblock-file?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Unblock-File @@ -10,7 +10,7 @@ title: Unblock-File # Unblock-File ## SYNOPSIS -Unblocks files that were downloaded from the Internet. +Unblocks files that were downloaded from the internet. ## SYNTAX @@ -28,16 +28,16 @@ Unblock-File -LiteralPath <String[]> [-WhatIf] [-Confirm] [<CommonParameters>] ## DESCRIPTION -The `Unblock-File` cmdlet lets you open files that were downloaded from the Internet. It unblocks -PowerShell script files that were downloaded from the Internet so you can run them, even when the +The `Unblock-File` cmdlet lets you open files that were downloaded from the internet. It unblocks +PowerShell script files that were downloaded from the internet so you can run them, even when the PowerShell execution policy is **RemoteSigned**. By default, these files are blocked to protect the computer from untrusted files. Before using the `Unblock-File` cmdlet, review the file and its source and verify that it is safe to open. -Internally, the `Unblock-File` cmdlet removes the Zone.Identifier alternate data stream, which has a -value of "3" to indicate that it was downloaded from the Internet. +Internally, the `Unblock-File` cmdlet removes the **Zone.Identifier** alternate data stream, which +has a value of `3` to indicate that it was downloaded from the internet. For more information about PowerShell execution policies, see [about_Execution_Policies](../Microsoft.PowerShell.Core/about/about_Execution_Policies.md). @@ -48,7 +48,7 @@ This cmdlet was introduced in Windows PowerShell 3.0. ### Example 1: Unblock a file -This command unblocks the PowerShellTips.chm file. +This command unblocks the `PowerShellTips.chm` file. ``` PS C:\> Unblock-File -Path C:\Users\User01\Documents\Downloads\PowerShellTips.chm @@ -68,11 +68,11 @@ PS C:\> dir C:\Downloads\*PowerShell* | Unblock-File This command shows how to find and unblock PowerShell scripts. The first command uses the **Stream** parameter of the *Get-Item* cmdlet get files with the -Zone.Identifier stream. +**Zone.Identifier** stream. The second command shows what happens when you run a blocked script in a PowerShell session in which -the execution policy is **RemoteSigned**. The RemoteSigned policy prevents you from running scripts -that are downloaded from the Internet unless they are digitally signed. +the execution policy is **RemoteSigned**. The **RemoteSigned** policy prevents you from running +scripts that are downloaded from the internet unless they are digitally signed. The third command uses the `Unblock-File` cmdlet to unblock the script so it can run in the session. @@ -104,8 +104,8 @@ PS C:\> Get-Item C:\ps-test\Start-ActivityTracker.ps1 | Unblock-File Specifies the files to unblock. Unlike **Path**, the value of the **LiteralPath** parameter is used exactly as it is typed. No characters are interpreted as wildcards. If the path includes escape -characters, enclose it in single quotation marks. Single quotation marks tell PowerShell not to -interpret any characters as escape sequences. +characters, enclose it in single quotation marks (`'`). Single quotation marks tell PowerShell not +to interpret any characters as escape sequences. ```yaml Type: System.String[] diff --git a/reference/5.1/Microsoft.WSMan.Management/Set-WSManInstance.md b/reference/5.1/Microsoft.WSMan.Management/Set-WSManInstance.md index d1a12b02a466..cf9cdf2c16cd 100644 --- a/reference/5.1/Microsoft.WSMan.Management/Set-WSManInstance.md +++ b/reference/5.1/Microsoft.WSMan.Management/Set-WSManInstance.md @@ -2,7 +2,7 @@ external help file: Microsoft.WSMan.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.WSMan.Management -ms.date: 06/09/2017 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.wsman.management/set-wsmaninstance?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Set-WSManInstance @@ -35,7 +35,7 @@ Set-WSManInstance [-ConnectionURI <Uri>] [-Dialect <Uri>] [-FilePath <String>] [ ## DESCRIPTION -The Set-WSManInstance cmdlet modifies the management information that is related to a resource. +The `Set-WSManInstance` cmdlet modifies the management information that is related to a resource. This cmdlet uses the WinRM connection/transport layer to modify the information. @@ -61,9 +61,10 @@ CertificateThumbprint : ListeningOn : {127.0.0.1, 172.30.168.171, ::1, 2001:4898:0:fff:0:5efe:172.30.168.171...} ``` -This command disables the https listener on the local computer. +This command disables the HTTPS listener on the local computer. -Important: The *ValueSet* parameter is case-sensitive when matching the properties specified. +> [!IMPORTANT] +> The **ValueSet** parameter is case-sensitive when matching the properties specified. For example, in this command, @@ -89,15 +90,16 @@ Service : Service Winrs : Winrs ``` -This command sets the MaxEnvelopeSizekb value to 200 on the local computer. +This command sets the **MaxEnvelopeSizekb** value to 200 on the local computer. -Important: The ValueSet parameter is case-sensitive when matching the properties specified. +> [!IMPORTANT] +> The **ValueSet** parameter is case-sensitive when matching the properties specified. For example, using the above command. -This fails: -ValueSet @{MaxEnvelopeSizeKB ="200"} +This fails: `-ValueSet @{MaxEnvelopeSizeKB ="200"}` -This succeeds: -ValueSet @{MaxEnvelopeSizekb ="200"} +This succeeds: `-ValueSet @{MaxEnvelopeSizekb ="200"}` ### Example 3: Disable a listener on a remote computer @@ -119,34 +121,35 @@ CertificateThumbprint : ListeningOn : {127.0.0.1, 172.30.168.172, ::1, 2001:4898:0:fff:0:5efe:172.30.168.172...} ``` -This command disables the https listener on the remote computer SERVER02. +This command disables the HTTPS listener on the remote computer SERVER02. -Important: The ValueSet parameter is case-sensitive when matching the properties specified. +> [!IMPORTANT] +> The **ValueSet** parameter is case-sensitive when matching the properties specified. For example, using the above command. -This fails: -ValueSet @{enabled="False"} +This fails: `-ValueSet @{enabled="False"}` -This succeeds: -ValueSet @{Enabled="False"} +This succeeds: `-ValueSet @{Enabled="False"}` ## PARAMETERS ### -ApplicationName -Specifies the application name in the connection. -The default value of the ApplicationName parameter is "WSMAN". -The complete identifier for the remote endpoint is in the following format: +Specifies the application name in the connection. The default value of the **ApplicationName** +parameter is "WSMAN". The complete identifier for the remote endpoint is in the following format: -\<transport\>://\<server\>:\<port\>/\<ApplicationName\> +`<transport>://<server>:<port>/<ApplicationName>` For example: `http://server01:8080/WSMAN` -Internet Information Services (IIS), which hosts the session, forwards requests with this endpoint to the specified application. -This default setting of "WSMAN" is appropriate for most uses. -This parameter is designed to be used when numerous computers establish remote connections to one computer that is running Windows PowerShell. -In this case, IIS hosts Web Services for Management (WS-Management ) for efficiency. +Internet Information Services (IIS), which hosts the session, forwards requests with this endpoint +to the specified application. This default setting of `WSMAN` is appropriate for most uses. This +parameter is designed to be used when numerous computers establish remote connections to one +computer that is running Windows PowerShell. In this case, IIS hosts Web Services for Management +(WS-Management) for efficiency. ```yaml Type: System.String @@ -165,16 +168,26 @@ Accept wildcard characters: False Specifies the authentication mechanism to be used at the server. Possible values are: -- Basic: Basic is a scheme in which the user name and password are sent in clear text to the server or proxy. -- Default : Use the authentication method implemented by the WS-Management protocol. This is the default. -- Digest: Digest is a challenge-response scheme that uses a server-specified data string for the challenge. -- Kerberos: The client computer and the server mutually authenticate by using Kerberos certificates. -- Negotiate: Negotiate is a challenge-response scheme that negotiates with the server or proxy to determine the scheme to use for authentication. For example, this parameter value allows negotiation to determine whether the Kerberos protocol or NTLM is used. -- CredSSP: Use Credential Security Support Provider (CredSSP) authentication, which allows the user to delegate credentials. This option is designed for commands that run on one remote computer but collect data from or run additional commands on other remote computers. - -Caution: CredSSP delegates the user's credentials from the local computer to a remote computer. -This practice increases the security risk of the remote operation. -If the remote computer is compromised, when credentials are passed to it, the credentials can be used to control the network session. +- `Basic`: Basic is a scheme in which the user name and password are sent in clear text to the + server or proxy. +- `Default` : Use the authentication method implemented by the WS-Management protocol. This is the + default. +- `Digest`: Digest is a challenge-response scheme that uses a server-specified data string for the + challenge. +- `Kerberos`: The client computer and the server mutually authenticate by using Kerberos + certificates. +- `Negotiate`: Negotiate is a challenge-response scheme that negotiates with the server or proxy to + determine the scheme to use for authentication. For example, this parameter value allows + negotiation to determine whether the Kerberos protocol or NTLM is used. +- `CredSSP`: Use Credential Security Support Provider (CredSSP) authentication, which allows the + user to delegate credentials. This option is designed for commands that run on one remote computer + but collect data from or run additional commands on other remote computers. + +> [!CAUTION] +> CredSSP delegates the user's credentials from the local computer to a remote computer. This +> practice increases the security risk of the remote operation. If the remote computer is +> compromised, when credentials are passed to it, the credentials can be used to control the network +> session. ```yaml Type: Microsoft.WSMan.Management.AuthenticationMechanism @@ -191,13 +204,14 @@ Accept wildcard characters: False ### -CertificateThumbprint -Specifies the digital public key certificate (X509) of a user account that has permission to perform this action. -Enter the certificate thumbprint of the certificate. +Specifies the digital public key certificate (X509) of a user account that has permission to perform +this action. Enter the certificate thumbprint of the certificate. -Certificates are used in client certificate-based authentication. -They can be mapped only to local user accounts; they do not work with domain accounts. +Certificates are used in client certificate-based authentication. They can be mapped only to local +user accounts; they do not work with domain accounts. -To get a certificate thumbprint, use the Get-Item or Get-ChildItem command in the PowerShell Cert: drive. +To get a certificate thumbprint, use the `Get-Item` or `Get-ChildItem` command in the PowerShell +`Cert:` drive. ```yaml Type: System.String @@ -213,12 +227,12 @@ Accept wildcard characters: False ### -ComputerName -Specifies the computer against which you want to run the management operation. -The value can be a fully qualified domain name, a NetBIOS name, or an IP address. -Use the local computer name, use localhost, or use a dot (.) to specify the local computer. -The local computer is the default. -When the remote computer is in a different domain from the user, you must use a fully qualified domain name must be used. -You can pipe a value for this parameter to the cmdlet. +Specifies the computer against which you want to run the management operation. The value can be a +fully qualified domain name, a NetBIOS name, or an IP address. Use the local computer name, +`localhost`, or a dot (`.`) to specify the local computer. The local computer is the default. + +When the remote computer is in a different domain from the user, you must use a fully qualified +domain name. You can pipe a value for this parameter to the cmdlet. ```yaml Type: System.String @@ -234,16 +248,15 @@ Accept wildcard characters: False ### -ConnectionURI -Specifies the connection endpoint. -The format of this string is: +Specifies the connection endpoint. The format of this string is: -\<Transport\>://\<Server\>:\<Port\>/\<ApplicationName\> +`<Transport>://<Server>:<Port>/<ApplicationName>` The following string is a properly formatted value for this parameter: `http://Server01:8080/WSMAN` -The URI must be fully qualified . +The URI must be fully qualified. ```yaml Type: System.Uri @@ -259,11 +272,10 @@ Accept wildcard characters: False ### -Credential -Specifies a user account that has permission to perform this action. -The default is the current user. -Type a user name, such as "User01", "Domain01\User01", or "User@Domain.com". -Or, enter a PSCredential object, such as one returned by the Get-Credential cmdlet. -When you type a user name, you will be prompted for a password. +Specifies a user account that has permission to perform this action. The default is the current +user. Type a user name, such as `User01`, `Domain01\User01`, or `User@Domain.com`. Alternatively, +enter a **PSCredential** object, such as one returned by the `Get-Credential` cmdlet. When you type +a user name, you will be prompted for a password. ```yaml Type: System.Management.Automation.PSCredential @@ -279,13 +291,12 @@ Accept wildcard characters: False ### -Dialect -Specifies the dialect to use in the filter predicate. -This can be any dialect that is supported by the remote service. -The following aliases can be used for the dialect URI: +Specifies the dialect to use in the filter predicate. This can be any dialect that is supported by +the remote service. The following aliases can be used for the dialect URI: -- WQL: `http://schemas.microsoft.com/wbem/wsman/1/WQL` -- Selector: `http://schemas.microsoft.com/wbem/wsman/1/wsman/SelectorFilter` -- Association: `http://schemas.dmtf.org/wbem/wsman/1/cimbinding/associationFilter` +- `WQL`: `http://schemas.microsoft.com/wbem/wsman/1/WQL` +- `Selector`: `http://schemas.microsoft.com/wbem/wsman/1/wsman/SelectorFilter` +- `Association`: `http://schemas.dmtf.org/wbem/wsman/1/cimbinding/associationFilter` ```yaml Type: System.Uri @@ -301,14 +312,14 @@ Accept wildcard characters: False ### -FilePath -Specifies the path of a file that is used to update a management resource. -You specify the management resource by using the ResourceURI parameter and the SelectorSet parameter . -For example, the following command uses the FilePath parameter: +Specifies the path of a file that is used to update a management resource. You specify the +management resource by using the **ResourceURI** parameter and the **SelectorSet** parameter. For +example, the following command uses the **FilePath** parameter: -`Invoke-WSManAction -action StopService -resourceuri wmicimv2/Win32_Service -SelectorSet @{Name="spooler"} -FilePath:c:\input.xml -authentication default` +`Invoke-WSManAction -Action StopService -ResourceUri wmicimv2/Win32_Service -SelectorSet @{Name="spooler"} -FilePath:c:\input.xml -authentication default` -This command calls the StopService method on the Spooler service by using input from a file. -The file, Input.xml, contains the following content: +This command calls the **StopService** method on the Spooler service by using input from a file. +The file, `Input.xml`, contains the following content: `<p:StopService_INPUT xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Service" />` @@ -326,8 +337,8 @@ Accept wildcard characters: False ### -Fragment -Specifies a section inside the instance that is to be updated or retrieved for the specified operation. -For example, to get the status of a spooler service, specify "-Fragment Status". +Specifies a section inside the instance that is to be updated or retrieved for the specified +operation. For example, to get the status of a spooler service, specify `-Fragment Status`. ```yaml Type: System.String @@ -347,9 +358,10 @@ Passes a set of switches to a service to modify or refine the nature of the requ These are similar to switches used in command-line shells because they are service specific. Any number of options can be specified. -The following example demonstrates the syntax that passes the values 1, 2, and 3 for the a, b, and c parameters: +The following example demonstrates the syntax that passes the values `1`, `2`, and `3` for the `a`, +`b`, and `c` parameters: --OptionSet @{a=1;b=2;c=3} +`-OptionSet @{a=1;b=2;c=3}` ```yaml Type: System.Collections.Hashtable @@ -365,12 +377,14 @@ Accept wildcard characters: False ### -Port -Specifies the port to use when the client connects to the WinRM service. -When the transport is HTTP, the default port is 80. -When the transport is HTTPS, the default port is 443. -When you use HTTPS as the transport, the value of the ComputerName parameter must match the server's certificate common name (CN). -However, if the SkipCNCheck parameter is specified as part of the SessionOption parameter, then the certificate common name of the server does not have to match the host name of the server. -The SkipCNCheck parameter should be used only for trusted machines. +Specifies the port to use when the client connects to the WinRM service. When the transport is HTTP, +the default port is 80. When the transport is HTTPS, the default port is 443. + +When you use HTTPS as the transport, the value of the **ComputerName** parameter must match the +server's certificate common name (CN). However, if the **SkipCNCheck** parameter is specified as +part of the **SessionOption** parameter, then the certificate common name of the server does not +have to match the host name of the server. The **SkipCNCheck** parameter should be used only for +trusted machines. ```yaml Type: System.Int32 @@ -411,11 +425,11 @@ Accept wildcard characters: False ### -SelectorSet Specifies a set of value pairs that are used to select particular management resource instances. -The SelectorSet parameter is used when more than one instance of the resource exists. -The value of the SelectorSet parameter must be a hash table. +The **SelectorSet** parameter is used when more than one instance of the resource exists. +The value of the **SelectorSet** parameter must be a hash table. The following example shows how to enter a value for this parameter: --SelectorSet @{Name="WinRM";ID="yyy"} +`-SelectorSet @{Name="WinRM";ID="yyy"}` ```yaml Type: System.Collections.Hashtable @@ -431,9 +445,9 @@ Accept wildcard characters: False ### -SessionOption -Defines a set of extended options for the WS-Management session. -Enter a SessionOption object that you create by using the New-WSManSessionOption cmdlet. -For more information about the options that are available, see New-WSManSessionOption. +Defines a set of extended options for the WS-Management session. Enter a **SessionOption** object +that you create with the `New-WSManSessionOption` cmdlet. For more information about the options +that are available, see [New-WSManSessionOption](New-WSManSessionOption.md). ```yaml Type: Microsoft.WSMan.Management.SessionOption @@ -449,12 +463,13 @@ Accept wildcard characters: False ### -UseSSL -Specifies that the Secure Sockets Layer (SSL) protocol should be used to establish a connection to the remote computer. -By default, SSL is not used. +Specifies that the Secure Sockets Layer (SSL) protocol should be used to establish a connection to +the remote computer. By default, SSL is not used. -WS-Management encrypts all the Windows PowerShell content that is transmitted over the network. -The UseSSL parameter lets you specify the additional protection of HTTPS instead of HTTP. -If SSL is not available on the port that is used for the connection and you specify this parameter, the command fails. +WS-Management encrypts all the Windows PowerShell content that is transmitted over the network. The +**UseSSL** parameter lets you specify the additional protection of HTTPS instead of HTTP. If SSL is +not available on the port that is used for the connection and you specify this parameter, the +command fails. ```yaml Type: System.Management.Automation.SwitchParameter @@ -470,9 +485,9 @@ Accept wildcard characters: False ### -ValueSet -Specifies a hash table that helps modify a management resource. -You specify the management resource by using the ResourceURI parameter and the SelectorSet parameter. -The value of the ValueSet parameter must be a hash table. +Specifies a hash table that helps modify a management resource. You specify the management resource +by using the **ResourceURI** parameter and the **SelectorSet** parameter. The value of the +**ValueSet** parameter must be a hash table. ```yaml Type: System.Collections.Hashtable @@ -488,7 +503,10 @@ Accept wildcard characters: False ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). ## INPUTS diff --git a/reference/5.1/PSScheduledJob/Get-JobTrigger.md b/reference/5.1/PSScheduledJob/Get-JobTrigger.md index 7728a3902bc0..866358b497dc 100644 --- a/reference/5.1/PSScheduledJob/Get-JobTrigger.md +++ b/reference/5.1/PSScheduledJob/Get-JobTrigger.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.ScheduledJob.dll-Help.xml Locale: en-US Module Name: PSScheduledJob -ms.date: 10/05/2021 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/psscheduledjob/get-jobtrigger?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-JobTrigger @@ -51,7 +51,8 @@ the scheduled jobs by their names or identification numbers, or by entering or p is included in Windows PowerShell. For more information about Scheduled Jobs, see the About topics in the PSScheduledJob module. Import -the PSScheduledJob module and then type: `Get-Help about_Scheduled*` or see [about_Scheduled_Jobs](About/about_Scheduled_Jobs.md). +the PSScheduledJob module and then type: `Get-Help about_Scheduled*` or see +[about_Scheduled_Jobs](About/about_Scheduled_Jobs.md). This cmdlet was introduced in Windows PowerShell 3.0. @@ -63,7 +64,8 @@ This cmdlet was introduced in Windows PowerShell 3.0. Get-JobTrigger -Name "BackupJob" ``` -The command uses the *Name* parameter of `Get-JobTrigger` to get the job triggers of the BackupJob scheduled job. +The command uses the *Name* parameter of `Get-JobTrigger` to get the job triggers of the `BackupJob` +scheduled job. ### Example 2: Get a job trigger by ID @@ -92,7 +94,7 @@ The first command uses the `Get-ScheduledJob` cmdlet to display the scheduled jo computer. The display includes the IDs of the scheduled jobs. The second command uses the `Get-JobTrigger` cmdlet to get the job trigger for the `Test-HelpFiles` -job (ID = 3) +job (whose **ID** is `3`). ### Example 3: Get job triggers by piping a job @@ -102,7 +104,7 @@ This example gets job triggers of jobs that have matching names. Get-ScheduledJob -Name *Backup*, *Archive* | Get-JobTrigger ``` -This command gets the job triggers of all jobs that have Backup or Archive in their names. +This command gets the job triggers of all jobs that have `Backup` or `Archive` in their names. ### Example 4: Get the job trigger of a job on a remote computer @@ -113,7 +115,7 @@ Invoke-Command -ComputerName Server01 { Get-ScheduledJob Backup | Get-JobTrigger ``` The command uses the `Invoke-Command` cmdlet to run a command on the Server01 computer. It uses the -`Get-ScheduledJob` cmdlet to get the Backup scheduled job, which it pipes to the `Get-JobTrigger` +`Get-ScheduledJob` cmdlet to get the `Backup` scheduled job, which it pipes to the `Get-JobTrigger` cmdlet. It uses the **TriggerID** parameter to get only the second trigger. ### Example 5: Get all job triggers @@ -150,14 +152,15 @@ Get-ScheduledJob | foreach {$_.JobTriggers} ``` The first command uses the `Get-ScheduledJob` cmdlet to get the `Test-HelpFiles` scheduled job. Then -it uses the dot method (`.`) to get the JobTriggers property of the `Test-HelpFiles` scheduled job. +it uses the dot method (`.`) to get the **JobTriggers** property of the `Test-HelpFiles` scheduled +job. The second command uses the `Get-ScheduledJob` cmdlet to get all scheduled jobs on the local -computer. It uses the `ForEach-Object` cmdlet to get the value of the JobTrigger property of each -scheduled job. +computer. It uses the `ForEach-Object` cmdlet to get the value of the **JobTriggers** property of +each scheduled job. -The job triggers of a scheduled job are stored in the JobTriggers property of the job. This example -shows alternatives to using the `Get-JobTrigger` cmdlet to get job triggers. The results are +The job triggers of a scheduled job are stored in the **JobTriggers** property of the job. This +example shows alternatives to using the `Get-JobTrigger` cmdlet to get job triggers. The results are identical to using the `Get-JobTrigger` cmdlet and the techniques can be used interchangeably. ### Example 7: Compare job triggers @@ -193,7 +196,7 @@ RandomDelay SideIndicator 00:03:00 <= ``` -The first command gets the job trigger of the ArchiveProjects scheduled job. The command pipes the +The first command gets the job trigger of the `ArchiveProjects` scheduled job. The command pipes the job trigger to the `Tee-Object` cmdlet, which saves the job trigger in the `$t1` variable and displays it at the command line. @@ -206,7 +209,7 @@ cmdlet to get the properties of the job trigger in the $t1 variable. It pipes th `ForEach-Object` cmdlet, which compares each property to the properties of the job trigger in the `$t2` variable by name. The command then pipes the differing properties to the `Format-List` cmdlet, which displays them in a list.The output indicates that, although the job triggers appear to be the -same, the HelpFiles job trigger includes a random delay of three (3) minutes. +same, the `HelpFiles` job trigger includes a random delay of three (`3`) minutes. This example shows how to compare the job triggers of two scheduled jobs. @@ -292,7 +295,8 @@ Accept wildcard characters: False This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, --WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/5.1/PSScheduledJob/New-JobTrigger.md b/reference/5.1/PSScheduledJob/New-JobTrigger.md index cb434a455a2f..bb661512767d 100644 --- a/reference/5.1/PSScheduledJob/New-JobTrigger.md +++ b/reference/5.1/PSScheduledJob/New-JobTrigger.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.ScheduledJob.dll-Help.xml Locale: en-US Module Name: PSScheduledJob -ms.date: 10/05/2021 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/psscheduledjob/new-jobtrigger?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: New-JobTrigger @@ -54,9 +54,9 @@ The `New-JobTrigger` cmdlet creates a job trigger that starts a scheduled job on recurring schedule, or when an event occurs. You can use the **ScheduledJobTrigger** object that `New-JobTrigger` returns to set a job trigger -for a new or existing scheduled job. You can also create a job trigger by using the `Get-JobTrigger` -cmdlet to get the job trigger of an existing scheduled job, or by using a hash table value to -represent a job trigger. +for a new or existing scheduled job. You can also create a job trigger with the `Get-JobTrigger` +cmdlet to get the job trigger of an existing scheduled job, or with a hash table value to represent +a job trigger. When creating a job trigger, review the default values of the options specified by the `New-ScheduledJobOption` cmdlet. These options, which have the same valid and default values as the @@ -207,7 +207,7 @@ until its job trigger expires. To prevent the job from repeating, the command uses the `Get-JobTrigger` to get the job trigger of the **SecurityCheck** job and the `Set-JobTrigger` cmdlet to change the repetition interval and -repetition duration of the job trigger to zero (0). +repetition duration of the job trigger to zero (`0`). ### Example 10: Create an hourly job trigger @@ -225,9 +225,9 @@ indefinite period of time. The schedule begins tomorrow (9/21/2012) at midnight ### -At Starts the job at the specified date and time. Enter a **DateTime** object, such as one that the -`Get-Date` cmdlet returns, or a string that can be converted to a date and time, such as "April 19, -2012 15:00", "12/31", or "3am". If you don't specify an element of the date, such as the year, the -date in the trigger has the corresponding element from the current date. +`Get-Date` cmdlet returns, or a string that can be converted to a date and time, such as +`April 19, 2012 15:00`, `12/31`, or `3am`. If you don't specify an element of the date, such as the +year, the date in the trigger has the corresponding element from the current date. When using the **Once** parameter, set the value of the **At** parameter to a future date and time. Because the default date in a **DateTime** object is the current date, if you specify a time before @@ -301,8 +301,8 @@ Accept wildcard characters: False ### -DaysInterval -Specifies the number of days between occurrences on a daily schedule. For example, a value of 3 -starts the scheduled job on days 1, 4, 7 and so on. The default value is 1. +Specifies the number of days between occurrences on a daily schedule. For example, a value of `3` +starts the scheduled job on days `1`, `4`, `7` and so on. The default value is `1`. ```yaml Type: System.Int32 @@ -319,14 +319,14 @@ Accept wildcard characters: False ### -DaysOfWeek Specifies the days of the week on which a weekly scheduled job runs. Enter day names, such as -"Monday" or integers 0-6, where 0 represents Sunday. This parameter is required in the Weekly -parameter set. +`Monday` or integers `0`-`6`, where `0` represents Sunday. This parameter is required in the +**Weekly** parameter set. Day names are converted to their integer values in the job trigger. When you enclose day names in -quotation marks in a command, enclose each day name in separate quotation marks, such as "Monday", -"Tuesday". If you enclose multiple day names in a single quotation mark pair, the corresponding -integer values are summed. For example, "Monday, Tuesday" (1, 2) results in a value of "Wednesday" -(3). +quotation marks in a command, enclose each day name in separate quotation marks, such as +`"Monday", "Tuesday"`. If you enclose multiple day names in a single quotation mark pair, the +corresponding integer values are summed. For example, `"Monday, Tuesday"` (`1 + 2`) results in a +value of `Wednesday` (`3`). ```yaml Type: System.DayOfWeek[] @@ -362,7 +362,7 @@ Accept wildcard characters: False Enables a random delay that begins at the scheduled start time, and sets the maximum delay value. The length of the delay is set pseudo-randomly for each start and varies from no delay to the time -specified by the value of this parameter. The default value, zero (00:00:00), disables the random +specified by the value of this parameter. The default value, zero (`00:00:00`), disables the random delay. Enter a timespan object, such as one returned by the `New-TimeSpan` cmdlet, or enter a value in @@ -406,12 +406,12 @@ is 5 minutes and the value of **RepetitionDuration** is 2 hours, the job is trig minutes for two hours. Enter a timespan object, such as one that the `New-TimeSpan` cmdlet returns or a string that can be -converted to a timespan object, such as "1:05:30". +converted to a timespan object, such as `1:05:30`. To run a job indefinitely, add the **RepeatIndefinitely** parameter instead. To stop a job before the job trigger repetition duration expires, use the `Set-JobTrigger` cmdlet to -set the **RepetitionDuration** value to zero (0). +set the **RepetitionDuration** value to zero (`0`). This parameter is valid only when the **Once**, **At**, and **RepetitionInterval** parameters are used in the command. @@ -431,10 +431,10 @@ Accept wildcard characters: False ### -RepetitionInterval Repeats the job at the specified time interval. For example, if the value of this parameter is 2 -hours, the job is triggered every two hours. The default value, 0, does not repeat the job. +hours, the job is triggered every two hours. The default value, `0`, does not repeat the job. Enter a timespan object, such as one that the `New-TimeSpan` cmdlet returns or a string that can be -converted to a timespan object, such as "1:05:30". +converted to a timespan object, such as `1:05:30`. This parameter is valid only when the **Once**, **At**, and **RepetitionDuration** parameters are used in the command. @@ -471,8 +471,8 @@ Accept wildcard characters: False ### -Weekly -Specifies a recurring weekly job schedule. Use the other parameters in the Weekly parameter set to -specify the schedule details. +Specifies a recurring weekly job schedule. Use the other parameters in the **Weekly** parameter set +to specify the schedule details. ```yaml Type: System.Management.Automation.SwitchParameter @@ -489,7 +489,7 @@ Accept wildcard characters: False ### -WeeksInterval Specifies the number of weeks between occurrences on a weekly job schedule. For example, a value of -3 starts the scheduled job on weeks 1, 4, 7 and so on. The default value is 1. +`3` starts the scheduled job on weeks `1`, `4`, `7` and so on. The default value is `1`. ```yaml Type: System.Int32 diff --git a/reference/5.1/PSScheduledJob/Set-JobTrigger.md b/reference/5.1/PSScheduledJob/Set-JobTrigger.md index 9b6d0ff0d8e2..3f8b38f40e85 100644 --- a/reference/5.1/PSScheduledJob/Set-JobTrigger.md +++ b/reference/5.1/PSScheduledJob/Set-JobTrigger.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.ScheduledJob.dll-Help.xml Locale: en-US Module Name: PSScheduledJob -ms.date: 10/05/2021 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/psscheduledjob/set-jobtrigger?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Set-JobTrigger @@ -47,7 +47,8 @@ are retained. is included in Windows PowerShell. For more information about Scheduled Jobs, see the About topics in the PSScheduledJob module. Import -the PSScheduledJob module and then type: `Get-Help about_Scheduled*` or see [about_Scheduled_Jobs](About/about_Scheduled_Jobs.md). +the PSScheduledJob module and then type: `Get-Help about_Scheduled*` or see +[about_Scheduled_Jobs](About/about_Scheduled_Jobs.md). This cmdlet was introduced in Windows PowerShell 3.0. @@ -77,13 +78,13 @@ Id Frequency Time DaysOfWeek Enable 1 Weekly 9/29/2011 12:00:00 AM {Wednesday, Sunday} True ``` -The first command uses the `Get-JobTrigger` cmdlet to get the job trigger of the DeployPackage +The first command uses the `Get-JobTrigger` cmdlet to get the job trigger of the `DeployPackage` scheduled job. The output shows that the trigger starts the job at midnight on Wednesdays and Saturdays. -The second command uses the `Get-JobTrigger` cmdlet to get the job trigger of the DeployPackage +The second command uses the `Get-JobTrigger` cmdlet to get the job trigger of the `DeployPackage` scheduled job. A pipeline operator (`|`) sends the trigger to the `Set-JobTrigger` cmdlet, which -changes the job trigger so that it starts the DeployPackage job on Wednesdays and Sundays. The +changes the job trigger so that it starts the `DeployPackage` job on Wednesdays and Sundays. The command uses the **Passthru** parameter to return the trigger after the change. This command is not required; it is included only to show the effect of the trigger change. @@ -91,7 +92,7 @@ This command is not required; it is included only to show the effect of the trig ### Example 2: Change the job trigger type This example shows how to change the type of job trigger that starts a job. The commands in this -example replace an AtStartup job trigger with a weekly trigger. +example replace an `AtStartup` job trigger with a weekly trigger. ```powershell Get-JobTrigger -Name "Inventory" @@ -115,14 +116,15 @@ Id Frequency Time DaysOfWeek Enable 2 Weekly 10/31/2011 12:00:00 AM {Monday} True ``` -The first command uses the `Get-JobTrigger` cmdlet to get the job trigger of the Inventory scheduled -job. The output shows that the job has two triggers a daily trigger and an **AtStartup** trigger. +The first command uses the `Get-JobTrigger` cmdlet to get the job trigger of the `Inventory` +scheduled job. The output shows that the job has two triggers a daily trigger and an **AtStartup** +trigger. The second command uses the `Get-JobTrigger` cmdlet to get the **AtStartup** job trigger of the -Inventory job. The command uses the **TriggerID** parameter to identify the job trigger. A pipeline -operator (`|`) sends the job trigger to the `Set-JobTrigger` cmdlet, which changes it to a weekly -job trigger that runs every four weeks on Monday at midnight. The command uses the **Passthru** -parameter to return the trigger after the change. +`Inventory` job. The command uses the **TriggerID** parameter to identify the job trigger. A +pipeline operator (`|`) sends the job trigger to the `Set-JobTrigger` cmdlet, which changes it to a +weekly job trigger that runs every four weeks on Monday at midnight. The command uses the +**Passthru** parameter to return the trigger after the change. This command is not required; it is included only to show the effect of the trigger change. @@ -139,12 +141,12 @@ The command uses the `Invoke-Command` cmdlet to run a command on the Server01 co The remote command begins with a `Get-ScheduledJob` command that gets all scheduled jobs on the computer. The scheduled jobs are piped to the `Get-JobTrigger` cmdlet, which gets the job triggers -of the scheduled jobs. Each job trigger contains a JobDefinition property that contains the +of the scheduled jobs. Each job trigger contains a **JobDefinition** property that contains the scheduled job, so the trigger remains associated with the scheduled job even when it is changed. -The job triggers are piped to the `Where-Object` cmdlet, which gets job triggers that have the User -property. The selected job triggers are piped to the `Set-JobTrigger` cmdlet, which changes the user -to Domain01\Admin02. +The job triggers are piped to the `Where-Object` cmdlet, which gets job triggers that have the +**User** property. The selected job triggers are piped to the `Set-JobTrigger` cmdlet, which changes +the user to `Domain01\Admin02`. ### Example 4: Change one of many job triggers @@ -198,32 +200,34 @@ JobDefinition : Microsoft.PowerShell.ScheduledJob.ScheduledJobDefinition ``` The commands in this example changes the repetition interval of the **Once** job trigger of -SecurityCheck scheduled job from every 60 minutes to every 90 minutes. The SecurityCheck scheduled -job has three job triggers, so the commands use the **TriggerId** parameter of the `Get-JobTrigger` -cmdlet to identify the job trigger that is being changed. +`SecurityCheck` scheduled job from every 60 minutes to every 90 minutes. The `SecurityCheck` +scheduled job has three job triggers, so the commands use the **TriggerId** parameter of the +`Get-JobTrigger` cmdlet to identify the job trigger that is being changed. -The first command uses the `Get-JobTrigger` cmdlet to get all job triggers of the SecurityCheck +The first command uses the `Get-JobTrigger` cmdlet to get all job triggers of the `SecurityCheck` scheduled job. The output, which displays the IDs of the job triggers, reveals that the **Once** job -trigger has an ID of 3. +trigger has an **ID** of `3`. The second command uses the **TriggerID** parameter of the `Get-JobTrigger` cmdlet to get the -**Once** trigger of the SecurityCheck scheduled job. The command pipes the trigger to the -`Format-List` cmdlet, which displays all of the properties of the **Once** job trigger.The output -shows that the trigger starts the job once every hour (RepetitionInterval = 1 hour) for one day -(RepetitionDuration = 1 day). +**Once** trigger of the `SecurityCheck` scheduled job. The command pipes the trigger to the +`Format-List` cmdlet, which displays all of the properties of the **Once** job trigger. The output +shows that the trigger starts the job once every hour (**RepetitionInterval** is 1 hour) for one day +(**RepetitionDuration** is 1 day). The third command changes the repetition interval of the job trigger from one hour to 90 minutes. The command does not return any output. The fourth command displays the effect of the change.The output shows that the trigger starts the -job once every 90 minutes (RepetitionInterval = 1 hour, 30 minutes) for one day (RepetitionDuration -= 1 day). ## PARAMETERS +job once every 90 minutes (**RepetitionInterval** is 1 hour, 30 minutes) for one day +(**RepetitionDuration** is 1 day). + +## PARAMETERS ### -At Starts the job at the specified date and time. Enter a **DateTime** object, such as one that the -`Get-Date` cmdlet returns, or a string that can be converted to a time, such as "April 19, 2012 -15:00", "12/31/2013 9:00 PM", or "3am". +`Get-Date` cmdlet returns, or a string that can be converted to a time, such as +`April 19, 2012 15:00`, `12/31/2013 9:00 PM`, or `3am`. If you don't specify an element of the **DateTime** object, such as seconds, that element of the job trigger is not changed. If the original job trigger didn't include a **DateTime** object and you @@ -302,8 +306,8 @@ Accept wildcard characters: False ### -DaysInterval -Specifies the number of days between occurrences on a daily schedule. For example, a value of 3 -starts the scheduled job on days 1, 4, 7 and so on. The default value is 1. +Specifies the number of days between occurrences on a daily schedule. For example, a value of `3` +starts the scheduled job on days `1`, `4`, `7` and so on. The default value is `1`. ```yaml Type: System.Int32 @@ -320,14 +324,14 @@ Accept wildcard characters: False ### -DaysOfWeek Specifies the days of the week on which a weekly scheduled job runs. Enter day names, such as -Monday, Thursday, integers 0-6, where 0 represents Sunday, or an asterisk (`*`) to represent every -day. This parameter is required in the Weekly parameter set. +`Monday`, `Thursday`, integers `0`-`6`, where `0` represents Sunday, or an asterisk (`*`) to +represent every day. This parameter is required in the **Weekly** parameter set. Day names are converted to their integer values in the job trigger. When you enclose day names in -quotation marks in a command, enclose each day name in separate quotation marks, such as "Monday", -"Tuesday". If you enclose multiple day names in a single quotation mark pair, the corresponding -integer values are summed. For example, "Monday, Tuesday" (1, 2) results in a value of "Wednesday" -(3). +quotation marks in a command, enclose each day name in separate quotation marks, such as +`"Monday", "Tuesday"`. If you enclose multiple day names in a single quotation mark pair, the +corresponding integer values are summed. For example, `"Monday, Tuesday"` (`1 + 2`) results in a +value of `Wednesday` (`3`). ```yaml Type: System.DayOfWeek[] @@ -398,7 +402,7 @@ Accept wildcard characters: False Enables a random delay that begins at the scheduled start time, and sets the maximum delay value. The length of the delay is set pseudo-randomly for each start and varies from no delay to the time -specified by the value of this parameter. The default value, zero (00:00:00), disables the random +specified by the value of this parameter. The default value, zero (`00:00:00`), disables the random delay. Enter a timespan object, such as one returned by the `New-TimeSpan` cmdlet, or enter a value in @@ -442,12 +446,12 @@ is 5 minutes and the value of **RepetitionDuration** is 2 hours, the job is trig minutes for two hours. Enter a timespan object, such as one that the `New-TimeSpan` cmdlet returns or a string that can be -converted to a timespan object, such as "1:05:30". +converted to a timespan object, such as `1:05:30`. To run a job indefinitely, add the **RepeatIndefinitely** parameter instead. To stop a job before the job trigger repetition duration expires, set the **RepetitionDuration** -value to zero (0). +value to zero (`0`). To change the repetition duration or repetition interval of a **Once** job trigger, the command must include both the **RepetitionInterval** and **RepetitionDuration** parameters. To change the @@ -469,10 +473,10 @@ Accept wildcard characters: False ### -RepetitionInterval Repeats the job at the specified time interval. For example, if the value of this parameter is 2 -hours, the job is triggered every two hours. The default value, 0, does not repeat the job. +hours, the job is triggered every two hours. The default value, `0`, does not repeat the job. Enter a timespan object, such as one that the `New-TimeSpan` cmdlet returns or a string that can be -converted to a timespan object, such as "1:05:30". +converted to a timespan object, such as `1:05:30`. To change the repetition duration or repetition interval of a **Once** job trigger, the command must include both the **RepetitionInterval** and **RepetitionDuration** parameters. To change the @@ -529,7 +533,7 @@ Accept wildcard characters: False ### -WeeksInterval Specifies the number of weeks between occurrences on a weekly job schedule. For example, a value of -3 starts the scheduled job on weeks 1, 4, 7 and so on. The default value is 1. +`3` starts the scheduled job on weeks `1`, `4`, `7` and so on. The default value is `1`. ```yaml Type: System.Int32 @@ -547,7 +551,8 @@ Accept wildcard characters: False This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, --WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS @@ -564,7 +569,7 @@ changed. Otherwise, this cmdlet does not generate any output. ## NOTES -- Job triggers have a **JobDefintion** property that associates them with the scheduled job. When +- Job triggers have a **JobDefinition** property that associates them with the scheduled job. When you change the job trigger of a scheduled job, the job is changed. You do not need to use a `Set-ScheduledJob` command to apply the changed trigger to the scheduled job. diff --git a/reference/5.1/PSWorkflow/About/about_ActivityCommonParameters.md b/reference/5.1/PSWorkflow/About/about_ActivityCommonParameters.md index ebe40f5bfac7..91e04ec1e245 100644 --- a/reference/5.1/PSWorkflow/About/about_ActivityCommonParameters.md +++ b/reference/5.1/PSWorkflow/About/about_ActivityCommonParameters.md @@ -1,7 +1,7 @@ --- description: Describes the parameters that Windows PowerShell Workflow adds to activities. Locale: en-US -ms.date: 06/09/2017 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/psworkflow/about/about_activitycommonparameters?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: about ActivityCommonParameters @@ -15,23 +15,25 @@ Describes the parameters that Windows PowerShell Workflow adds to activities. ## LONG DESCRIPTION Windows PowerShell Workflow adds the activity common parameters to activities -that are derived from the PSActivity base class. This category includes the -InlineScript activity and Windows PowerShell cmdlets that are implemented as -activities, such as Get-Process and Get-WinEvent. +that are derived from the **PSActivity** base class. This category includes the +**InlineScript** activity and Windows PowerShell cmdlets that are implemented as +activities, such as `Get-Process` and `Get-WinEvent`. -The activity common parameters are not valid on the Suspend-Workflow and -Checkpoint-Workflow activities and they are not added to cmdlets or expressions -that Windows PowerShell Workflow automatically runs in an InlineScript script -block or similar activity. The activity common parameters are available on the -InlineScript activity, but not on commands in the InlineScript script block. +The activity common parameters are not valid on the `Suspend-Workflow` and +`Checkpoint-Workflow` activities and they are not added to cmdlets or +expressions that Windows PowerShell Workflow automatically runs in an +**InlineScript** script block or similar activity. The activity common +parameters are available on the **InlineScript** activity, but not on commands +in the **InlineScript** script block. Several of the activity common parameters are also workflow common parameters or Windows PowerShell common parameters. Other activity common parameters are unique to activities. For information about the workflow common parameters, see -about_WorkflowCommonParameters. For information about the Windows PowerShell -common parameters, see [about_CommonParameters](../../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +[about_WorkflowCommonParameters](about_WorkflowCommonParameters.md). For +information about the Windows PowerShell common parameters, see +[about_CommonParameters](../../Microsoft.PowerShell.Core/About/about_CommonParameters.md). ### LIST OF ACTIVITY COMMON PARAMETERS @@ -78,7 +80,7 @@ Workflow Test-Workflow ``` This parameter is designed for XAML-based workflows. In script workflows, you -can also use the += assignment operator to add output to the value of a +can also use the `+=` assignment operator to add output to the value of a variable, as shown in the following example. ```powershell @@ -92,47 +94,48 @@ Workflow Test-Workflow #### Debug \<SwitchParameter\> Displays programmer-level detail about the operation performed by the command. -The Debug parameter overrides the value of the $DebugPreference variable for -the current command. This parameter works only when the command generates +The **Debug** parameter overrides the value of the `$DebugPreference` variable +for the current command. This parameter works only when the command generates debugging messages. This parameter is also a Windows PowerShell common parameter. #### DisplayName \<String\> -Specifies a friendly name for the activity. The DisplayName value appears in -the progress bar while the workflow runs and in the value of the Progress -property of the workflow job. When the PSProgressMessage parameter is also +Specifies a friendly name for the activity. The **DisplayName** value appears in +the progress bar while the workflow runs and in the value of the **Progress** +property of the workflow job. When the **PSProgressMessage** parameter is also included in the command, the progress bar content appears in -\<DisplayName\>:\<PSProgressMessage\> format. +`<DisplayName>:<PSProgressMessage>` format. #### ErrorAction \<ActionPreference\> Determines how the activity responds to a non-terminating error from the command. It has no effect on termination errors. This parameter works only when the command generates a non-terminating error, such as those from the -Write-Error cmdlet. The ErrorAction parameter overrides the value of the -$ErrorActionPreference variable for the current command. This parameter is also -a Windows PowerShell common parameter. +`Write-Error` cmdlet. The **ErrorAction** parameter overrides the value of the +`$ErrorActionPreference` variable for the current command. This parameter is +also a Windows PowerShell common parameter. Valid values: -- Continue. Displays the error message and continues executing - the command. "Continue" is the default value. +- `Continue`. Displays the error message and continues executing the command. + `Continue` is the default value. -- Ignore. Suppresses the error message and continues executing the command. - Unlike SilentlyContinue, Ignore does not add the error message to the $Error - automatic variable. The Ignore value is introduced in Windows PowerShell 3.0. +- `Ignore`. Suppresses the error message and continues executing the command. + Unlike `SilentlyContinue`, `Ignore` does not add the error message to the + `$Error` automatic variable. The `Ignore` value is introduced in Windows + PowerShell 3.0. -- Inquire. Displays the error message and prompts you for confirmation before +- `Inquire`. Displays the error message and prompts you for confirmation before continuing execution. This value is rarely used. -- Suspend. Automatically suspends a workflow job to allow for further +- `Suspend`. Automatically suspends a workflow job to allow for further investigation. After investigation, the workflow can be resumed. -- SilentlyContinue. Suppresses the error message and continues executing the +- `SilentlyContinue`. Suppresses the error message and continues executing the command. -- Stop. Displays the error message and stops executing the command. +- `Stop`. Displays the error message and stops executing the command. #### Input \<Object[]\> @@ -142,20 +145,20 @@ piping objects to the activity one at a time. #### MergeErrorToOutput \<Boolean\> A value of `$True` adds errors to the output stream. A value of `$False` has -not effect. Use this parameter with the Parallel and `ForEach -Parallel` +no effect. Use this parameter with the **Parallel** and `ForEach -Parallel` keywords to collect errors and output from multiple parallel commands in a single collection. #### PSActionRetryCount \<Int32\> Tries repeatedly to run the activity if the first attempt fails. The default -value, 0, does not retry. +value, `0`, does not retry. #### PSActionRetryIntervalSec \<Int32\> Determines the interval between action retries in seconds. The default value, -0, retries the action immediately. This parameter is valid only when the -PSActionRetryCount parameter is also used in the command. +`0`, retries the action immediately. This parameter is valid only when the +**PSActionRetryCount** parameter is also used in the command. #### PSActionRunningTimeoutSec \<Int32\> @@ -166,27 +169,28 @@ affected target computer. #### PSAllowRedirection \<Boolean\> -A value of $True allows redirection of the connection to the target computers. -A value of $False has no effect. This activity common parameter is also a +A value of `$True` allows redirection of the connection to the target computers. +A value of `$False` has no effect. This activity common parameter is also a workflow common parameter. -When you use the PSConnectionURI parameter, the remote destination can return +When you use the **PSConnectionURI** parameter, the remote destination can return an instruction to redirect to a different URI. By default, Windows PowerShell -does not redirect connections, but you can use the PSAllowRedirection parameter -with a value of $True to allow redirection of the connection to the target +does not redirect connections, but you can use the **PSAllowRedirection** parameter +with a value of `$True` to allow redirection of the connection to the target computer. You can also limit the number of times that the connection is redirected by -setting the MaximumConnectionRedirectionCount property of the `$PSSessionOption` -preference variable, or the MaximumConnectionRedirectionCount property of the -value of the SSessionOption parameter of cmdlets that create a session. The -default value is 5. +setting the **MaximumConnectionRedirectionCount** property of the +`$PSSessionOption` preference variable, or the +**MaximumConnectionRedirectionCount** property of the value of the +**SessionOption** parameter of cmdlets that create a session. The default value +is `5`. #### PSApplicationName \<String\> Specifies the application name segment of the connection URI that is used to connect to the target computers. Use this parameter to specify the application -name when you are not using the ConnectionURI parameter in the command. This +name when you are not using the **ConnectionURI** parameter in the command. This activity common parameter is also a workflow common parameter. The default value is the value of the `$PSSessionApplicationName` preference @@ -197,15 +201,15 @@ information, see The WinRM service uses the application name to select a listener to service the connection request. The value of this parameter should match the value of the -URLPrefix property of a listener on the remote computer. +**URLPrefix** property of a listener on the remote computer. #### PSAuthentication \<AuthenticationMechanism\> -Specifies the mechanism that is used to authenticate the user's credentials -when connecting to the target computers. Valid values are Default, Basic, -Credssp, Digest, Kerberos, Negotiate, and NegotiateWithImplicitCredential. The -default value is Default. This activity common parameter is also a workflow -common parameter. +Specifies the mechanism that is used to authenticate the user's credentials when +connecting to the target computers. Valid values are `Default`, `Basic`, +`CredSSP`, `Digest`, `Kerberos`, `Negotiate`, and +`NegotiateWithImplicitCredential`. The default value is `Default`. This activity +common parameter is also a workflow common parameter. For information about the values of this parameter, see the description of the **System.Management.Automation.Runspaces.AuthenticationMechanism** enumeration in @@ -232,7 +236,7 @@ be mapped to local user accounts; they do not work with domain accounts. To get a certificate, use the [Get-Item](xref:Microsoft.PowerShell.Management.Get-Item) or [Get-ChildItem](xref:Microsoft.PowerShell.Management.Get-ChildItem) -cmdlets in the Windows PowerShell Cert: drive. +cmdlets in the Windows PowerShell `Cert:` drive. #### PSComputerName \<String[]\> @@ -242,44 +246,44 @@ parameter. Type the NETBIOS name, IP address, or fully-qualified domain name of one or more computers in a comma-separated list. To specify the local computer, type -the computer name, "localhost", or a dot (.). +the computer name, `localhost`, or a dot (`.`). -To include the local computer in the value of the PSComputerName parameter, -open Windows PowerShell with the "Run as administrator" option. +To include the local computer in the value of the **PSComputerName** parameter, +open Windows PowerShell with the **Run as administrator** option. -If this parameter is omitted from the command, or it value is $null or an empty -string, the workflow target is the local computer and Windows PowerShell +If this parameter is omitted from the command, or it value is `$null` or an +empty string, the workflow target is the local computer and Windows PowerShell remoting is not used to run the command. -To use an IP address in the value of the ComputerName parameter, the command -must include the PSCredential parameter. Also, the computer must be configured -for HTTPS transport or the IP address of the remote computer must be included -in the WinRM TrustedHosts list on the local computer. For instructions for -adding a computer name to the TrustedHosts list, see "How to Add a Computer to -the Trusted Host List" in +To use an IP address in the value of the **ComputerName** parameter, the command +must include the **PSCredential** parameter. Also, the computer must be +configured for HTTPS transport or the IP address of the remote computer must be +included in the WinRM TrustedHosts list on the local computer. For instructions +for adding a computer name to the TrustedHosts list, see "How to Add a Computer +to the Trusted Host List" in [about_Remote_Troubleshooting](../../Microsoft.PowerShell.Core/About/about_Remote_Troubleshooting.md). #### PSConfigurationName \<String\> Specifies the session configurations that are used to create sessions on the target computers. Enter the name of a session configuration on the target -computers (not on the computer that is running the workflow. The default is -Microsoft.PowerShell. This activity common parameter is also a workflow common -parameter. +computers (not on the computer that is running the workflow). The default is +**Microsoft.PowerShell.Workflow**. This activity common parameter is also a +workflow common parameter. #### PSConnectionRetryCount \<UInt\> Specifies the maximum number of attempts to connect to each target computer if the first connection attempt fails. Enter a number between 1 and 4,294,967,295 -(UInt.MaxValue). The default value, zero (0), represents no retry attempts. -This activity common parameter is also a workflow common parameter. +(**UInt.MaxValue**). The default value, zero (`0`), represents no retry +attempts. This activity common parameter is also a workflow common parameter. #### PSConnectionRetryIntervalSec \<UInt\> Specifies the delay between connection retry attempts in seconds. The default -value is zero (0). This parameter is valid only when the value of -PSConnectionRetryCount is at least 1. This activity common parameter is also a -workflow common parameter. +value is zero (`0`). This parameter is valid only when the value of +**PSConnectionRetryCount** is at least 1. This activity common parameter is also +a workflow common parameter. #### PSConnectionURI \<System.Uri\> @@ -295,38 +299,39 @@ The format of this string is as follows: The default value is `http://localhost:5985/WSMAN`. -If you do not specify a PSConnectionURI, you can use the PSUseSSL, -PSComputerName, PSPort, and PSApplicationName parameters to specify the -PSConnectionURI values. +If you do not specify a **PSConnectionURI**, you can use the **PSUseSSL**, +**PSComputerName**, **PSPort**, and **PSApplicationName** parameters to specify +the **PSConnectionURI** values. -Valid values for the Transport segment of the URI are HTTP and HTTPS. If you +Valid values for the Transport segment of the URI are `HTTP` and `HTTPS`. If you specify a connection URI with a Transport segment, but do not specify a port, -the session is created with standards ports: 80 for HTTP and 443 for HTTPS. To -use the default ports for Windows PowerShell remoting, specify port 5985 for -HTTP or 5986 for HTTPS. +the session is created with standards ports: `80` for HTTP and `443` for HTTPS. +To use the default ports for Windows PowerShell remoting, specify port `5985` +for HTTP or `5986` for HTTPS. #### PSCredential \<PSCredential\> Specifies a user account that has permission to run the activity on the target -computer. The default is the current user. This parameter is valid only when -the PSComputerName parameter is included in the command. This activity common +computer. The default is the current user. This parameter is valid only when the +**PSComputerName** parameter is included in the command. This activity common parameter is also a workflow common parameter. -Type a user name, such as "User01" or "Domain01\User01", or enter a variable -that contains a PSCredential object, such as one that the Get-Credential cmdlet -returns. If you enter only a user name, you will be prompted for a password. +Type a user name, such as `User01` or `Domain01\User01`, or enter a variable +that contains a **PSCredential** object, such as one that the `Get-Credential` +cmdlet returns. If you enter only a user name, you are prompted for a +password. #### PSDebug \<PSDataCollection[DebugRecord]\> Adds debug messages from the activity to the specified debug record collection, instead of writing the debug messages to the console or to the value of the -Debug property of the workflow job. You can add debug messages from multiple +**Debug** property of the workflow job. You can add debug messages from multiple activities to the same debug record collection object. -To use this activity common parameter, use the New-Object cmdlet to create a -PSDataCollection object with a type of DebugRecord and save the object in a -variable. Then, use the variable as the value of the PSDebug parameter of one -or more activities, as shown in the following example. +To use this activity common parameter, use the `New-Object` cmdlet to create a +**PSDataCollection** object with a type of **DebugRecord** and save the object +in a variable. Then, use the variable as the value of the **PSDebug** parameter +of one or more activities, as shown in the following example. ```powershell Workflow Test-Workflow @@ -347,7 +352,7 @@ saved when a checkpoint is taken. #### PSDisableSerializationPreference \<Boolean\> -Applies the equivalent of the PSDisableSerialization parameter to the entire +Applies the equivalent of the **PSDisableSerialization** parameter to the entire workflow, not just the activity. Adding this parameter is generally not recommended, because a workflow that doesn't serialize its objects cannot be resumed or persisted. @@ -355,7 +360,7 @@ resumed or persisted. Valid values: - (Default) If omitted, and you have also not added the - PSDisableSerialization parameter to an activity, objects are serialized. + **PSDisableSerialization** parameter to an activity, objects are serialized. - `$True`. Directs all activities within a workflow to return "live" (not serialized) objects. The resulting objects have methods, as well @@ -366,13 +371,13 @@ Valid values: Adds error messages from the activity to the specified error record collection, instead of writing the error messages to the console or to the value of the -Error property of the workflow job. You can add error messages from multiple +**Error** property of the workflow job. You can add error messages from multiple activities to the same error record collection object. To use this activity common parameter, use the `New-Object` cmdlet to create a -PSDataCollection object with a type of ErrorRecord and save the object in a -variable. Then, use the variable as the value of the PSError parameter of one -or more activities, as shown in the following example. +**PSDataCollection** object with a type of **ErrorRecord** and save the object +in a variable. Then, use the variable as the value of the **PSError** parameter +of one or more activities, as shown in the following example. ```powershell Workflow Test-Workflow @@ -403,23 +408,22 @@ to restart the workflow. Valid values: -- (Default) If you omit this parameter, no checkpoints are - added. Checkpoints are taken based on the settings for the workflow. +- (Default) If you omit this parameter, no checkpoints are added. Checkpoints + are taken based on the settings for the workflow. -- `$True`. Takes a checkpoint after the activity completes. - This checkpoint is in addition to any checkpoints that are specified in - the workflow. +- `$True`. Takes a checkpoint after the activity completes. This checkpoint is + in addition to any checkpoints that are specified in the workflow. -- `$False`. No checkpoints are added. Checkpoints are taken only when - specified in the workflow. +- `$False`. No checkpoints are added. Checkpoints are taken only when specified + in the workflow. #### PSPort \<Int32\> -Specifies the network port on the target computers. The default ports are 5985 -(the WinRM port for HTTP) and 5986 (the WinRM port for HTTPS). This activity +Specifies the network port on the target computers. The default ports are `5985` +(the WinRM port for HTTP) and 59`86 (the WinRM port for HTTPS). This activity common parameter is also a workflow common parameter. -Do not use the PSPort parameter unless you must. The port set in the command +Do not use the **PSPort** parameter unless you must. The port set in the command applies to all computers or sessions on which the command runs. An alternate port setting might prevent the command from running on all computers. Before using an alternate port, you must configure the WinRM listener on the remote @@ -429,20 +433,20 @@ computer to listen at that port. Adds progress messages from the activity to the specified progress record collection, instead of writing the progress messages to the console or to the -value of the Progress property of the workflow job. You can add progress +value of the **Progress** property of the workflow job. You can add progress messages from multiple activities to the same progress record collection object. #### PSProgressMessage \<String\> -Specifies a friendly description of the activity. The PSProgressMessage value -appears in the progress bar while the workflow runs. When the DisplayName is +Specifies a friendly description of the activity. The **PSProgressMessage** value +appears in the progress bar while the workflow runs. When the **DisplayName** is also included in the command, the progress bar content appears in -\<DisplayName\>:\<PSProgressMessage\> format. +`<DisplayName>:<PSProgressMessage>` format. -This parameter is particularly useful for identifying activities in a ForEach --Parallel script block. Without this message, activities in all parallel -branches are identified by the same name. +This parameter is particularly useful for identifying activities in a +`ForEach -Parallel` script block. Without this message, activities in all +parallel branches are identified by the same name. #### PSRemotingBehavior \<RemotingBehavior\> @@ -451,34 +455,35 @@ PowerShell is the default. Valid values are: -- None: The activity is not run on remote computers. +- `None`: The activity is not run on remote computers. -- PowerShell: Windows PowerShell remoting is used to run the activity on +- `PowerShell`: Windows PowerShell remoting is used to run the activity on target computers. -- Custom: The activity supports its own type of remoting. This value is valid +- `Custom`: The activity supports its own type of remoting. This value is valid when the cmdlet that is being implemented as an activity sets the value of - the RemotingCapability attribute to SupportedByCommand and the command - includes the ComputerName parameter. + the **RemotingCapability** attribute to **SupportedByCommand** and the command + includes the **ComputerName** parameter. #### PSRequiredModules \<String[]\> Imports the specified modules before running the command. Enter the module names. The modules must be installed on the target computer. -Modules that are installed in a path specified in the PSModulePath environment -variable are automatically imported on first use of any command in the module. -Use this parameter to import modules that are not in a PSModulePath location. +Modules that are installed in a path specified in the **PSModulePath** +environment variable are automatically imported on first use of any command in +the module. Use this parameter to import modules that are not in a +**PSModulePath** location. -Because each activity in a workflow runs in its own session, an Import-Module +Because each activity in a workflow runs in its own session, an `Import-Module` command imports a module only into the session in which it runs. It does not import the module into sessions in which other activities run. #### PSSessionOption \<PSSessionOption\> Sets advanced options for the sessions to the target computers. Enter a -PSSessionOption object, such as one that you create by using the -New-PSSessionOption cmdlet. This activity common parameter is also a workflow +**PSSessionOption** object, such as one that you create by using the +`New-PSSessionOption` cmdlet. This activity common parameter is also a workflow common parameter. The default values for the session options are determined by the value of the @@ -489,18 +494,18 @@ For a description of the session options, including the default values, see the help topic for the New-PSSessionOption cmdlet [New-PSSessionOption](xref:Microsoft.PowerShell.Core.New-PSSessionOption). -For more information about the $PSSessionOption preference variable, see +For more information about the `$PSSessionOption` preference variable, see [about_Preference_Variables](../../Microsoft.PowerShell.Core/About/about_Preference_Variables.md). #### PSUseSSL \<Boolean\> -A value of $True uses the Secure Sockets Layer (SSL) protocol to establish a +A value of `$True` uses the Secure Sockets Layer (SSL) protocol to establish a connection to the target computer. By default, SSL is not used. A value of -$False has no effect. This activity common parameter is also a workflow common +`$False` has no effect. This activity common parameter is also a workflow common parameter. WS-Management encrypts all Windows PowerShell content transmitted over the -network. UseSSL is an additional protection that sends the data across an +network. **UseSSL** is an additional protection that sends the data across an HTTPS, instead of HTTP. If you use this parameter, but SSL is not available on the port used for the command, the command fails. @@ -508,15 +513,15 @@ the port used for the command, the command fails. Adds verbose messages from the activity to the specified verbose record collection, instead of writing the verbose messages to the console or to the -value of the Verbose property of the workflow job. You can add verbose messages -from multiple activities to the same verbose record collection object. +value of the **Verbose** property of the workflow job. You can add verbose +messages from multiple activities to the same verbose record collection object. #### PSWarning \<PSDataCollection[WarningRecord]\> Adds warning messages from the activity to the specified warning record collection, instead of writing the warning messages to the console or to the -value of the Warning property of the workflow job. You can add warning messages -from multiple activities to the same warning record collection object. +value of the **Warning** property of the workflow job. You can add warning +messages from multiple activities to the same warning record collection object. #### Result @@ -526,9 +531,9 @@ This parameter is valid only in XAML workflows. Accepts all workflow input as input to the activity by value. -For example, the Get-Process activity in the following sample workflow uses the -UseDefaultInput activity common parameter to get input that is passed to the -workflow. When you run the workflow with input, that input is used by the +For example, the `Get-Process` activity in the following sample workflow uses +the **UseDefaultInput** activity common parameter to get input that is passed to +the workflow. When you run the workflow with input, that input is used by the activity. ```powershell @@ -548,50 +553,50 @@ Running winrm Windows Remote Management (WS-Manag... localhost #### Verbose \<SwitchParameter\> -Displays detailed information about the operation performed by the command. -This information resembles the information in a trace or in a transaction log. -The Verbose parameter overrides the value of the $VerbosePreference variable +Displays detailed information about the operation performed by the command. This +information resembles the information in a trace or in a transaction log. The +**Verbose** parameter overrides the value of the `$VerbosePreference` variable for the current command. This parameter works only when the command generates a verbose message. This parameter is also a Windows PowerShell common parameter. #### WarningAction \<ActionPreference\> -Determines how the activity responds to a warning. "Continue" is the default -value. The WarningAction parameter overrides the value of the -$WarningPreference variable for the current command. This parameter works only +Determines how the activity responds to a warning. `Continue` is the default +value. The **WarningAction** parameter overrides the value of the +`$WarningPreference` variable for the current command. This parameter works only when the command generates a warning message. This parameter is also a Windows PowerShell common parameter. Valid Values: -- SilentlyContinue. Suppresses the warning message and continues executing the +- `SilentlyContinue`. Suppresses the warning message and continues executing the command. -- Continue. Displays the warning message and continues executing the command. - "Continue" is the default value. +- `Continue`. Displays the warning message and continues executing the command. + `Continue` is the default value. -- Inquire. Displays the warning message and prompts you for confirmation before +- `Inquire`. Displays the warning message and prompts you for confirmation before continuing execution. This value is rarely used. -- Stop. Displays the warning message and stops executing the command. +- `Stop`. Displays the warning message and stops executing the command. > [!NOTE] -> The WarningAction parameter does not override -> the value of the $WarningAction preference variable -> when the parameter is used in a command to run a -> script or function. +> The **WarningAction** parameter does not override the value of the +> `$WarningAction` preference variable when the parameter is used in a command +> to run a script or function. ### EXAMPLES The activity common parameters are extremely useful. For example, you can use -the PSComputerName parameter to run particular activities on only a subset of -the target computers. +the **PSComputerName** parameter to run particular activities on only a subset +of the target computers. -Or, you might use the PSConnectionRetryCount and PSConnectionRetryIntervalSec -parameters to adjust the retry values for particular activities. +Or, you might use the **PSConnectionRetryCount** and +**PSConnectionRetryIntervalSec** parameters to adjust the retry values for +particular activities. -The following example shows how to use the PSComputerName activity common -parameters to run a Get-EventLog activity only on computers it a particular +The following example shows how to use the **PSComputerName** activity common +parameters to run a `Get-EventLog` activity only on computers it a particular domain. ```powershell diff --git a/reference/5.1/PSWorkflow/About/about_WorkflowCommonParameters.md b/reference/5.1/PSWorkflow/About/about_WorkflowCommonParameters.md index 488a63aa9fe8..0a29ca503623 100644 --- a/reference/5.1/PSWorkflow/About/about_WorkflowCommonParameters.md +++ b/reference/5.1/PSWorkflow/About/about_WorkflowCommonParameters.md @@ -1,7 +1,7 @@ --- description: This topic describes the parameters that are valid on all Windows PowerShell workflow commands. Because the Windows PowerShell engine adds them to workflows, you can use these parameters on any workflow and they are automatically enabled on the workflows that you author. Locale: en-US -ms.date: 06/09/2017 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/psworkflow/about/about_workflowcommonparameters?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: about WorkflowCommonParameters @@ -19,21 +19,21 @@ automatically enabled on the workflows that you author. Windows PowerShell Workflow common parameters are a set of cmdlet parameters that you can use with all Windows PowerShell workflows and activities. They are -added by the Windows PowerShell Workflow engine, not by the workflow author, -and they are automatically available on workflows and activities. However, -workflows that are nested three levels deep do not support any common -parameters, including workflow common parameters. +added by the Windows PowerShell Workflow engine, not by the workflow author, and +they are automatically available on workflows and activities. However, workflows +that are nested three levels deep do not support any common parameters, +including workflow common parameters. All workflow parameters are optional and named (not positional). They do not take input from the pipeline. -Most of the workflow common parameters have a PS prefix, such as -`PSComputerName` and `PSCredential`. The PS-prefixed parameters configure the -connection and the execution environment for the target computers, also known -as "remote nodes." +Most of the workflow common parameters have a `PS` prefix, such as +**PSComputerName** and **PSCredential**. The PS-prefixed parameters configure +the connection and the execution environment for the target computers, also +known as "remote nodes." -Many of the workflow common parameters, such as `PSAllowRedirection` and -`AsJob`, have names that are similar to parameters used in Windows PowerShell +Many of the workflow common parameters, such as **PSAllowRedirection** and +**AsJob**, have names that are similar to parameters used in Windows PowerShell remoting and background jobs. These parameters work in the same way as the similarly-named remoting and job parameters, so you can use the knowledge that you developed in remoting and jobs to manage workflows. @@ -55,11 +55,11 @@ Job cmdlets. To get the job results, use #### -JobName \<String\> Specifies a friendly name for the workflow job. By default, jobs are named -"Job\<n\>", where \<n\> is an ordinal number. +`Job<n>`, where `<n>` is an ordinal number. -If you use the JobName parameter in a workflow command, the workflow is run as -a job and the workflow command returns a job object, even if you do not include -the `AsJob` parameter in the command. +If you use the **JobName** parameter in a workflow command, the workflow is run +as a job and the workflow command returns a job object, even if you do not +include the **AsJob** parameter in the command. For more information about Windows PowerShell background jobs, see [about_Jobs](../../Microsoft.PowerShell.Core/About/about_Jobs.md). @@ -68,34 +68,35 @@ For more information about Windows PowerShell background jobs, see Allows redirection of the connection to the target computers. -When you use the `PSConnectionURI` parameter, the remote destination can return -an instruction to redirect to a different URI. By default, Windows PowerShell -does not redirect connections, but you can use the `PSAllowRedirection` -parameter to allow redirection of the connection to the target computer. +When you use the **PSConnectionURI** parameter, the remote destination can +return an instruction to redirect to a different URI. By default, Windows +PowerShell does not redirect connections, but you can use the +**PSAllowRedirection** parameter to allow redirection of the connection to the +target computer. You can also limit the number of times that the connection is redirected by -setting the `MaximumConnectionRedirectionCount` property of the +setting the **MaximumConnectionRedirectionCount** property of the `$PSSessionOption` preference variable, or the -`MaximumConnectionRedirectionCount` property of the value of the -`PSSessionOption parameter`. The default value is 5. For more information, see -the description of the `PSSessionOption` parameter and +**MaximumConnectionRedirectionCount** property of the value of the +**PSSessionOption** parameter. The default value is `5`. For more information, +see the description of the **PSSessionOption** parameter and [New-PSSessionOption](xref:Microsoft.PowerShell.Core.New-PSSessionOption). #### -PSApplicationName \<String\> Specifies the application name segment of the connection URI that is used to connect to the target computers. Use this parameter to specify the application -name when you are not using the `ConnectionURI` parameter in the command. +name when you are not using the **ConnectionURI** parameter in the command. The default value is the value of the `$PSSessionApplicationName` preference variable on the local computer. If this preference variable is not defined, the -default value is WSMAN. This value is appropriate for most uses. For more +default value is `WSMAN`. This value is appropriate for most uses. For more information, see [about_Preference_Variables](../../Microsoft.PowerShell.Core/About/about_Preference_Variables.md). The WinRM service uses the application name to select a listener to service the connection request. The value of this parameter should match the value of the -`URLPrefix` property of a listener on the remote computer. +**URLPrefix** property of a listener on the remote computer. #### -PSAuthentication \<AuthenticationMechanism\> @@ -104,19 +105,19 @@ when connecting to the target computers. Valid values are: -- **Default** -- **Basic** -- **Credssp** -- **Digest** -- **Kerberos** -- **Negotiate** -- **NegotiateWithImplicitCredential** +- `Default` +- `Basic` +- `Credssp` +- `Digest` +- `Kerberos` +- `Negotiate` +- `NegotiateWithImplicitCredential` -The default value is **Default**. +The default value is `Default`. For information about the values of this parameter, see the description of the -`System.Management.Automation.Runspaces.AuthenticationMechanism` enumeration in -the PowerShell SDK. +**System.Management.Automation.Runspaces.AuthenticationMechanism** enumeration +in the PowerShell SDK. > [!WARNING] > Credential Security Service Provider (CredSSP) authentication, in which the @@ -130,20 +131,20 @@ the PowerShell SDK. #### -PSAuthenticationLevel \<AuthenticationLevel\> Specifies the authentication level for the connections to the target computers. -The default value is **Default**. +The default value is `Default`. Valid values are: -|Name |Description | -|---------|---------| -|**Unchanged** | The authentication level is the same as the previous command. | -|**Default** | Windows Authentication. | -|**None** | No COM authentication. | -|**Connect** | Connect-level COM authentication.| -|**Call** | Call-level COM authentication. | -|**Packet** | Packet-level COM authentication.| -|**PacketIntegrity** | Packet Integrity-level COM authentication. | -|**PacketPrivacy** | Packet Privacy-level COM authentication. | +| Name | Description | +| ----------------- | ------------------------------------------------------------- | +| `Unchanged` | The authentication level is the same as the previous command. | +| `Default` | Windows Authentication. | +| `None` | No COM authentication. | +| `Connect` | Connect-level COM authentication. | +| `Call` | Call-level COM authentication. | +| `Packet` | Packet-level COM authentication. | +| `PacketIntegrity` | Packet Integrity-level COM authentication. | +| `PacketPrivacy` | Packet Privacy-level COM authentication. | #### -PSCertificateThumbprint \<String\> @@ -155,9 +156,9 @@ Certificates are used in client certificate-based authentication. They can only be mapped to local user accounts; they do not work with domain accounts. To get a certificate, use the -[Get-Item](xref:Microsoft.PowerShell.Management.Get-Item) or [Get-ChildItem] -(../../Microsoft.PowerShell.Management/Get-Childitem.md) cmdlets in the Windows -PowerShell Cert: drive. +[Get-Item](xref:Microsoft.PowerShell.Management.Get-Item) or +[Get-ChildItem](xref:Microsoft.PowerShell.Management.Get-ChildItem) cmdlets in +the Windows PowerShell `Cert:` drive. #### -PSComputerName \<String[]\> @@ -165,41 +166,43 @@ Specifies the list of computers that are the target nodes of the workflow. Commands or activities in a workflow are run on the computers that are specified by using this parameter. The default is the local computer. -Type the NETBIOS name, IP address, or fully-qualified domain name of one or -more computers in a comma-separated list. To specify the local computer, type -the computer name, "localhost", or a dot (.). +Type the NETBIOS name, IP address, or fully-qualified domain name of one or more +computers in a comma-separated list. To specify the local computer, type the +computer name, `localhost`, or a dot (`.`). -To include the local computer in the value of the `PSComputerName` parameter, -open Windows PowerShell with the "Run as administrator" option. +To include the local computer in the value of the **PSComputerName** parameter, +open Windows PowerShell with the **Run as administrator** option. If this parameter is omitted from the command, or it value is `$null` or an -empty string, the workflow target is the local computer and Windows -PowerShell remoting is not used to run the command. +empty string, the workflow target is the local computer and Windows PowerShell +remoting is not used to run the command. -To use an IP address in the value of the `ComputerName` parameter, the -command must include the `PSCredential` parameter. Also, the computer must be -configured for HTTPS transport or the IP address of the remote computer -must be included in the WinRM TrustedHosts list on the local computer. For -instructions for adding a computer name to the TrustedHosts list, see *"How -to Add a Computer to the Trusted Host List"* in [about_Remote_Troubleshooting](../../Microsoft.PowerShell.Core/About/about_Remote_Troubleshooting.md). +To use an IP address in the value of the **ComputerName** parameter, the command +must include the **PSCredential** parameter. Also, the computer must be +configured for HTTPS transport or the IP address of the remote computer must be +included in the WinRM TrustedHosts list on the local computer. For instructions +for adding a computer name to the TrustedHosts list, see "How to Add a Computer +to the Trusted Host List" in +[about_Remote_Troubleshooting](../../Microsoft.PowerShell.Core/About/about_Remote_Troubleshooting.md). #### -PSConfigurationName \<String\> Specifies the session configurations that are used to configure sessions on the target computers. Enter a session configuration on the target computers (not -the workflow server computer). The default is `Microsoft.PowerShell.Workflow`. +the workflow server computer). The default is **Microsoft.PowerShell.Workflow**. #### -PSConnectionRetryCount \<UInt\> Specifies the maximum number of attempts to connect to each target computer if the first connection attempt fails. Enter a number between 1 and 4,294,967,295 -(UInt.MaxValue). The default value, zero (0), represents no retry attempts. +(**UInt.MaxValue**). The default value, zero (`0`), represents no retry +attempts. #### -PSConnectionRetryIntervalSec \<UInt\> Specifies the delay between connection retry attempts in seconds. The default -value is zero (0). This parameter is valid only when the value of -PSConnectionRetryCount is at least 1. +value is zero (`0`). This parameter is valid only when the value of +**PSConnectionRetryCount** is at least `1`. #### -PSConnectionURI \<System.Uri\> @@ -213,33 +216,32 @@ The format of this string is as follows: The default value is `http://localhost:5985/WSMAN`. -If you do not specify a `PSConnectionURI`, you can use the `PSUseSSL`, -`PSComputerName`, `PSPort`, and `PSApplicationName` parameters to specify the -`PSConnectionURI` values. +If you do not specify a **PSConnectionURI**, you can use the **PSUseSSL**, +**PSComputerName**, **PSPort**, and **PSApplicationName** parameters to specify +the **PSConnectionURI** values. -Valid values for the Transport segment of the URI are **HTTP** and **HTTPS**. -If you specify a connection URI with a Transport segment, but do not specify a -port, the session is created with standards ports: 80 for HTTP and 443 for -HTTPS. To use the default ports for Windows PowerShell remoting, specify -port 5985 for HTTP or 5986 for HTTPS. +Valid values for the Transport segment of the URI are **HTTP** and **HTTPS**. If +you specify a connection URI with a Transport segment, but do not specify a +port, the session is created with standards ports: `80` for HTTP and `443` for +HTTPS. To use the default ports for Windows PowerShell remoting, specify port +`5985` for HTTP or `5986` for HTTPS. #### -PSCredential \<PSCredential\> Specifies a user account that has permission to run a workflow on the target computer. The default is the current user. This parameter is valid only when -the PSComputerName parameter is included in the command. +the **PSComputerName** parameter is included in the command. -Type a user name, such as "User01" or "Domain01\User01", or enter a variable -that contains a `PSCredential` object, such as one that the `Get-Credential` -cmdlet returns. If you enter only a user name, you will be prompted for a -password. +Type a user name, such as `User01` or `Domain01\User01`, or enter a variable +that contains a **PSCredential** object, such as one that the `Get-Credential` +cmdlet returns. If you enter only a user name, you are prompted for a password. #### -PSElapsedTimeoutSec \<UInt32\> Determines how long the workflow and all related resources are maintained in the system. When the timeout expires, the workflow is deleted, even if it is still processing. Enter a value between 10 and 4,294,967,295. The -default value, 0 (zero), means that there is no elapsed timeout. +default value, `0` (zero), means that there is no elapsed timeout. #### -PSParameterCollection \<Hashtable[]\> @@ -247,8 +249,8 @@ Specifies different workflow common parameter values for different target computers. Enter a comma-separated list of hash tables with one hash table for each target -computer. In each hash table, the first key is `PSComputerName` and its value is -the name of the target computer. Wildcard characters are permitted in the +computer. In each hash table, the first key is **PSComputerName** and its value +is the name of the target computer. Wildcard characters are permitted in the computer name. For the remaining keys in the hash table, the key is the parameter name and the value is the parameter value. @@ -261,9 +263,9 @@ For example: @{PSComputerName="Server01"; PSElapsedTimeoutSec=10} ``` -In the above example, all connections will have a default PSElapsedTimeoutSec -of 20 seconds, except for Server01 which overrides the default value -by specifying its own timeout of 10 seconds. +In the above example, all connections will have a default **PSElapsedTimeoutSec** +of `20` seconds, except for Server01 which overrides the default value +by specifying its own timeout of `10` seconds. #### -PSPersist \<Boolean\> @@ -271,7 +273,7 @@ Adds checkpoints to the workflow, in addition to any checkpoints that are specified in the workflow. This parameter cannot suppress the checkpoints in a workflow, such as those -specified by using the `PSPersist` activity common parameter, the +specified by using the **PSPersist** activity common parameter, the `Checkpoint-Workflow` activity, or the `$PSPersistPreference` variable. A "checkpoint" or "persistence point" is a snapshot of the workflow state and @@ -282,9 +284,9 @@ point, rather than to restart the workflow. Valid values: -- (*Default*) If you omit this parameter, a checkpoint is added to the - beginning and end of the workflow, in addition to any checkpoints that are - specified in the workflow. +- (Default) If you omit this parameter, a checkpoint is added to the beginning + and end of the workflow, in addition to any checkpoints that are specified in + the workflow. - `$True`. Adds a checkpoint to the beginning and end of the workflow and a checkpoint after each activity, in addition to any checkpoints that are @@ -295,10 +297,10 @@ Valid values: #### -PSPort \<Int32\> -Specifies the network port on the target computers. The default ports are 5985 -(the WinRM port for HTTP) and 5986 (the WinRM port for HTTPS). +Specifies the network port on the target computers. The default ports are `5985` +(the WinRM port for HTTP) and `5986` (the WinRM port for HTTPS). -Do not use the PSPort parameter unless you must. The port set in the command +Do not use the **PSPort** parameter unless you must. The port set in the command applies to all computers or sessions on which the command runs. An alternate port setting might prevent the command from running on all computers. Before using an alternate port, you must configure the WinRM listener on the remote @@ -323,7 +325,7 @@ the workflow. #### -PSSessionOption \<PSSessionOption\> Sets advanced options for the sessions to the target computers. Enter a -`PSSessionOption` object, such as one that you create by using the +**PSSessionOption** object, such as one that you create by using the `New-PSSessionOption` cmdlet. The default values for the session options are determined by the value of the @@ -331,9 +333,9 @@ The default values for the session options are determined by the value of the uses the values specified in the session configuration. For a description of the session options, including the default values, see the -help topic for the `New-PSSessionOption` cmdlet -(../../Microsoft.PowerShell.Core/New-PSSessionOption.md). For information about the -`$PSSessionOption` preference variable, see [about_Preference_Variables](../../Microsoft.PowerShell.Core/About/about_Preference_Variables.md). +[New-PSSessionOption](xref:Microsoft.PowerShell.Core.New-PSSessionOption). +For information about the `$PSSessionOption` preference variable, see +[about_Preference_Variables](../../Microsoft.PowerShell.Core/About/about_Preference_Variables.md). #### -PSUseSSL \<SwitchParameter\> @@ -341,7 +343,7 @@ Uses the Secure Sockets Layer (SSL) protocol to establish a connection to the target computer. By default, SSL is not used. WS-Management encrypts all Windows PowerShell content transmitted over the -network. UseSSL is an additional protection that sends the data across an +network. **UseSSL** is an additional protection that sends the data across an HTTPS, instead of HTTP. If you use this parameter, but SSL is not available on the port used for the command, the command fails. diff --git a/reference/5.1/PSWorkflow/New-PSWorkflowSession.md b/reference/5.1/PSWorkflow/New-PSWorkflowSession.md index 0e5d521a591a..a837d1260776 100644 --- a/reference/5.1/PSWorkflow/New-PSWorkflowSession.md +++ b/reference/5.1/PSWorkflow/New-PSWorkflowSession.md @@ -2,7 +2,7 @@ external help file: Microsoft.Powershell.Workflow.ServiceCore.dll-help.xml Locale: en-US Module Name: PSWorkflow -ms.date: 07/10/2019 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/psworkflow/new-psworkflowsession?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: New-PSWorkflowSession @@ -24,10 +24,10 @@ New-PSWorkflowSession [[-ComputerName] <String[]>] [-Credential <Object>] [-Name ## DESCRIPTION -The `New-PSWorkflowSession` cmdlet creates a user-managed session (**PSSession**) that is -especially designed for running Windows PowerShell workflows. It uses the -Microsoft.PowerShell.Workflow session configuration, which includes scripts, type and formatting -files, and options that are required for workflows. +The `New-PSWorkflowSession` cmdlet creates a user-managed session (**PSSession**) that is especially +designed for running Windows PowerShell workflows. It uses the **Microsoft.PowerShell.Workflow** +session configuration, which includes scripts, type and formatting files, and options that are +required for workflows. You can use `New-PSWorkflowSession` or its alias, `nwsn`. @@ -64,8 +64,8 @@ the **Credential** parameter to run with the permissions of the domain administr New-PSWorkflowSession -Name WorkflowSession -Credential Domain01\Admin01 -ThrottleLimit 150 ``` -The command uses the **ThrottleLimit** parameter to increase the per-command throttle limit to 150. -This value takes precedence over the default throttle limit of 100 that is set in the +The command uses the **ThrottleLimit** parameter to increase the per-command throttle limit to +`150`. This value takes precedence over the default throttle limit of `100` that is set in the **Microsoft.PowerShell.Workflow** session configuration. ## PARAMETERS @@ -76,7 +76,8 @@ Specifies the application name segment of the connection URI. The default value is the value of the `$PSSessionApplicationName` preference variable on the local computer. If this preference variable is not defined, the default value is WSMAN. This value is -appropriate for most uses. For more information, see [about_Preference_Variables](../Microsoft.PowerShell.Core/About/about_Preference_Variables.md). +appropriate for most uses. For more information, see +[about_Preference_Variables](../Microsoft.PowerShell.Core/About/about_Preference_Variables.md). The WinRM service uses the application name to select a listener to service the connection request. The value of this parameter should match the value of the **URLPrefix** property of a listener on @@ -96,18 +97,18 @@ Accept wildcard characters: False ### -Authentication -Specifies the mechanism that is used to authenticate the user credentials. -The acceptable values for this parameter are: +Specifies the mechanism that is used to authenticate the user credentials. The acceptable values for +this parameter are: -- Default -- Basic -- Credssp -- Digest -- Kerberos -- Negotiate -- NegotiateWithImplicitCredential +- `Default` +- `Basic` +- `Credssp` +- `Digest` +- `Kerberos` +- `Negotiate` +- `NegotiateWithImplicitCredential` -The default value is Default. +The default value is `Default`. CredSSP authentication is available only in Windows Vista, Windows Server 2008, and later versions of the Windows operating system. @@ -143,8 +144,8 @@ this action. Enter the certificate thumbprint of the certificate. Certificates are used in client certificate-based authentication. They can be mapped only to local user accounts; they do not work with domain accounts. -To get a certificate thumbprint, use the `Get-Item` cmdlet or the `Get-ChildItem` cmdlet in the Windows -PowerShell Cert: drive. +To get a certificate thumbprint, use the `Get-Item` cmdlet or the `Get-ChildItem` cmdlet in the +Windows PowerShell `Cert:` drive. ```yaml Type: System.String @@ -165,15 +166,16 @@ computer names, Windows PowerShell creates multiple **PSSessions**, one for each default is the local computer. Type the NetBIOS name, an IP address, or a fully qualified domain name of one or more remote -computers. To specify the local computer, type the computer name, localhost, or a dot (.). When the -computer is in a different domain than the user, the fully qualified domain name is required. You -can also pipe a computer name, in quotation marks to `New-PSWorkflowSession`. +computers. To specify the local computer, type the computer name, `localhost`, or a dot (`.`). When +the computer is in a different domain than the user, the fully qualified domain name is required. +You can also pipe a computer name, in quotation marks to `New-PSWorkflowSession`. To use an IP address in the value of the **ComputerName** parameter, the command must include the -**Credential** parameter. Also, the computer must be configured for HTTPS transport or the IP address -of the remote computer must be included in the WinRM TrustedHosts list on the local computer. For -instructions for adding a computer name to the TrustedHosts list, see "How to Add a Computer to the -Trusted Host List" in [about_Remote_Troubleshooting](../Microsoft.PowerShell.Core/About/about_Remote_Troubleshooting.md). +**Credential** parameter. Also, the computer must be configured for HTTPS transport or the IP +address of the remote computer must be included in the WinRM TrustedHosts list on the local +computer. For instructions for adding a computer name to the TrustedHosts list, see "How to Add a +Computer to the Trusted Host List" in +[about_Remote_Troubleshooting](../Microsoft.PowerShell.Core/About/about_Remote_Troubleshooting.md). ```yaml Type: System.String[] @@ -190,7 +192,7 @@ Accept wildcard characters: False ### -Credential Specifies a user account that has permission to perform this action. The default is the current -user. Type a user name, such as User01, Domain01\User01, or User@Domain.com, or enter a +user. Type a user name, such as `User01`, `Domain01\User01`, or `User@Domain.com`, or enter a **PSCredential** object, such as one returned by the `Get-Credential` cmdlet. When you type a user name, this cmdlet prompts you for a password. @@ -215,8 +217,8 @@ you can run a command in the session that copies XML files from a remote compute computer. A loopback session is a **PSSession** that originates and ends on the same computer. To create a -loopback session, do not specify the **ComputerName** parameter or set its value to dot, localhost, -or the name of the local computer. +loopback session, do not specify the **ComputerName** parameter or set its value to dot (`.`), +`localhost`, or the name of the local computer. By default, loopback sessions are created that have a network token, which might not provide sufficient permission to authenticate to remote computers. @@ -270,7 +272,7 @@ Accept wildcard characters: False Specifies the network port on the remote computer that is used for this connection. To connect to a remote computer, the remote computer must be listening on the port that the connection uses. The -default ports are 5985 (WinRM port for HTTP) and 5986 (WinRM port for HTTPS). +default ports are `5985` (WinRM port for HTTP) and `5986` (WinRM port for HTTPS). Before using another port, you must configure the WinRM listener on the remote computer to listen at that port. Use the following commands to configure the listener: @@ -307,10 +309,12 @@ configuration. The session option values take precedence over default values for sessions set in the `$PSSessionOption` preference variable and in the session configuration. However, they do not take precedence over maximum values, quotas or limits set in the session configuration. For more -information about session configurations, see [about_Session_Configurations](../Microsoft.PowerShell.Core/About/about_Session_Configurations.md). +information about session configurations, see +[about_Session_Configurations](../Microsoft.PowerShell.Core/About/about_Session_Configurations.md). For a description of the session options, including the default values, see `New-PSSessionOption`. -For information about the `$PSSessionOption` preference variable, see [about_Preference_Variables](../Microsoft.PowerShell.Core/About/about_Preference_Variables.md). +For information about the `$PSSessionOption` preference variable, see +[about_Preference_Variables](../Microsoft.PowerShell.Core/About/about_Preference_Variables.md). ```yaml Type: System.Management.Automation.Remoting.PSSessionOption @@ -327,8 +331,8 @@ Accept wildcard characters: False ### -ThrottleLimit Specifies the maximum number of concurrent connections that can be established to run this command. -If you omit this parameter or enter a value of 0 (zero), the default value for the -**Microsoft.PowerShellWorkflow** session configuration, 100, is used. +If you omit this parameter or enter a value of `0` (zero), the default value for the +**Microsoft.PowerShellWorkflow** session configuration, `100`, is used. The throttle limit applies only to the current command, not to the session or to the computer. @@ -372,7 +376,8 @@ Accept wildcard characters: False This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, --WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/7.0/CimCmdlets/Remove-CimInstance.md b/reference/7.0/CimCmdlets/Remove-CimInstance.md index 40d3b9d3b88c..1e570e5f4c51 100644 --- a/reference/7.0/CimCmdlets/Remove-CimInstance.md +++ b/reference/7.0/CimCmdlets/Remove-CimInstance.md @@ -2,7 +2,7 @@ external help file: Microsoft.Management.Infrastructure.CimCmdlets.dll-Help.xml Locale: en-US Module Name: CimCmdlets -ms.date: 06/21/2021 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/cimcmdlets/remove-ciminstance?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 title: Remove-CimInstance @@ -153,7 +153,7 @@ Accept wildcard characters: False ### -Namespace -Specifies the namespace for the CIM operation. The default namespace is **root/cimv2**. You can use +Specifies the namespace for the CIM operation. The default namespace is `root/cimv2`. You can use tab completion to browse the list of namespaces, because PowerShell gets a list of namespaces from the local WMI server to provide the list of namespaces. @@ -172,7 +172,7 @@ Accept wildcard characters: False ### -OperationTimeoutSec Specifies the amount of time that the cmdlet waits for a response from the computer. By default, the -value of this parameter is 0, which means that the cmdlet uses the default timeout value for the +value of this parameter is `0`, which means that the cmdlet uses the default timeout value for the server. If the **OperationTimeoutSec** parameter is set to a value less than the robust connection retry @@ -199,7 +199,7 @@ Specifies a query to run on the CIM server. You can specify the query dialect us If the value specified contains double quotes (`"`), single quotes (`'`), or a backslash (`\`), you must escape those characters by prefixing them with the backslash (`\`) character. If the value -specified uses the WQL LIKE operator, then you must escape the following characters by enclosing +specified uses the WQL `LIKE` operator, then you must escape the following characters by enclosing them in square brackets (`[]`): percent (`%`), underscore (`_`), or opening square bracket (`[`). ```yaml @@ -217,7 +217,7 @@ Accept wildcard characters: False ### -QueryDialect Specifies the query language used for the Query parameter. The acceptable values for this parameter -are: **WQL** or **CQL**. The default value is **WQL**. +are: `WQL` or `CQL`. The default value is `WQL`. ```yaml Type: System.String @@ -247,7 +247,8 @@ By default, if you do not specify this parameter, the DMTF standard resource URI ResourceURI can only be used with CIM sessions created using the WSMan protocol, or when specifying the ComputerName parameter, which creates a CIM session using WSMan. If you specify this parameter without specifying the ComputerName parameter, or if you specify a CIM session created using DCOM -protocol, you get an error, because the DCOM protocol does not support the ResourceURI parameter. +protocol, you get an error, because the DCOM protocol does not support the **ResourceURI** +parameter. If both the **ResourceUri** parameter and the **Filter** parameter are specified, the **Filter** parameter is ignored. diff --git a/reference/7.0/Microsoft.PowerShell.Diagnostics/Get-Counter.md b/reference/7.0/Microsoft.PowerShell.Diagnostics/Get-Counter.md index a57d1683ca3b..9c4a084cc417 100644 --- a/reference/7.0/Microsoft.PowerShell.Diagnostics/Get-Counter.md +++ b/reference/7.0/Microsoft.PowerShell.Diagnostics/Get-Counter.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Diagnostics.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Diagnostics -ms.date: 06/21/2021 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.diagnostics/get-counter?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-Counter @@ -417,7 +417,7 @@ Path InstanceName CookedValue `Get-Counter` uses the **Counter** parameter to specify the counter `\Processor(*)\% Processor Time`. The values are stored in the `$Counter` variable. The objects stored in `$Counter.CounterSamples` are sent down the pipeline. `Where-Object` uses a script block -to compare each objects value against a specified value of 20. The `$_.CookedValue` is a variable +to compare each objects value against a specified value of `20`. The `$_.CookedValue` is a variable for the current object in the pipeline. Counters with a **CookedValue** that is less than 20 are displayed. @@ -609,7 +609,8 @@ Accept wildcard characters: False This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, --WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/7.0/Microsoft.PowerShell.Management/Add-Content.md b/reference/7.0/Microsoft.PowerShell.Management/Add-Content.md index 22ad80218fb1..5fdf7f561cd7 100644 --- a/reference/7.0/Microsoft.PowerShell.Management/Add-Content.md +++ b/reference/7.0/Microsoft.PowerShell.Management/Add-Content.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 11/03/2021 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/add-content?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 title: Add-Content @@ -146,7 +146,7 @@ Mode LastWriteTime Length Name `IsReadOnlyTextFile.txt` in the current directory. - The `Set-ItemProperty` cmdlet uses the **Name** and **Value** parameters to change the file's **IsReadOnly** property to True. -- The `Get-ChildItem` cmdlet shows the file is empty (0) and has the read-only attribute (`r`). +- The `Get-ChildItem` cmdlet shows the file is empty (`0`) and has the read-only attribute (`r`). - The `Add-Content` cmdlet uses the **Path** parameter to specify the file. The **Value** parameter includes the text string to append to the file. The **Force** parameter writes the text to the read-only file. diff --git a/reference/7.0/Microsoft.PowerShell.Management/Get-PSDrive.md b/reference/7.0/Microsoft.PowerShell.Management/Get-PSDrive.md index 4cf855617815..c961bd55d0a2 100644 --- a/reference/7.0/Microsoft.PowerShell.Management/Get-PSDrive.md +++ b/reference/7.0/Microsoft.PowerShell.Management/Get-PSDrive.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 05/14/2019 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/get-psdrive?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-PSDrive @@ -213,7 +213,7 @@ Accept wildcard characters: False ### -Name Specifies, as a string array, the name or name of drives that this cmdlet gets in the operation. -Type the drive name or letter without a colon (:). +Type the drive name or letter without a colon (`:`). ```yaml Type: System.String[] diff --git a/reference/7.0/Microsoft.PowerShell.Management/Get-PSProvider.md b/reference/7.0/Microsoft.PowerShell.Management/Get-PSProvider.md index 55b274cf8d41..7d653c2eb189 100644 --- a/reference/7.0/Microsoft.PowerShell.Management/Get-PSProvider.md +++ b/reference/7.0/Microsoft.PowerShell.Management/Get-PSProvider.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 05/26/2021 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/get-psprovider?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-PSProvider @@ -108,7 +108,7 @@ PS C:\> (get-psprovider FileSystem).home C:\Users\User01 ``` -This example shows that the tilde symbol (~) represents the value of the **Home** property of the +This example shows that the tilde symbol (`~`) represents the value of the **Home** property of the FileSystem provider. The **Home** property value is optional, but for the **FileSystem** provider, it is defined as `$env:homedrive\$env:homepath` or `$home`. diff --git a/reference/7.0/Microsoft.PowerShell.Management/Get-Process.md b/reference/7.0/Microsoft.PowerShell.Management/Get-Process.md index 5986b4dc2634..68c88ee06012 100644 --- a/reference/7.0/Microsoft.PowerShell.Management/Get-Process.md +++ b/reference/7.0/Microsoft.PowerShell.Management/Get-Process.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 06/09/2017 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/get-process?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-Process @@ -82,8 +82,8 @@ Get-Process winword, explorer | Format-List * This command gets all available data about the Winword and Explorer processes on the computer. It uses the **Name** parameter to specify the processes, but it omits the optional parameter name. The -pipeline operator `|` passes the data to the `Format-List` cmdlet, which displays all available -properties `*` of the Winword and Explorer process objects. +pipeline operator (`|`) passes the data to the `Format-List` cmdlet, which displays all available +properties (`*`) of the Winword and Explorer process objects. You can also identify the processes by their process IDs. For instance, `Get-Process -Id 664, 2060`. @@ -94,7 +94,7 @@ Get-Process | Where-Object {$_.WorkingSet -gt 20000000} ``` This command gets all processes that have a working set greater than 20 MB. It uses the -`Get-Process` cmdlet to get all running processes. The pipeline operator `|` passes the process +`Get-Process` cmdlet to get all running processes. The pipeline operator (`|`) passes the process objects to the `Where-Object` cmdlet, which selects only the object with a value greater than 20,000,000 bytes for the **WorkingSet** property. @@ -156,10 +156,10 @@ ProductVersion FileVersion FileName ``` This command uses the **FileVersionInfo** parameter to get the version information for the -pwsh.exe file that is the main module for the PowerShell process. +`pwsh.exe` file that is the main module for the PowerShell process. To run this command with processes that you do not own on Windows Vista and later versions of -Windows, you must open PowerShell with the Run as administrator option. +Windows, you must open PowerShell with the **Run as administrator** option. ### Example 7: Get modules loaded with the specified process @@ -168,10 +168,10 @@ Get-Process SQL* -Module ``` This command uses the **Module** parameter to get the modules that have been loaded by the process. -This command gets the modules for the processes that have names that begin with SQL. +This command gets the modules for the processes that have names that begin with `SQL`. To run this command on Windows Vista and later versions of Windows with processes that you do not -own, you must start PowerShell with the Run as administrator option. +own, you must start PowerShell with the **Run as administrator** option. ### Example 8: Find the owner of a process @@ -186,8 +186,9 @@ Handles WS(K) CPU(s) Id UserName ProcessName ``` This command shows how to find the owner of a process. -On Windows, the **IncludeUserName** parameter requires elevated user rights (Run as Administrator). -The output reveals that the owner is Domain01\user01. +On Windows, the **IncludeUserName** parameter requires elevated user rights +(**Run as Administrator**). +The output reveals that the owner is `Domain01\user01`. ### Example 9: Use an automatic variable to identify the process hosting the current session @@ -240,8 +241,8 @@ command to the `Get-Member` cmdlet `Get-Process | Get-Member`. Indicates that this cmdlet gets the file version information for the program that runs in the process. -On Windows Vista and later versions of Windows, you must open PowerShell with the Run as -administrator option to use this parameter on processes that you do not own. +On Windows Vista and later versions of Windows, you must open PowerShell with the **Run as +administrator** option to use this parameter on processes that you do not own. To get file version information for a process on a remote computer, use the `Invoke-Command` cmdlet. @@ -345,7 +346,7 @@ Accept wildcard characters: False ### -Name Specifies one or more processes by process name. You can type multiple process names (separated by -commas) and use wildcard characters. The parameter name ("Name") is optional. +commas) and use wildcard characters. The parameter name (`Name`) is optional. ```yaml Type: System.String[] @@ -383,26 +384,27 @@ use the **Module** parameter, without the **FileVersionInfo** parameter, it retu ## NOTES -- You can also refer to this cmdlet by its built-in aliases, ps and gps. For more information, see - [about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). +- You can also refer to this cmdlet by its built-in aliases, `ps` and `gps`. For more information, + see [about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). - On computers that are running a 64-bit version of Windows, the 64-bit version of PowerShell gets only 64-bit process modules and the 32-bit version of PowerShell gets only 32-bit process modules. - You can use the properties and methods of the Windows Management Instrumentation (WMI) - Win32_Process object in PowerShell. For information, see `Get-WmiObject` and the WMI SDK. + **Win32_Process** object in PowerShell. For information, see `Get-WmiObject` and the WMI SDK. - The default display of a process is a table that includes the following columns. For a description of all of the properties of process objects, see [Process Properties](/dotnet/api/system.diagnostics.process). - - Handles: The number of handles that the process has opened. - - NPM(K): The amount of non-paged memory that the process is using, in kilobytes. - - PM(K): The amount of pageable memory that the process is using, in kilobytes. - - WS(K): The size of the working set of the process, in kilobytes. - The working set consists of the pages of memory that were recently referenced by the process. - - VM(M): The amount of virtual memory that the process is using, in megabytes. - Virtual memory includes storage in the paging files on disk. - - CPU(s): The amount of processor time that the process has used on all processors, in seconds. - - ID: The process ID (PID) of the process. - - ProcessName: The name of the process. For explanations of the concepts related to processes, see - the Glossary in Help and Support Center and the Help for Task Manager. + - **Handles**: The number of handles that the process has opened. + - **NPM(K)**: The amount of non-paged memory that the process is using, in kilobytes. + - **PM(K)**: The amount of pageable memory that the process is using, in kilobytes. + - **WS(K)**: The size of the working set of the process, in kilobytes. The working set consists of + the pages of memory that were recently referenced by the process. + - **VM(M)**: The amount of virtual memory that the process is using, in megabytes. Virtual memory + includes storage in the paging files on disk. + - **CPU(s)**: The amount of processor time that the process has used on all processors, in + seconds. + - **ID**: The process ID (PID) of the process. + - **ProcessName**: The name of the process. For explanations of the concepts related to processes, + see the Glossary in Help and Support Center and the Help for Task Manager. - You can also use the built-in alternate views of the processes available with `Format-Table`, such as **StartTime** and **Priority**, and you can design your own views. diff --git a/reference/7.0/Microsoft.PowerShell.Management/Get-Service.md b/reference/7.0/Microsoft.PowerShell.Management/Get-Service.md index e37fbe2e6315..1047a2c5f470 100644 --- a/reference/7.0/Microsoft.PowerShell.Management/Get-Service.md +++ b/reference/7.0/Microsoft.PowerShell.Management/Get-Service.md @@ -2,12 +2,11 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 09/30/2021 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/get-service?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-Service --- - # Get-Service ## SYNOPSIS @@ -61,7 +60,7 @@ Get-Service ### Example 2: Get services that begin with a search string -This example retrieves services with service names that begin with WMI (Windows Management +This example retrieves services with service names that begin with `WMI` (Windows Management Instrumentation). ```powershell @@ -70,8 +69,8 @@ Get-Service "wmi*" ### Example 3: Display services that include a search string -This example displays services with a display name that includes the word network. Searching the -display name finds network-related services even when the service name doesn't include Net, such as +This example displays services with a display name that includes the word `network`. Searching the +display name finds network-related services even when the service name doesn't include `Net`, such as xmlprov, the Network Provisioning Service. ```powershell @@ -80,7 +79,7 @@ Get-Service -Displayname "*network*" ### Example 4: Get services that begin with a search string and an exclusion -This example only gets the services with service names that begin with **win**, except for the WinRM +This example only gets the services with service names that begin with `win`, except for the WinRM service. ```powershell @@ -89,14 +88,14 @@ Get-Service -Name "win*" -Exclude "WinRM" ### Example 5: Display services that are currently active -This example displays only the services with a status of Running. +This example displays only the services with a status of `Running`. ```powershell Get-Service | Where-Object {$_.Status -eq "Running"} ``` `Get-Service` gets all the services on the computer and sends the objects down the pipeline. The -`Where-Object` cmdlet, selects only the services with a **Status** property that equals Running. +`Where-Object` cmdlet, selects only the services with a **Status** property that equals `Running`. Status is only one property of service objects. To see all of the properties, type `Get-Service | Get-Member`. @@ -135,9 +134,9 @@ displays the number of dependent services for each service. ### Example 7: Sort services by property value This example shows that when you sort services in ascending order by the value of their **Status** -property, stopped services appear before running services. The reason is because the value of -**Status** is an enumeration, in which Stopped has a value of 1, and Running has a value of 4. For -more information, see +property, stopped services appear before running services. This happens because the value of +**Status** is an enumeration, in which `Stopped` has a value of `1`, and `Running` has a value of +`4`. For more information, see [ServiceControllerStatus](/dotnet/api/system.serviceprocess.servicecontrollerstatus). To list running services first, use the **Descending** parameter of the `Sort-Object` cmdlet. @@ -338,12 +337,13 @@ This cmdlet can display services only when the current user has permission to se cmdlet does not display services, you might not have permission to see them. To find the service name and display name of each service on your system, type `Get-Service`. The -service names appear in the Name column, and the display names appear in the **DisplayName** column. +service names appear in the **Name** column, and the display names appear in the **DisplayName** +column. -When you sort in ascending order by the **Status** property's value, Stopped services appear before -Running services. The service's **Status** property is an enumerated value and the status names -represent integer values. The sort order is based on the integer value, not the name. Stopped -appears before because Running because Stopped has a value of 1, and Running has a value of 4. For +When you sort in ascending order by status value, `Stopped` services appear before `Running` +services. The **Status** property of a service is an enumerated value in which the names of the +statuses represent integer values. The sort is based on the integer value, not the name. `Running` +appears before `Stopped` because `Stopped` has a value of `1`, and `Running` has a value of `4`. For more information, see [ServiceControllerStatus](/dotnet/api/system.serviceprocess.servicecontrollerstatus). diff --git a/reference/7.0/Microsoft.PowerShell.Management/New-ItemProperty.md b/reference/7.0/Microsoft.PowerShell.Management/New-ItemProperty.md index 40ea3d9d9915..d53376dd06ac 100644 --- a/reference/7.0/Microsoft.PowerShell.Management/New-ItemProperty.md +++ b/reference/7.0/Microsoft.PowerShell.Management/New-ItemProperty.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 04/28/2022 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/new-itemproperty?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 title: New-ItemProperty @@ -45,10 +45,10 @@ This cmdlet does not add properties to an object. ### Example 1: Add a registry entry -This command adds a new registry entry, "NoOfEmployees", to the "MyCompany" key of the -"HKLM:\Software hive". +This command adds a new registry entry, `NoOfEmployees`, to the `MyCompany` key of the +`HKLM:\Software hive`. -The first command uses the **Path** parameter to specify the path of the "MyCompany" registry key. +The first command uses the **Path** parameter to specify the path of the `MyCompany` registry key. It uses the **Name** parameter to specify a name for the entry and the **Value** parameter to specify its value. @@ -71,25 +71,25 @@ NoOfEmployees : 822 ### Example 2: Add a registry entry to a key -This command adds a new registry entry to a registry key. -To specify the key, it uses a pipeline operator (`|`) to send an object that represents the key to -`New-ItemProperty`. +This command adds a new registry entry to a registry key. To specify the key, it uses a pipeline +operator (`|`) to send an object that represents the key to `New-ItemProperty`. -The first part of the command uses the `Get-Item` cmdlet to get the "MyCompany" registry key. -The pipeline operator sends the results of the command to `New-ItemProperty`, which adds the new -registry entry ("NoOfLocations"), and its value (3), to the "MyCompany" key. +The first part of the command uses the `Get-Item` cmdlet to get the `MyCompany` registry key. The +pipeline operator sends the results of the command to `New-ItemProperty`, which adds the new +registry entry (`NoOfLocations`), and its value (`3`), to the `MyCompany` key. ```powershell Get-Item -Path "HKLM:\Software\MyCompany" | New-ItemProperty -Name NoOfLocations -Value 3 ``` This command works because the parameter-binding feature of PowerShell associates the path of the -`RegistryKey` object that `Get-Item` returns with the **LiteralPath** parameter of -`New-ItemProperty`. For more information, see [about_Pipelines](../Microsoft.PowerShell.Core/About/about_pipelines.md). +**RegistryKey** object that `Get-Item` returns with the **LiteralPath** parameter of +`New-ItemProperty`. For more information, see +[about_Pipelines](../Microsoft.PowerShell.Core/About/about_pipelines.md). ### Example 3: Create a MultiString value in the registry using a Here-String -This example creates a MultiString value using a Here-String. +This example creates a `MultiString` value using a Here-String. ```powershell $newValue = New-ItemProperty -Path "HKLM:\SOFTWARE\ContosoCompany\" -Name 'HereString' -PropertyType MultiString -Value @" @@ -121,6 +121,13 @@ a ### -Credential +Specifies a user account that has permission to perform this action. +The default is the current user. + +Type a user name, such as `User01` or `Domain01\User01`, or enter a **PSCredential** object, such as +one generated by the `Get-Credential` cmdlet. If you type a user name, you are prompted for a +password. + > [!NOTE] > This parameter is not supported by any providers installed with PowerShell. > To impersonate another user, or elevate your credentials when running this cmdlet, @@ -160,11 +167,13 @@ Accept wildcard characters: True ### -Filter -Specifies a filter to qualify the **Path** parameter. The [FileSystem](../Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md) -provider is the only installed PowerShell provider that supports the use of filters. You can find -the syntax for the **FileSystem** filter language in [about_Wildcards](../Microsoft.PowerShell.Core/About/about_Wildcards.md). -Filters are more efficient than other parameters, because the provider applies them when the cmdlet -gets the objects rather than having PowerShell filter the objects after they are retrieved. +Specifies a filter to qualify the **Path** parameter. The +[FileSystem](../Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md) provider is the only +installed PowerShell provider that supports the use of filters. You can find the syntax for the +**FileSystem** filter language in +[about_Wildcards](../Microsoft.PowerShell.Core/About/about_Wildcards.md). Filters are more efficient +than other parameters, because the provider applies them when the cmdlet gets the objects rather +than having PowerShell filter the objects after they are retrieved. ```yaml Type: System.String @@ -200,7 +209,7 @@ Accept wildcard characters: False Specifies, as a string array, an item or items that this cmdlet includes in the operation. The value of this parameter qualifies the **Path** parameter. Enter a path element or pattern, such as -`"*.txt"`. Wildcard characters are permitted. The **Include** parameter is effective only when the +`*.txt`. Wildcard characters are permitted. The **Include** parameter is effective only when the command includes the contents of an item, such as `C:\Windows\*`, where the wildcard character specifies the contents of the `C:\Windows` directory. @@ -220,10 +229,11 @@ Accept wildcard characters: True Specifies a path to one or more locations. The value of **LiteralPath** is used exactly as it is typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose -it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters -as escape sequences. +it in single quotation marks (`'`). Single quotation marks tell PowerShell not to interpret any +characters as escape sequences. -For more information, see [about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). +For more information, see +[about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). ```yaml Type: System.String[] @@ -372,7 +382,8 @@ You cannot pipe input to this cmdlet. ## NOTES `New-ItemProperty` is designed to work with the data exposed by any provider. To list the providers -available in your session, type `Get-PSProvider`. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). +available in your session, type `Get-PSProvider`. For more information, see +[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). ## RELATED LINKS diff --git a/reference/7.0/Microsoft.PowerShell.Management/Remove-PSDrive.md b/reference/7.0/Microsoft.PowerShell.Management/Remove-PSDrive.md index 3b6546eb592a..b41d195ae837 100644 --- a/reference/7.0/Microsoft.PowerShell.Management/Remove-PSDrive.md +++ b/reference/7.0/Microsoft.PowerShell.Management/Remove-PSDrive.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 06/09/2017 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/remove-psdrive?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 title: Remove-PSDrive @@ -30,21 +30,24 @@ Remove-PSDrive [-LiteralName] <String[]> [-PSProvider <String[]>] [-Scope <Strin ## DESCRIPTION -The `Remove-PSDrive` cmdlet deletes temporary PowerShell drives that were created by using the `New-PSDrive` cmdlet. +The `Remove-PSDrive` cmdlet deletes temporary PowerShell drives that were created by using the +`New-PSDrive` cmdlet. -Beginning in Windows PowerShell 3.0, `Remove-PSDrive` also disconnects mapped network drives, including, but not limited to, drives created by using the `Persist` parameter of `New-PSDrive`. +Beginning in Windows PowerShell 3.0, `Remove-PSDrive` also disconnects mapped network drives, +including, but not limited to, drives created by using the **Persist** parameter of `New-PSDrive`. `Remove-PSDrive` cannot delete Windows physical or logical drives. -Beginning in Windows PowerShell 3.0, when an external drive is connected to the computer, PowerShell automatically adds a PSDrive to the file system that represents the new drive. -You do not need to restart PowerShell. -Similarly, when an external drive is disconnected from the computer, PowerShell automatically deletes the PSDrive that represents the removed drive. +Beginning in Windows PowerShell 3.0, when an external drive is connected to the computer, PowerShell +automatically adds a PSDrive to the file system that represents the new drive. You do not need to +restart PowerShell. Similarly, when an external drive is disconnected from the computer, PowerShell +automatically deletes the PSDrive that represents the removed drive. ## EXAMPLES ### Example 1: Remove a file system drive -This command removes a temporary file system drive named "smp". +This command removes a temporary file system drive named `smp`. ```powershell Remove-PSDrive -Name smp @@ -52,7 +55,7 @@ Remove-PSDrive -Name smp ### Example 2: Remove mapped network drives -This command uses `Remove-PSDrive` to disconnect the X: and S: mapped network drives. +This command uses `Remove-PSDrive` to disconnect the `X:` and `S:` mapped network drives. ```powershell Get-PSDrive X, S | Remove-PSDrive @@ -80,10 +83,9 @@ Accept wildcard characters: False Specifies the name of the drive. -The value of **LiteralName** is used exactly as typed. -No characters are interpreted as wildcards. -If the name includes escape characters, enclose it in single quotation marks ('). -Single quotation marks instruct PowerShell not to interpret any characters as escape sequences. +The value of **LiteralName** is used exactly as typed. No characters are interpreted as wildcards. +If the name includes escape characters, enclose it in single quotation marks (`'`). Single quotation +marks instruct PowerShell not to interpret any characters as escape sequences. ```yaml Type: System.String[] @@ -99,8 +101,7 @@ Accept wildcard characters: False ### -Name -Specifies the names of the drives to remove. -Do not type a colon (:) after the drive name. +Specifies the names of the drives to remove. Do not type a colon (`:`) after the drive name. ```yaml Type: System.String[] @@ -116,8 +117,8 @@ Accept wildcard characters: True ### -PSProvider -Specifies an array of **PSProvider** objects. -This cmdlet removes and disconnects all of the drives associated with the specified PowerShell provider. +Specifies an array of **PSProvider** objects. This cmdlet removes and disconnects all of the drives +associated with the specified PowerShell provider. ```yaml Type: System.String[] @@ -133,9 +134,10 @@ Accept wildcard characters: False ### -Scope -Specifies a scope for the drive. -The acceptable values for this parameter are: Global, Local, and Script, or a number relative to the current scope. Scopes number 0 through the number of scopes. The current scope number is 0 and its parent is 1. -For more information, see [about_Scopes](../Microsoft.PowerShell.Core/About/about_Scopes.md). +Specifies a scope for the drive. The acceptable values for this parameter are: `Global`, `Local`, +and `Script`, or a number relative to the current scope. Scopes number `0` through the number of +scopes. The current scope number is `0` and its parent is `1`. For more information, see +[about_Scopes](../Microsoft.PowerShell.Core/About/about_Scopes.md). ```yaml Type: System.String @@ -167,8 +169,7 @@ Accept wildcard characters: False ### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. +Shows what would happen if the cmdlet runs. The cmdlet is not run. ```yaml Type: System.Management.Automation.SwitchParameter @@ -184,13 +185,17 @@ Accept wildcard characters: False ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). ## INPUTS ### System.Management.Automation.PSDriveInfo -You can pipe a drive object, such as one from the `Get-PSDrive` cmdlet, to the `Remove-PSDrive` cmdlet. +You can pipe a drive object, such as one from the `Get-PSDrive` cmdlet, to the `Remove-PSDrive` +cmdlet. ## OUTPUTS @@ -200,7 +205,9 @@ This cmdlet does not return any output. ## NOTES -- The `Remove-PSDrive` cmdlet is designed to work with the data exposed by any PowerShell provider. To list the providers in your session, use the `Get-PSProvider` cmdlet. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). +- The `Remove-PSDrive` cmdlet is designed to work with the data exposed by any PowerShell provider. + To list the providers in your session, use the `Get-PSProvider` cmdlet. For more information, see + [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). ## RELATED LINKS diff --git a/reference/7.0/Microsoft.PowerShell.Management/Resolve-Path.md b/reference/7.0/Microsoft.PowerShell.Management/Resolve-Path.md index b396ac0ea590..7e206f5a70a1 100644 --- a/reference/7.0/Microsoft.PowerShell.Management/Resolve-Path.md +++ b/reference/7.0/Microsoft.PowerShell.Management/Resolve-Path.md @@ -112,7 +112,7 @@ PS C:\> Resolve-Path -LiteralPath 'test[xml]' Specifies a user account that has permission to perform this action. The default is the current user. -Type a user name, such as User01 or Domain01\User01, or pass a **PSCredential** object. You can +Type a user name, such as `User01` or `Domain01\User01`, or pass a **PSCredential** object. You can create a **PSCredential** object using the `Get-Credential` cmdlet. If you type a user name, this cmdlet prompts you for a password. @@ -134,8 +134,8 @@ Accept wildcard characters: False Specifies the path to be resolved. The value of the **LiteralPath** parameter is used exactly as typed. No characters are interpreted as wildcard characters. If the path includes escape characters, -enclose it in single quotation marks. Single quotation marks tell PowerShell not to interpret any -characters as escape sequences. +enclose it in single quotation marks (`'`). Single quotation marks tell PowerShell not to interpret +any characters as escape sequences. ```yaml Type: System.String[] diff --git a/reference/7.0/Microsoft.PowerShell.Management/Start-Service.md b/reference/7.0/Microsoft.PowerShell.Management/Start-Service.md index ddcae2aa9e5f..e84a1125926b 100644 --- a/reference/7.0/Microsoft.PowerShell.Management/Start-Service.md +++ b/reference/7.0/Microsoft.PowerShell.Management/Start-Service.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 06/09/2017 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/start-service?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 title: Start-Service @@ -80,7 +80,7 @@ Start-Service -InputObject $s -PassThru | Format-List >> services.txt First we use `Get-Service` to get an object that represent the WMI service and store it in the `$s` variable. Next, we start the service. Without the **PassThru** parameter, `Start-Service` does not -create any output. The pipeline operator (|) passes the object output by `Start-Service` to the +create any output. The pipeline operator (`|`) passes the object output by `Start-Service` to the `Format-List` cmdlet to format the object as a list of its properties. The append redirection operator (`>>`) redirects the output to the services.txt file. The output is added to the end of the existing file. diff --git a/reference/7.0/Microsoft.PowerShell.Security/About/about_Certificate_Provider.md b/reference/7.0/Microsoft.PowerShell.Security/About/about_Certificate_Provider.md index 75c9890cf196..33967b55d713 100644 --- a/reference/7.0/Microsoft.PowerShell.Security/About/about_Certificate_Provider.md +++ b/reference/7.0/Microsoft.PowerShell.Security/About/about_Certificate_Provider.md @@ -1,7 +1,7 @@ --- description: Information about the Certificate provider. Locale: en-US -ms.date: 05/12/2022 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.security/about/about_certificate_provider?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 title: about Certificate Provider @@ -31,8 +31,8 @@ Provides access to X.509 certificate stores and certificates in PowerShell. The PowerShell **Certificate** provider lets you get, add, change, clear, and delete certificates and certificate stores in PowerShell. -The **Certificate** drive is a hierarchical namespace containing the -certificate stores and certificates on your computer. +The **Certificate** drive is a hierarchical namespace containing the certificate +stores and certificates on your computer. The **Certificate** provider supports the following cmdlets, which are covered in this article. @@ -78,9 +78,9 @@ the `Cert:` drive. Set-Location Cert: ``` -You can also work with the certificate provider from any other PowerShell -drive. To reference an alias from another location, use the `Cert:` drive name -in the path. +You can also work with the certificate provider from any other PowerShell drive. +To reference an alias from another location, use the `Cert:` drive name in the +path. ```powershell PS Cert:\> Set-Location -Path LocalMachine\Root @@ -163,8 +163,9 @@ Get-ChildItem -Path cert:\LocalMachine\My, cert:\LocalMachine\WebHosting ` ### Find expired certificates on remote computers This command uses the `Invoke-Command` cmdlet to run a `Get-ChildItem` command -on the Srv01 and Srv02 computers. A value of zero (0) in the **ExpiringInDays** -parameter gets certificates on the Srv01 and Srv02 computers that have expired. +on the Srv01 and Srv02 computers. A value of zero (`0`) in the +**ExpiringInDays** parameter gets certificates on the Srv01 and Srv02 computers +that have expired. ```powershell Invoke-Command -ComputerName Srv01, Srv02 {Get-ChildItem -Path cert:\* ` @@ -194,8 +195,8 @@ Get-ChildItem -Path cert:\* -Recurse -DNSName "*fabrikam*" ` ## Opening the Certificates MMC Snap-in -The `Invoke-Item` cmdlet will use the default application to open a path -you specify. For certificates, the default application is the Certificates MMC +The `Invoke-Item` cmdlet will use the default application to open a path you +specify. For certificates, the default application is the Certificates MMC snap-in. This command opens the Certificates MMC snap-in to manage the specified @@ -207,8 +208,8 @@ Invoke-Item cert:\CurrentUser\my\6B8223358119BB08840DEE50FD8AF9EA776CE66B ## Copying Certificates -Copying certificates is not supported by the **Certificate** provider. When -you attempt to copy a certificate, you see this error. +Copying certificates is not supported by the **Certificate** provider. When you +attempt to copy a certificate, you see this error. ``` $path = "Cert:\LocalMachine\Root\E2C0F6662D3C569705B4B31FE2CBF3434094B254" @@ -240,8 +241,8 @@ This command uses the **SSLServerAuthentication** parameter of the `Get-ChildItem` cmdlet to get SSL server authentication certificates in the `My` certificate store. -The returned certificates are piped to the `Move-Item` cmdlet, which moves -the certificates to the `WebHosting` store. +The returned certificates are piped to the `Move-Item` cmdlet, which moves the +certificates to the `WebHosting` store. ```powershell Get-ChildItem cert:\LocalMachine\My -SSLServerAuthentication | Move-Item ` @@ -251,12 +252,12 @@ Get-ChildItem cert:\LocalMachine\My -SSLServerAuthentication | Move-Item ` ## Deleting Certificates and Private Keys The `Remove-Item` cmdlet will remove certificates that you specify. The -`-DeleteKey` dynamic parameter deletes the private key. +**DeleteKey** dynamic parameter deletes the private key. ### Delete a Certificate from the CA store -This command deletes a certificate from the CA certificate store, but leaves -the associated private key intact. +This command deletes a certificate from the CA certificate store, but leaves the +associated private key intact. In the `Cert:` drive, the `Remove-Item` cmdlet supports only the **DeleteKey**, **Path**, **WhatIf**, and **Confirm** parameters. All other parameters are @@ -329,9 +330,9 @@ This command uses the **ExpiringInDays** parameter of the `Get-ChildItem` cmdlet with a value of `0` to get certificates in the `WebHosting` store that have expired. -The variable containing the returned certificates is piped to the -`Remove-Item` cmdlet, which deletes them. The command uses the **DeleteKey** -parameter to delete the private key along with the certificate. +The variable containing the returned certificates is piped to the `Remove-Item` +cmdlet, which deletes them. The command uses the **DeleteKey** parameter to +delete the private key along with the certificate. ```powershell $expired = Get-ChildItem cert:\LocalMachine\WebHosting -ExpiringInDays 0 @@ -349,8 +350,8 @@ cmdlet to create a certificate for testing purposes. In the `Cert:` drive, the `New-Item` cmdlet creates certificate stores in the `LocalMachine` store location. It supports the **Name**, **Path**, **WhatIf**, and **Confirm** parameters. All other parameters are ignored. The command -returns a **System.Security.Cryptography.X509Certificates.X509Store** -that represents the new certificate store. +returns a **System.Security.Cryptography.X509Certificates.X509Store** that +represents the new certificate store. This command creates a new certificate store named `CustomStore` in the `LocalMachine` store location. @@ -366,8 +367,8 @@ This command creates a new certificate store named `HostingStore` in the The command uses the `Invoke-Command` cmdlet to run a `New-Item` command on the Server01 computer. The command returns a -**System.Security.Cryptography.X509Certificates.X509Store** that represents -the new certificate store. +**System.Security.Cryptography.X509Certificates.X509Store** that represents the +new certificate store. ```powershell Invoke-Command { New-Item -Path cert:\LocalMachine\CustomStore } ` @@ -405,10 +406,10 @@ Invoke-Command { Remove-Item -Path cert:\LocalMachine\TestStore -Recurse } ` ## Dynamic parameters -Dynamic parameters are cmdlet parameters that are added by a PowerShell -provider and are available only when the cmdlet is being used in the -provider-enabled drive. These parameters are valid in all subdirectories of the -**Certificate** provider, but are effective only on certificates. +Dynamic parameters are cmdlet parameters that are added by a PowerShell provider +and are available only when the cmdlet is being used in the provider-enabled +drive. These parameters are valid in all subdirectories of the **Certificate** +provider, but are effective only on certificates. > [!NOTE] > Parameters that perform filtering against the **EnhancedKeyUsageList** @@ -418,11 +419,11 @@ provider-enabled drive. These parameters are valid in all subdirectories of the The following Certificate provider parameters were removed in PowerShell 6.0. -- DNSName -- DocumentEncryptionCert -- EKU -- ExpiringInDays -- SSLServerAuthentication +- **DNSName** +- **DocumentEncryptionCert** +- **EKU** +- **ExpiringInDays** +- **SSLServerAuthentication** ### CodeSigningCert <System.Management.Automation.SwitchParameter> @@ -440,14 +441,15 @@ This parameter gets certificates that have `Code Signing` in their - [Remove-Item](xref:Microsoft.PowerShell.Management.Remove-Item) -This parameter deletes the associated private key when it deletes the certificate. +This parameter deletes the associated private key when it deletes the +certificate. > [!IMPORTANT] > To delete a private key that is associated with a user certificate in the > `Cert:\CurrentUser` store on a remote computer, you must use delegated -> credentials. The `Invoke-Command` cmdlet supports credential delegation -> using the **CredSSP** parameter. You should consider any security risks -> before using `Remove-Item` with `Invoke-Command` and credential delegation. +> credentials. The `Invoke-Command` cmdlet supports credential delegation using +> the **CredSSP** parameter. You should consider any security risks before using +> `Remove-Item` with `Invoke-Command` and credential delegation. This parameter was introduced in PowerShell 3.0. @@ -457,10 +459,10 @@ This parameter allows you to specify the type of item created by `New-Item`. In a `Certificate` drive, the following values are allowed: -- Certificate Provider -- Certificate -- Store -- StoreLocation +- `Certificate Provider` +- `Certificate` +- `Store` +- `StoreLocation` #### Cmdlets Supported diff --git a/reference/7.0/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md b/reference/7.0/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md index b27ef83d31ee..f8675fb9b552 100644 --- a/reference/7.0/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md +++ b/reference/7.0/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 10/22/2021 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/convertfrom-csv?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 title: ConvertFrom-Csv @@ -147,11 +147,9 @@ generate objects from the CSV strings. ### -Delimiter -Specifies the delimiter that separates the property values in the CSV strings. -The default is a comma (,). - -Enter a character, such as a colon (:). -To specify a semicolon (;) enclose it in single quotation marks. +Specifies the delimiter that separates the property values in the CSV strings. The default is a +comma (`,`). Enter a character, such as a colon (`:`). To specify a semicolon (`;`) enclose it in +single quotation marks. If you specify a character other than the actual string delimiter in the file, `ConvertFrom-Csv` cannot create the objects from the CSV strings and will return the CSV strings. diff --git a/reference/7.0/Microsoft.PowerShell.Utility/ConvertTo-Html.md b/reference/7.0/Microsoft.PowerShell.Utility/ConvertTo-Html.md index 9bd17435822e..4c44f348f46d 100644 --- a/reference/7.0/Microsoft.PowerShell.Utility/ConvertTo-Html.md +++ b/reference/7.0/Microsoft.PowerShell.Utility/ConvertTo-Html.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 08/10/2020 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/convertto-html?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 title: ConvertTo-Html @@ -72,7 +72,7 @@ the `Out-File` cmdlet to send the HTML code to the `aliases.htm` file. ### Example 3: Create a web page to display PowerShell events ```powershell -`Get-EventLog` -LogName "Windows PowerShell" | ConvertTo-Html | Out-File pslog.htm +Get-EventLog -LogName "Windows PowerShell" | ConvertTo-Html | Out-File pslog.htm ``` This command creates an HTML page called `pslog.htm` that displays the events in the Windows @@ -103,7 +103,7 @@ on the computer. The command uses the pipeline operator (`|`) to send the proces The command uses the **Property** parameter to select three properties of the process objects to be included in the table. The command uses the **Title** parameter to specify a title for the HTML page. The command also uses the `Out-File` cmdlet to send the resulting HTML to a file named -Proc.htm. +`Proc.htm`. The second command uses the `Invoke-Item` cmdlet to open the `Proc.htm` in the default browser. @@ -157,7 +157,7 @@ Get-Date | ConvertTo-Html -Fragment ``` This command uses `ConvertTo-Html` to generate an HTML table of the current date. The command uses -the `Get-Date` cmdlet to get the current date. It uses a pipeline operator (|) to send the results +the `Get-Date` cmdlet to get the current date. It uses a pipeline operator (`|`) to send the results to the `ConvertTo-Html` cmdlet. The `ConvertTo-Html` command includes the **Fragment** parameter, which limits the output to an HTML @@ -194,12 +194,13 @@ Invoke-Item Services.htm ``` This command creates and opens a Web page that displays the services on the computer that begin with -A. It uses the **Title**, **Body**, **PreContent**, and **PostContent** parameters of +`A`. It uses the **Title**, **Body**, **PreContent**, and **PostContent** parameters of `ConvertTo-Html` to customize the output. The first part of the command uses the `Get-Service` cmdlet to get the services on the computer that -begin with A. The command uses a pipeline operator (`|`) to send the results to the `ConvertTo-Html` -cmdlet. The command also uses the `Out-File` cmdlet to send the output to the Services.htm file. +begin with `A`. The command uses a pipeline operator (`|`) to send the results to the +`ConvertTo-Html` cmdlet. The command also uses the `Out-File` cmdlet to send the output to the +`Services.htm` file. A semicolon (`;`) ends the first command and starts a second command, which uses the `Invoke-Item` cmdlet to open the `Services.htm` file in the default browser. @@ -223,7 +224,7 @@ The charset for the page is set to UTF-8 Get-Service | ConvertTo-HTML -Transitional ``` -This command sets the DOCTYPE of the returned HTML to XHTML Transitional DTD +This command sets the `DOCTYPE` of the returned HTML to **XHTML Transitional DTD** ## PARAMETERS @@ -307,7 +308,7 @@ Accept wildcard characters: False ### -Fragment -Generates only an HTML table. The HTML, HEAD, TITLE, and BODY tags are omitted. +Generates only an HTML table. The `<HTML>`, `<HEAD>`, `<TITLE>`, and `<BODY>` tags are omitted. ```yaml Type: System.Management.Automation.SwitchParameter @@ -418,11 +419,11 @@ Includes the specified properties of the objects in the HTML. The value of the * parameter can be a new calculated property. The calculated property can be a script block or a hash table. Valid key-value pairs are: -- Name (or label) - `<string>` (added in PowerShell 6.x) -- Expression - `<string>` or `<script block>` -- FormatString - `<string>` -- Width - `<int32>` - must be greater than `0` -- Alignment - value can be `Left`, `Center`, or `Right` +- `Name` (or label) - `<string>` (added in PowerShell 6.x) +- `Expression` - `<string>` or `<script block>` +- `FormatString` - `<string>` +- `Width` - `<int32>` - must be greater than `0` +- `Alignment` - value can be `Left`, `Center`, or `Right` For more information, see [about_Calculated_Properties](../Microsoft.PowerShell.Core/About/about_Calculated_Properties.md). @@ -457,7 +458,7 @@ Accept wildcard characters: False ### -Transitional -Changes the **DOCTYPE** to **XHTML Transitional DTD**, Default **DOCTYPE** is **XHTML Strict DTD**. +Changes the `DOCTYPE` to **XHTML Transitional DTD**, Default `DOCTYPE` is **XHTML Strict DTD**. This parameter was introduced in PowerShell 6.0. @@ -509,7 +510,7 @@ quite different. submit the processes on a computer to `ConvertTo-Html`, the resulting table displays an object array and its properties. - To comply with the XHTML Strict DTD, the DOCTYPE tag is modified accordingly: + To comply with the XHTML Strict DTD, the `DOCTYPE` tag is modified accordingly: `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"\>` diff --git a/reference/7.0/Microsoft.PowerShell.Utility/Export-Csv.md b/reference/7.0/Microsoft.PowerShell.Utility/Export-Csv.md index 4b3029236f77..75d45eb06c23 100644 --- a/reference/7.0/Microsoft.PowerShell.Utility/Export-Csv.md +++ b/reference/7.0/Microsoft.PowerShell.Utility/Export-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 10/22/2021 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/export-csv?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 title: Export-Csv @@ -91,9 +91,9 @@ Get-Content -Path .\Processes.csv "ApplicationFrameHost","4","511","2203597099008","35364864","21979136","30048", ... ``` -The `Get-Process` cmdlet gets **Process** objects. The process objects are sent down the pipeline -to the `Export-Csv` cmdlet. `Export-Csv` converts the process objects to a series of CSV strings. -The **Path** parameter specifies that the Processes.csv file is saved in the current directory. The +The `Get-Process` cmdlet gets **Process** objects. The process objects are sent down the pipeline to +the `Export-Csv` cmdlet. `Export-Csv` converts the process objects to a series of CSV strings. The +**Path** parameter specifies that the `Processes.csv` file is saved in the current directory. The **NoTypeInformation** parameter removes the **#TYPE** information header from the CSV output and is not required in PowerShell 6. The `Get-Content` cmdlet uses the **Path** parameter to display the file located in the current directory. @@ -112,9 +112,9 @@ Get-Content -Path .\Processes.csv "ApplicationFrameHost";"4";"509";"2203595321344";"34807808";"21770240";"29504"; ... ``` -The `Get-Process` cmdlet gets **Process** objects. The process objects are sent down the pipeline -to the `Export-Csv` cmdlet. `Export-Csv` converts the process objects to a series of CSV strings. -The **Path** parameter specifies that the Processes.csv file is saved in the current directory. The +The `Get-Process` cmdlet gets **Process** objects. The process objects are sent down the pipeline to +the `Export-Csv` cmdlet. `Export-Csv` converts the process objects to a series of CSV strings. The +**Path** parameter specifies that the `Processes.csv` file is saved in the current directory. The **Delimiter** parameter specifies a semicolon to separate the string values. The **NoTypeInformation** parameter removes the **#TYPE** information header from the CSV output and is not required in PowerShell 6. The `Get-Content` cmdlet uses the **Path** parameter to display the @@ -137,13 +137,13 @@ Get-Content -Path .\Processes.csv ``` The `Get-Culture` cmdlet uses the nested properties **TextInfo** and **ListSeparator** and displays -the current culture's default list separator. The `Get-Process` cmdlet gets **Process** objects. -The process objects are sent down the pipeline to the `Export-Csv` cmdlet. `Export-Csv` converts -the process objects to a series of CSV strings. The **Path** parameter specifies that the -Processes.csv file is saved in the current directory. The **UseCulture** parameter uses the current -culture's default list separator as the delimiter. The **NoTypeInformation** parameter removes the -**#TYPE** information header from the CSV output and is not required in PowerShell 6. The -`Get-Content` cmdlet uses the **Path** parameter to display the file located in the current +the current culture's default list separator. The `Get-Process` cmdlet gets **Process** objects. The +process objects are sent down the pipeline to the `Export-Csv` cmdlet. `Export-Csv` converts the +process objects to a series of CSV strings. The **Path** parameter specifies that the +`Processes.csv` file is saved in the current directory. The **UseCulture** parameter uses the +current culture's default list separator as the delimiter. The **NoTypeInformation** parameter +removes the **#TYPE** information header from the CSV output and is not required in PowerShell 6. +The `Get-Content` cmdlet uses the **Path** parameter to display the file located in the current directory. ### Example 5: Export processes with type information @@ -193,27 +193,27 @@ Get-Content -Path .\Services.Csv ``` The `Get-Service` cmdlet gets service objects. The **DisplayName** parameter returns services that -contain the word Application. The service objects are sent down the pipeline to the `Select-Object` -cmdlet. `Select-Object` uses the **Property** parameter to specify the **DisplayName** and -**Status** properties. The `$AppService` variable stores the objects. +contain the word `Application`. The service objects are sent down the pipeline to the +`Select-Object` cmdlet. `Select-Object` uses the **Property** parameter to specify the +**DisplayName** and **Status** properties. The `$AppService` variable stores the objects. The `$AppService` objects are sent down the pipeline to the `Export-Csv` cmdlet. `Export-Csv` converts the service objects to a series of CSV strings. The **Path** parameter specifies that the -Services.csv file is saved in the current directory. The **NoTypeInformation** parameter removes +`Services.csv` file is saved in the current directory. The **NoTypeInformation** parameter removes the **#TYPE** information header from the CSV output and is not required in PowerShell 6. The `Get-Content` cmdlet uses the **Path** parameter to display the file located in the current directory. The `Get-Service` and `Select-Object` cmdlets are repeated for services that contain the word -Windows. The `$WinService` variable stores the service objects. The `Export-Csv` cmdlet uses the +`Windows`. The `$WinService` variable stores the service objects. The `Export-Csv` cmdlet uses the **Append** parameter to specify that the `$WinService` objects are added to the existing -Services.csv file. The `Get-Content` cmdlet is repeated to display the updated file that includes +`Services.csv` file. The `Get-Content` cmdlet is repeated to display the updated file that includes the appended data. ### Example 7: Format cmdlet within a pipeline creates unexpected results -This example shows why it is important not to use a format cmdlet within a pipeline. When -unexpected output is received, troubleshoot the pipeline syntax. +This example shows why it is important not to use a format cmdlet within a pipeline. When unexpected +output is received, troubleshoot the pipeline syntax. ```powershell Get-Date | Select-Object -Property DateTime, Day, DayOfWeek, DayOfYear | @@ -242,12 +242,12 @@ Get-Content -Path .\FTDateTime.csv ``` The `Get-Date` cmdlet gets the **DateTime** object. The object is sent down the pipeline to the -`Select-Object` cmdlet. `Select-Object` uses the **Property** parameter to select a subset of -object properties. The object is sent down the pipeline to the `Export-Csv` cmdlet. `Export-Csv` -converts the object to a CSV format. The **Path** parameter specifies that the DateTime.csv file is -saved in the current directory. The **NoTypeInformation** parameter removes the **#TYPE** -information header from the CSV output and is not required in PowerShell 6. The `Get-Content` -cmdlet uses the **Path** parameter to display the CSV file located in the current directory. +`Select-Object` cmdlet. `Select-Object` uses the **Property** parameter to select a subset of object +properties. The object is sent down the pipeline to the `Export-Csv` cmdlet. `Export-Csv` converts +the object to a CSV format. The **Path** parameter specifies that the `DateTime.csv` file is saved +in the current directory. The **NoTypeInformation** parameter removes the **#TYPE** information +header from the CSV output and is not required in PowerShell 6. The `Get-Content` cmdlet uses the +**Path** parameter to display the CSV file located in the current directory. When the `Format-Table` cmdlet is used within the pipeline to select properties unexpected results are received. `Format-Table` sends table format objects down the pipeline to the `Export-Csv` @@ -284,14 +284,14 @@ Get-Content -Path .\ReadOnly.csv "ApplicationFrameHost";"4";"509";"2203595321344";"34807808";"21770240";"29504"; ... ``` -The `New-Item` cmdlet uses the **Path** and **ItemType** parameters to create the ReadOnly.csv file -in the current directory. The `Set-ItemProperty` cmdlet uses the **Name** and **Value** parameters -to change the file's **IsReadOnly** property to true. The `Get-Process` cmdlet gets **Process** -objects. The process objects are sent down the pipeline to the `Export-Csv` cmdlet. `Export-Csv` -converts the process objects to a series of CSV strings. The **Path** parameter specifies that the -ReadOnly.csv file is saved in the current directory. The **NoTypeInformation** parameter removes -the **#TYPE** information header from the CSV output and is not required in PowerShell 6. The -output shows that the file is not written because access is denied. +The `New-Item` cmdlet uses the **Path** and **ItemType** parameters to create the `ReadOnly.csv` +file in the current directory. The `Set-ItemProperty` cmdlet uses the **Name** and **Value** +parameters to change the file's **IsReadOnly** property to `$true`. The `Get-Process` cmdlet gets +**Process** objects. The process objects are sent down the pipeline to the `Export-Csv` cmdlet. +`Export-Csv` converts the process objects to a series of CSV strings. The **Path** parameter +specifies that the `ReadOnly.csv` file is saved in the current directory. The **NoTypeInformation** +parameter removes the **#TYPE** information header from the CSV output and is not required in +PowerShell 6. The output shows that the file is not written because access is denied. The **Force** parameter is added to the `Export-Csv` cmdlet to force the export to write to the file. The `Get-Content` cmdlet uses the **Path** parameter to display the file located in the @@ -335,7 +335,7 @@ Windows PowerShell An expression creates the **PSCustomObject** with **Name** and **Version** properties. The values are stored in the `$Content` variable. The `$Content` variable is sent down the pipeline to the -`Export-Csv` cmdlet. `Export-Csv` uses the **Path** parameter and saves the ParmFile.csv file in +`Export-Csv` cmdlet. `Export-Csv` uses the **Path** parameter and saves the `ParmFile.csv` file in the current directory. The **NoTypeInformation** parameter removes the **#TYPE** information header from the CSV output and is not required in PowerShell 6. @@ -509,8 +509,8 @@ Accept wildcard characters: False Specifies the path to the CSV output file. Unlike **Path**, the value of the **LiteralPath** parameter is used exactly as it is typed. No characters are interpreted as wildcards. If the path -includes escape characters, use single quotation marks. Single quotation marks tell -PowerShell not to interpret any characters as escape sequences. +includes escape characters, use single quotation marks (`'`). Single quotation marks tell PowerShell +not to interpret any characters as escape sequences. ```yaml Type: System.String @@ -612,9 +612,9 @@ Accept wildcard characters: False Specifies when quotes are used in the CSV files. Possible values are: -- Never - don't quote anything -- Always - quote everything (default behavior) -- AsNeeded - only quote fields that contain a delimiter character +- `Never` - don't quote anything +- `Always` - quote everything (default behavior) +- `AsNeeded` - only quote fields that contain a delimiter character This parameter was added in PowerShell 7.0. @@ -680,7 +680,7 @@ You can pipe any object with an Extended Type System (ETS) adapter to `Export-CS ### System.String -The CSV list is sent to the file designated in the Path parameter. +The CSV list is sent to the file designated in the **Path** parameter. ## NOTES diff --git a/reference/7.0/Microsoft.PowerShell.Utility/Format-List.md b/reference/7.0/Microsoft.PowerShell.Utility/Format-List.md index 000f419e4ae0..ab6bb6918458 100644 --- a/reference/7.0/Microsoft.PowerShell.Utility/Format-List.md +++ b/reference/7.0/Microsoft.PowerShell.Utility/Format-List.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 12/19/2018 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/format-list?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 title: Format-List @@ -23,7 +23,7 @@ Format-List [[-Property] <Object[]>] [-GroupBy <Object>] [-View <string>] [-Show The `Format-List` cmdlet formats the output of a command as a list of properties in which each property is displayed on a separate line. You can use `Format-List` to format and display all or -selected properties of an object as a list (format-list *). +selected properties of an object as a list (`Format-List -Property *`). Because more space is available for each item in a list than in a table, PowerShell displays more properties of the object in the list, and the property values are less likely to be truncated. @@ -38,7 +38,7 @@ Get-Service | Format-List This command formats information about services on the computer as a list. By default, the services are formatted as a table. The `Get-Service` cmdlet gets objects representing the services on the -computer. The pipeline operator (|) passes the results through the pipeline to `Format-List`. +computer. The pipeline operator (`|`) passes the results through the pipeline to `Format-List`. Then, the `Format-List` command formats the service information in a list and sends it to the default output cmdlet for display. @@ -62,12 +62,12 @@ the formatted output to the default output cmdlet for display. This command displays the name, base priority, and priority class of each process on the computer. ```powershell -Get-Process | Format-List -Property name, basepriority, priorityclass +Get-Process | Format-List -Property Name, BasePriority, PriorityClass ``` It uses the `Get-Process` cmdlet to get an object representing each process. The pipeline operator -(|) passes the process objects through the pipeline to `Format-List`. `Format-List` formats the -processes as a list of the specified properties. The *Property* parameter name is optional, so you +(`|`) passes the process objects through the pipeline to `Format-List`. `Format-List` formats the +processes as a list of the specified properties. The **Property** parameter name is optional, so you can omit it. ### Example 4: Format all properties for a process @@ -79,9 +79,9 @@ Get-Process winlogon | Format-List -Property * ``` It uses the Get-Process cmdlet to get an object representing the Winlogon process. The pipeline -operator (|) passes the Winlogon process object through the pipeline to `Format-List`. The command -uses the *Property* parameter to specify the properties and the \* to indicate all properties. -Because the name of the *Property* parameter is optional, you can omit it and type the command as +operator (`|`) passes the Winlogon process object through the pipeline to `Format-List`. The command +uses the **Property** parameter to specify the properties and the `*` to indicate all properties. +Because the name of the **Property** parameter is optional, you can omit it and type the command as `Format-List *`. `Format-List` automatically sends the results to the default output cmdlet for display. @@ -129,12 +129,12 @@ Accept wildcard characters: False ### -Expand Specifies the formatted collection object, as well as the objects in the collection. This parameter -is designed to format objects that support the ICollection (System.Collections) interface. The -default value is EnumOnly. The acceptable values for this parameter are: +is designed to format objects that support the **System.Collections.ICollection** interface. The +default value is `EnumOnly`. The acceptable values for this parameter are: -- EnumOnly. Displays the properties of the objects in the collection. -- CoreOnly. Displays the properties of the collection object. -- Both. Displays the properties of the collection object and the properties of objects in the +- `EnumOnly`. Displays the properties of the objects in the collection. +- `CoreOnly`. Displays the properties of the collection object. +- `Both`. Displays the properties of the collection object and the properties of objects in the collection. ```yaml @@ -176,9 +176,9 @@ property of the output. The value of the **GroupBy** parameter can be a new calculated property. The calculated property can be a script block or a hash table. Valid key-value pairs are: -- Name (or Label) - `<string>` -- Expression - `<string>` or `<script block>` -- FormatString - `<string>` +- `Name` (or `Label`) - `<string>` +- `Expression` - `<string>` or `<script block>` +- `FormatString` - `<string>` For more information, see [about_Calculated_Properties](../Microsoft.PowerShell.Core/About/about_Calculated_Properties.md). @@ -218,15 +218,15 @@ Specifies the object properties that appear in the display and the order in whic Wildcards are permitted. If you omit this parameter, the properties that appear in the display depend on the object being -displayed. The parameter name "Property" is optional. You cannot use the **Property** and **View** +displayed. The parameter name **Property** is optional. You cannot use the **Property** and **View** parameters in the same command. The value of the **Property** parameter can be a new calculated property. The calculated property can be a script block or a hash table. Valid key-value pairs are: -- Name (or Label) - `<string>` -- Expression - `<string>` or `<script block>` -- FormatString - `<string>` +- `Name` (or `Label`) - `<string>` +- `Expression` - `<string>` or `<script block>` +- `FormatString` - `<string>` For more information, see [about_Calculated_Properties](../Microsoft.PowerShell.Core/About/about_Calculated_Properties.md). @@ -299,17 +299,17 @@ You can pipe any object to `Format-List`. ## NOTES -You can also refer to Format-List by its built-in alias, FL. For more information, see +You can also refer to `Format-List` by its built-in alias, `fl`. For more information, see [about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). The format cmdlets, such as `Format-List`, arrange the data to be displayed but do not display it. -The data is displayed by the output features of PowerShell and by the cmdlets that contain the Out -verb (the Out cmdlets), such as `Out-Host` or `Out-File`. +The data is displayed by the output features of PowerShell and by the cmdlets that contain the `Out` +verb (the `Out` cmdlets), such as `Out-Host` or `Out-File`. If you do not use a format cmdlet, PowerShell applies that default format for each object that it displays. -The **GroupBy** parameter assumes that the objects are sorted. Use Sort-Object before using +The **GroupBy** parameter assumes that the objects are sorted. Use `Sort-Object` before using `Format-List` to group the objects. The **View** parameter lets you specify an alternate format for the table. You can use the views diff --git a/reference/7.0/Microsoft.PowerShell.Utility/Format-Wide.md b/reference/7.0/Microsoft.PowerShell.Utility/Format-Wide.md index 9ede23a21433..10b061b60495 100644 --- a/reference/7.0/Microsoft.PowerShell.Utility/Format-Wide.md +++ b/reference/7.0/Microsoft.PowerShell.Utility/Format-Wide.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 08/10/2020 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/format-wide?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 title: Format-Wide @@ -36,23 +36,23 @@ screen. Get-ChildItem | Format-Wide -Column 3 ``` -The Get-ChildItem cmdlet gets objects representing each file in the directory. The pipeline -operator (|) passes the file objects through the pipeline to `Format-Wide`, which formats them for +The `Get-ChildItem` cmdlet gets objects representing each file in the directory. The pipeline +operator (`|`) passes the file objects through the pipeline to `Format-Wide`, which formats them for output. The **Column** parameter specifies the number of columns. ### Example 2: Format names of registry keys -This command displays the names of registry keys in the HKEY_CURRENT_USER\Software\Microsoft key. +This command displays the names of registry keys in the `HKEY_CURRENT_USER\Software\Microsoft` key. ```powershell Get-ChildItem HKCU:\software\microsoft | Format-Wide -Property pschildname -AutoSize ``` -The Get-ChildItem cmdlet gets objects representing the keys. The path is specified as HKCU:, one of -the drives exposed by the PowerShell Registry provider, followed by the key path. The pipeline -operator (|) passes the registry key objects through the pipeline to `Format-Wide`, which formats -them for output. The **Property** parameter specifies the name of the property, and the -**AutoSize** parameter adjusts the columns for readability. +The `Get-ChildItem` cmdlet gets objects representing the keys. The path is specified as `HKCU:`, one +of the drives exposed by the PowerShell Registry provider, followed by the key path. The pipeline +operator (`|`) passes the registry key objects through the pipeline to `Format-Wide`, which formats +them for output. The **Property** parameter specifies the name of the property, and the **AutoSize** +parameter adjusts the columns for readability. ### Example 3: Troubleshooting format errors @@ -131,14 +131,14 @@ Accept wildcard characters: False ### -Expand Formats the collection object, as well as the objects in the collection. This parameter is designed -to format objects that support the ICollection (System.Collections) interface. The default value is -**EnumOnly**. +to format objects that support the **System.Collections.ICollection** interface. The default value +is `EnumOnly`. Valid values are: -- EnumOnly: Displays the properties of the objects in the collection. -- CoreOnly: Displays the properties of the collection object. -- Both: Displays the properties of the collection object and the properties of objects in the +- `EnumOnly`: Displays the properties of the objects in the collection. +- `CoreOnly`: Displays the properties of the collection object. +- `Both`: Displays the properties of the collection object and the properties of objects in the collection. ```yaml @@ -181,9 +181,9 @@ of the output. The value of the **GroupBy** parameter can be a new calculated property. The calculated property can be a script block or a hash table. Valid key-value pairs are: -- Name (or Label) - `<string>` -- Expression - `<string>` or `<script block>` -- FormatString - `<string>` +- `Name` (or `Label`) - `<string>` +- `Expression` - `<string>` or `<script block>` +- `FormatString` - `<string>` For more information, see [about_Calculated_Properties](../Microsoft.PowerShell.Core/About/about_Calculated_Properties.md). @@ -219,18 +219,17 @@ Accept wildcard characters: False ### -Property -Specifies the object property that appears in the display. -Wildcards are permitted. +Specifies the object property that appears in the display. Wildcards are permitted. If you omit this parameter, the properties that appear in the display depend on the object being -displayed. The parameter name "Property" is optional. You cannot use the **Property** and **View** +displayed. The parameter name **Property** is optional. You cannot use the **Property** and **View** parameters in the same command. -The value of the **Property** parameter can be a new calculated property.The calculated property can -be a script block or a hash table. Valid key-value pairs are: +The value of the **Property** parameter can be a new calculated property. The calculated property +can be a script block or a hash table. Valid key-value pairs are: -- Expression - `<string>` or `<script block>` -- FormatString - `<string>` +- `Expression` - `<string>` or `<script block>` +- `FormatString` - `<string>` For more information, see [about_Calculated_Properties](../Microsoft.PowerShell.Core/About/about_Calculated_Properties.md). @@ -303,7 +302,8 @@ You can pipe any object to `Format-Wide`. ## NOTES -You can also refer to `Format-Wide` by its built-in alias, `fw`. For more information, see [about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). +You can also refer to `Format-Wide` by its built-in alias, `fw`. For more information, see +[about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). The **GroupBy** parameter assumes that the objects are sorted. Use `Sort-Object` before using `Format-Custom` to group the objects. @@ -314,7 +314,7 @@ in new PS1XML files and use the `Update-FormatData` cmdlet to include them in Po The alternate view for the **View** parameter must use table format; if it does not, the command fails. If the alternate view is a list, use `Format-List`. If the alternate view is neither a list -nor a table, use Format-Custom. +nor a table, use `Format-Custom`. ## RELATED LINKS diff --git a/reference/7.0/Microsoft.PowerShell.Utility/Get-Unique.md b/reference/7.0/Microsoft.PowerShell.Utility/Get-Unique.md index 47fbf5706d36..3a9529bb8c83 100644 --- a/reference/7.0/Microsoft.PowerShell.Utility/Get-Unique.md +++ b/reference/7.0/Microsoft.PowerShell.Utility/Get-Unique.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 03/12/2019 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/get-unique?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-Unique @@ -47,10 +47,10 @@ $A = $( foreach ($line in Get-Content C:\Test1\File1.txt) { $A.count ``` -The first command gets the content of the File.txt file. It converts each line of text to lowercase -letters and then splits each word onto a separate line at the space (" "). Then, it sorts the -resulting list alphabetically (the default) and uses the `Get-Unique` cmdlet to eliminate any -duplicate words. The results are stored in the `$A` variable. +The first command gets the content of the `File.txt` file. It converts each line of text to +lowercase letters and then splits each word onto a separate line at the space (`" "`). Then, it +sorts the resulting list alphabetically (the default) and uses the `Get-Unique` cmdlet to eliminate +any duplicate words. The results are stored in the `$A` variable. The second command uses the **Count** property of the collection of strings in `$A` to determine how many items are in `$A`. @@ -86,7 +86,7 @@ includes files and directories. Get-ChildItem | Sort-Object {$_.GetType()} | Get-Unique -OnType ``` -The pipeline operator (|) sends the results to the `Sort-Object` cmdlet. The `$_.GetType()` +The pipeline operator (`|`) sends the results to the `Sort-Object` cmdlet. The `$_.GetType()` statement applies the **GetType** method to each file or directory. Then, `Sort-Object` sorts the items by type. Another pipeline operator sends the results to `Get-Unique`. The **OnType** parameter directs `Get-Unique` to return only one object of each type. @@ -99,11 +99,11 @@ This command gets the names of processes running on the computer with duplicates Get-Process | Sort-Object | Select-Object processname | Get-Unique -AsString ``` -The `Get-Process` command gets all of the processes on the computer. The pipeline operator (|) +The `Get-Process` command gets all of the processes on the computer. The pipeline operator (`|`) passes the result to `Sort-Object`, which, by default, sorts the processes alphabetically by -ProcessName. The results are piped to the `Select-Object` cmdlet, which selects only the values of -the ProcessName property of each object. The results are then piped to `Get-Unique` to eliminate -duplicates. +**ProcessName**. The results are piped to the `Select-Object` cmdlet, which selects only the values +of the **ProcessName** property of each object. The results are then piped to `Get-Unique` to +eliminate duplicates. The **AsString** parameter tells `Get-Unique` to treat the **ProcessName** values as strings. Without this parameter, `Get-Unique` treats the **ProcessName** values as objects and returns only @@ -187,10 +187,11 @@ The type of object that `Get-Unique` returns is determined by the input. ## NOTES -You can also refer to `Get-Unique` by its built-in alias, `gu`. For more information, see [about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). +You can also refer to `Get-Unique` by its built-in alias, `gu`. For more information, see +[about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). -To sort a list, use Sort-Object. You can also use the **Unique** parameter of `Sort-Object` to find -the unique items in a list. +To sort a list, use `Sort-Object`. You can also use the **Unique** parameter of `Sort-Object` to +find the unique items in a list. ## RELATED LINKS diff --git a/reference/7.0/Microsoft.PowerShell.Utility/Out-GridView.md b/reference/7.0/Microsoft.PowerShell.Utility/Out-GridView.md index ccb83885547f..41692eb6db9d 100644 --- a/reference/7.0/Microsoft.PowerShell.Utility/Out-GridView.md +++ b/reference/7.0/Microsoft.PowerShell.Utility/Out-GridView.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 10/28/2019 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/out-gridview?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 title: Out-GridView @@ -45,10 +45,10 @@ Nano Server. You can use the following features of the table to examine your data: -- Hide, Show, and Reorder Columns +- Hide, show, and reorder columns - Sort rows -- Quick Filter -- Add Criteria Filter +- Quick filter +- Add criteria filter - Copy and paste For full instructions, see the [Notes](#notes) section of this article. @@ -71,7 +71,8 @@ Get-Process | Out-GridView ### Example 2: Use a variable to output processes to a grid view -This example also gets the processes running on the local computer and sends them to a grid view window. +This example also gets the processes running on the local computer and sends them to a grid view +window. ```powershell $P = Get-Process @@ -190,10 +191,10 @@ the pipeline, click to select the items and then click OK. The values of this parameter determine how many items you can send down the pipeline. -- None. No items. This is the default value. -- Single. Zero items or one item. Use this value when the next command can take only one input +- `None`. No items. This is the default value. +- `Single`. Zero items or one item. Use this value when the next command can take only one input object. -- Multiple. Zero, one, or many items. Use this value when the next command can take multiple input +- `Multiple`. Zero, one, or many items. Use this value when the next command can take multiple input objects. This value is equivalent to the **Passthru** parameter. ```yaml @@ -361,7 +362,7 @@ include the typed text appear in the table. - Search for text. To search for text in the table, in the Filter box, type the text to find. - Search for multiple words. To search for multiple words in the table, type the words separated by - spaces. `Out-GridView` displays rows that include all the words (logical AND). + spaces. `Out-GridView` displays rows that include all the words (logical **AND**). - Search for literal phrases. To search for phrases that include spaces or special characters, enclose the phrase in quotation marks. `Out-GridView` displays rows that include an exact match for the phrase. diff --git a/reference/7.0/Microsoft.PowerShell.Utility/Set-Date.md b/reference/7.0/Microsoft.PowerShell.Utility/Set-Date.md index bbb23735a9e3..2054d807ca18 100644 --- a/reference/7.0/Microsoft.PowerShell.Utility/Set-Date.md +++ b/reference/7.0/Microsoft.PowerShell.Utility/Set-Date.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 04/30/2019 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/set-date?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 title: Set-Date @@ -30,6 +30,7 @@ Set-Date [-Adjust] <TimeSpan> [-DisplayHint <DisplayHintType>] [-WhatIf] [-Confi The `Set-Date` cmdlet changes the system date and time on the computer to a date and time that you specify. + You can specify a new date and/or time by typing a string or by passing a **DateTime** or **TimeSpan** object to `Set-Date`. To specify a new date or time, use the **Date** parameter. To specify a change interval, use the **Adjust** parameter. @@ -38,12 +39,11 @@ To specify a change interval, use the **Adjust** parameter. ### Example 1: Add three days to the system date -This command adds three days to the current system date. -It does not affect the time. -The command uses the **Date** parameter to specify the date. +This command adds three days to the current system date. It does not affect the time. The command +uses the **Date** parameter to specify the date. The `Get-Date` cmdlet returns the current date as a **DateTime** object. The **DateTime** object's -**AddDays** method adds a specified number of days (3) to the current **DateTime** object. +**AddDays** method adds a specified number of days (`3`) to the current **DateTime** object. ```powershell Set-Date -Date (Get-Date).AddDays(3) @@ -137,9 +137,9 @@ Accept wildcard characters: False Specifies which elements of the date and time are displayed.The acceptable values for this parameter are: -- **Date** - displays only the date. -- **Time** - displays only the time. -- **DateTime** - displays the date and time. +- `Date` - displays only the date. +- `Time` - displays only the time. +- `DateTime` - displays the date and time. This parameter affects only the display. It does not affect the **DateTime** object that `Get-Date` retrieves. @@ -216,7 +216,6 @@ You can pipe a date to `Set-Date`. - You can use standard .NET methods with the **DateTime** and **TimeSpan** objects used with `Set-Date`, such as **AddDays**, **AddMonths**, and **FromFileTime**. For more information, see [DateTime Methods](/dotnet/api/system.datetime) and - [TimeSpan Methods](/dotnet/api/system.timespan) in the .NET SDK. ## RELATED LINKS diff --git a/reference/7.0/Microsoft.PowerShell.Utility/Test-Json.md b/reference/7.0/Microsoft.PowerShell.Utility/Test-Json.md index 27bdd0c346a1..c5130d24991c 100644 --- a/reference/7.0/Microsoft.PowerShell.Utility/Test-Json.md +++ b/reference/7.0/Microsoft.PowerShell.Utility/Test-Json.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 07/21/2021 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/test-json?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 title: Test-Json @@ -127,9 +127,9 @@ Accept wildcard characters: False ### -Schema -Specifies a Schema to validate the JSON input against. If passed `Test-Json` will validate that the -Json input conforms to the spec specified by the **Schema** parameter and return `$True` only if the -input conforms to the provided Schema. +Specifies a schema to validate the JSON input against. If passed, `Test-Json` will validate that the +JSON input conforms to the spec specified by the **Schema** parameter and return `$true` only if the +input conforms to the provided schema. For more information, see [JSON Schema](https://json-schema.org/). diff --git a/reference/7.0/Microsoft.PowerShell.Utility/Unblock-File.md b/reference/7.0/Microsoft.PowerShell.Utility/Unblock-File.md index e71af2321311..98f9e283a331 100644 --- a/reference/7.0/Microsoft.PowerShell.Utility/Unblock-File.md +++ b/reference/7.0/Microsoft.PowerShell.Utility/Unblock-File.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 06/09/2017 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/unblock-file?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 title: Unblock-File @@ -10,7 +10,7 @@ title: Unblock-File # Unblock-File ## SYNOPSIS -Unblocks files that were downloaded from the Internet. +Unblocks files that were downloaded from the internet. ## SYNTAX @@ -30,16 +30,16 @@ Unblock-File -LiteralPath <String[]> [-WhatIf] [-Confirm] [<CommonParameters>] > **This cmdlet only works on the Windows and macOS platforms.** -The `Unblock-File` cmdlet lets you open files that were downloaded from the Internet. It unblocks -PowerShell script files that were downloaded from the Internet so you can run them, even when the +The `Unblock-File` cmdlet lets you open files that were downloaded from the internet. It unblocks +PowerShell script files that were downloaded from the internet so you can run them, even when the PowerShell execution policy is **RemoteSigned**. By default, these files are blocked to protect the computer from untrusted files. Before using the `Unblock-File` cmdlet, review the file and its source and verify that it is safe to open. -Internally, the `Unblock-File` cmdlet removes the Zone.Identifier alternate data stream, which has a -value of "3" to indicate that it was downloaded from the Internet. +Internally, the `Unblock-File` cmdlet removes the **Zone.Identifier** alternate data stream, which +has a value of `3` to indicate that it was downloaded from the internet. For more information about PowerShell execution policies, see [about_Execution_Policies](../Microsoft.PowerShell.Core/about/about_Execution_Policies.md). @@ -50,7 +50,7 @@ This cmdlet was introduced in Windows PowerShell 3.0. ### Example 1: Unblock a file -This command unblocks the PowerShellTips.chm file. +This command unblocks the `PowerShellTips.chm` file. ``` PS C:\> Unblock-File -Path C:\Users\User01\Documents\Downloads\PowerShellTips.chm @@ -70,11 +70,11 @@ PS C:\> dir C:\Downloads\*PowerShell* | Unblock-File This command shows how to find and unblock PowerShell scripts. The first command uses the **Stream** parameter of the *Get-Item* cmdlet get files with the -Zone.Identifier stream. +**Zone.Identifier** stream. The second command shows what happens when you run a blocked script in a PowerShell session in which -the execution policy is **RemoteSigned**. The RemoteSigned policy prevents you from running scripts -that are downloaded from the Internet unless they are digitally signed. +the execution policy is **RemoteSigned**. The **RemoteSigned** policy prevents you from running +scripts that are downloaded from the internet unless they are digitally signed. The third command uses the `Unblock-File` cmdlet to unblock the script so it can run in the session. @@ -106,8 +106,8 @@ PS C:\> Get-Item C:\ps-test\Start-ActivityTracker.ps1 | Unblock-File Specifies the files to unblock. Unlike **Path**, the value of the **LiteralPath** parameter is used exactly as it is typed. No characters are interpreted as wildcards. If the path includes escape -characters, enclose it in single quotation marks. Single quotation marks tell PowerShell not to -interpret any characters as escape sequences. +characters, enclose it in single quotation marks (`'`). Single quotation marks tell PowerShell not +to interpret any characters as escape sequences. ```yaml Type: System.String[] diff --git a/reference/7.0/Microsoft.WSMan.Management/Set-WSManInstance.md b/reference/7.0/Microsoft.WSMan.Management/Set-WSManInstance.md index 494b6984dab0..36d900ab5f76 100644 --- a/reference/7.0/Microsoft.WSMan.Management/Set-WSManInstance.md +++ b/reference/7.0/Microsoft.WSMan.Management/Set-WSManInstance.md @@ -2,7 +2,7 @@ external help file: Microsoft.WSMan.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.WSMan.Management -ms.date: 06/09/2017 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.wsman.management/set-wsmaninstance?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 title: Set-WSManInstance @@ -37,7 +37,7 @@ Set-WSManInstance [-ConnectionURI <Uri>] [-Dialect <Uri>] [-FilePath <String>] [ > **This cmdlet is only available on the Windows platform.** -The Set-WSManInstance cmdlet modifies the management information that is related to a resource. +The `Set-WSManInstance` cmdlet modifies the management information that is related to a resource. This cmdlet uses the WinRM connection/transport layer to modify the information. @@ -63,9 +63,10 @@ CertificateThumbprint : ListeningOn : {127.0.0.1, 172.30.168.171, ::1, 2001:4898:0:fff:0:5efe:172.30.168.171...} ``` -This command disables the https listener on the local computer. +This command disables the HTTPS listener on the local computer. -Important: The *ValueSet* parameter is case-sensitive when matching the properties specified. +> [!IMPORTANT] +> The **ValueSet** parameter is case-sensitive when matching the properties specified. For example, in this command, @@ -91,15 +92,16 @@ Service : Service Winrs : Winrs ``` -This command sets the MaxEnvelopeSizekb value to 200 on the local computer. +This command sets the **MaxEnvelopeSizekb** value to 200 on the local computer. -Important: The ValueSet parameter is case-sensitive when matching the properties specified. +> [!IMPORTANT] +> The **ValueSet** parameter is case-sensitive when matching the properties specified. For example, using the above command. -This fails: -ValueSet @{MaxEnvelopeSizeKB ="200"} +This fails: `-ValueSet @{MaxEnvelopeSizeKB ="200"}` -This succeeds: -ValueSet @{MaxEnvelopeSizekb ="200"} +This succeeds: `-ValueSet @{MaxEnvelopeSizekb ="200"}` ### Example 3: Disable a listener on a remote computer @@ -121,34 +123,35 @@ CertificateThumbprint : ListeningOn : {127.0.0.1, 172.30.168.172, ::1, 2001:4898:0:fff:0:5efe:172.30.168.172...} ``` -This command disables the https listener on the remote computer SERVER02. +This command disables the HTTPS listener on the remote computer SERVER02. -Important: The ValueSet parameter is case-sensitive when matching the properties specified. +> [!IMPORTANT] +> The **ValueSet** parameter is case-sensitive when matching the properties specified. For example, using the above command. -This fails: -ValueSet @{enabled="False"} +This fails: `-ValueSet @{enabled="False"}` -This succeeds: -ValueSet @{Enabled="False"} +This succeeds: `-ValueSet @{Enabled="False"}` ## PARAMETERS ### -ApplicationName -Specifies the application name in the connection. -The default value of the ApplicationName parameter is "WSMAN". -The complete identifier for the remote endpoint is in the following format: +Specifies the application name in the connection. The default value of the **ApplicationName** +parameter is "WSMAN". The complete identifier for the remote endpoint is in the following format: -\<transport\>://\<server\>:\<port\>/\<ApplicationName\> +`<transport>://<server>:<port>/<ApplicationName>` For example: `http://server01:8080/WSMAN` -Internet Information Services (IIS), which hosts the session, forwards requests with this endpoint to the specified application. -This default setting of "WSMAN" is appropriate for most uses. -This parameter is designed to be used when numerous computers establish remote connections to one computer that is running Windows PowerShell. -In this case, IIS hosts Web Services for Management (WS-Management ) for efficiency. +Internet Information Services (IIS), which hosts the session, forwards requests with this endpoint +to the specified application. This default setting of `WSMAN` is appropriate for most uses. This +parameter is designed to be used when numerous computers establish remote connections to one +computer that is running Windows PowerShell. In this case, IIS hosts Web Services for Management +(WS-Management) for efficiency. ```yaml Type: System.String @@ -167,16 +170,26 @@ Accept wildcard characters: False Specifies the authentication mechanism to be used at the server. Possible values are: -- Basic: Basic is a scheme in which the user name and password are sent in clear text to the server or proxy. -- Default : Use the authentication method implemented by the WS-Management protocol. This is the default. -- Digest: Digest is a challenge-response scheme that uses a server-specified data string for the challenge. -- Kerberos: The client computer and the server mutually authenticate by using Kerberos certificates. -- Negotiate: Negotiate is a challenge-response scheme that negotiates with the server or proxy to determine the scheme to use for authentication. For example, this parameter value allows negotiation to determine whether the Kerberos protocol or NTLM is used. -- CredSSP: Use Credential Security Support Provider (CredSSP) authentication, which allows the user to delegate credentials. This option is designed for commands that run on one remote computer but collect data from or run additional commands on other remote computers. - -Caution: CredSSP delegates the user's credentials from the local computer to a remote computer. -This practice increases the security risk of the remote operation. -If the remote computer is compromised, when credentials are passed to it, the credentials can be used to control the network session. +- `Basic`: Basic is a scheme in which the user name and password are sent in clear text to the + server or proxy. +- `Default` : Use the authentication method implemented by the WS-Management protocol. This is the + default. +- `Digest`: Digest is a challenge-response scheme that uses a server-specified data string for the + challenge. +- `Kerberos`: The client computer and the server mutually authenticate by using Kerberos + certificates. +- `Negotiate`: Negotiate is a challenge-response scheme that negotiates with the server or proxy to + determine the scheme to use for authentication. For example, this parameter value allows + negotiation to determine whether the Kerberos protocol or NTLM is used. +- `CredSSP`: Use Credential Security Support Provider (CredSSP) authentication, which allows the + user to delegate credentials. This option is designed for commands that run on one remote computer + but collect data from or run additional commands on other remote computers. + +> [!CAUTION] +> CredSSP delegates the user's credentials from the local computer to a remote computer. This +> practice increases the security risk of the remote operation. If the remote computer is +> compromised, when credentials are passed to it, the credentials can be used to control the network +> session. ```yaml Type: Microsoft.WSMan.Management.AuthenticationMechanism @@ -192,13 +205,14 @@ Accept wildcard characters: False ### -CertificateThumbprint -Specifies the digital public key certificate (X509) of a user account that has permission to perform this action. -Enter the certificate thumbprint of the certificate. +Specifies the digital public key certificate (X509) of a user account that has permission to perform +this action. Enter the certificate thumbprint of the certificate. -Certificates are used in client certificate-based authentication. -They can be mapped only to local user accounts; they do not work with domain accounts. +Certificates are used in client certificate-based authentication. They can be mapped only to local +user accounts; they do not work with domain accounts. -To get a certificate thumbprint, use the Get-Item or Get-ChildItem command in the PowerShell Cert: drive. +To get a certificate thumbprint, use the `Get-Item` or `Get-ChildItem` command in the PowerShell +`Cert:` drive. ```yaml Type: System.String @@ -214,12 +228,12 @@ Accept wildcard characters: False ### -ComputerName -Specifies the computer against which you want to run the management operation. -The value can be a fully qualified domain name, a NetBIOS name, or an IP address. -Use the local computer name, use localhost, or use a dot (.) to specify the local computer. -The local computer is the default. -When the remote computer is in a different domain from the user, you must use a fully qualified domain name must be used. -You can pipe a value for this parameter to the cmdlet. +Specifies the computer against which you want to run the management operation. The value can be a +fully qualified domain name, a NetBIOS name, or an IP address. Use the local computer name, +`localhost`, or a dot (`.`) to specify the local computer. The local computer is the default. + +When the remote computer is in a different domain from the user, you must use a fully qualified +domain name. You can pipe a value for this parameter to the cmdlet. ```yaml Type: System.String @@ -235,16 +249,15 @@ Accept wildcard characters: False ### -ConnectionURI -Specifies the connection endpoint. -The format of this string is: +Specifies the connection endpoint. The format of this string is: -\<Transport\>://\<Server\>:\<Port\>/\<ApplicationName\> +`<Transport>://<Server>:<Port>/<ApplicationName>` The following string is a properly formatted value for this parameter: `http://Server01:8080/WSMAN` -The URI must be fully qualified . +The URI must be fully qualified. ```yaml Type: System.Uri @@ -260,11 +273,10 @@ Accept wildcard characters: False ### -Credential -Specifies a user account that has permission to perform this action. -The default is the current user. -Type a user name, such as "User01", "Domain01\User01", or "User@Domain.com". -Or, enter a PSCredential object, such as one returned by the Get-Credential cmdlet. -When you type a user name, you will be prompted for a password. +Specifies a user account that has permission to perform this action. The default is the current +user. Type a user name, such as `User01`, `Domain01\User01`, or `User@Domain.com`. Alternatively, +enter a **PSCredential** object, such as one returned by the `Get-Credential` cmdlet. When you type +a user name, you will be prompted for a password. ```yaml Type: System.Management.Automation.PSCredential @@ -280,13 +292,12 @@ Accept wildcard characters: False ### -Dialect -Specifies the dialect to use in the filter predicate. -This can be any dialect that is supported by the remote service. -The following aliases can be used for the dialect URI: +Specifies the dialect to use in the filter predicate. This can be any dialect that is supported by +the remote service. The following aliases can be used for the dialect URI: -- WQL: `http://schemas.microsoft.com/wbem/wsman/1/WQL` -- Selector: `http://schemas.microsoft.com/wbem/wsman/1/wsman/SelectorFilter` -- Association: `http://schemas.dmtf.org/wbem/wsman/1/cimbinding/associationFilter` +- `WQL`: `http://schemas.microsoft.com/wbem/wsman/1/WQL` +- `Selector`: `http://schemas.microsoft.com/wbem/wsman/1/wsman/SelectorFilter` +- `Association`: `http://schemas.dmtf.org/wbem/wsman/1/cimbinding/associationFilter` ```yaml Type: System.Uri @@ -302,14 +313,14 @@ Accept wildcard characters: False ### -FilePath -Specifies the path of a file that is used to update a management resource. -You specify the management resource by using the ResourceURI parameter and the SelectorSet parameter . -For example, the following command uses the FilePath parameter: +Specifies the path of a file that is used to update a management resource. You specify the +management resource by using the **ResourceURI** parameter and the **SelectorSet** parameter. For +example, the following command uses the **FilePath** parameter: -`Invoke-WSManAction -action StopService -resourceuri wmicimv2/Win32_Service -SelectorSet @{Name="spooler"} -FilePath:c:\input.xml -authentication default` +`Invoke-WSManAction -Action StopService -ResourceUri wmicimv2/Win32_Service -SelectorSet @{Name="spooler"} -FilePath:c:\input.xml -authentication default` -This command calls the StopService method on the Spooler service by using input from a file. -The file, Input.xml, contains the following content: +This command calls the **StopService** method on the Spooler service by using input from a file. +The file, `Input.xml`, contains the following content: `<p:StopService_INPUT xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Service" />` @@ -327,8 +338,8 @@ Accept wildcard characters: False ### -Fragment -Specifies a section inside the instance that is to be updated or retrieved for the specified operation. -For example, to get the status of a spooler service, specify "-Fragment Status". +Specifies a section inside the instance that is to be updated or retrieved for the specified +operation. For example, to get the status of a spooler service, specify `-Fragment Status`. ```yaml Type: System.String @@ -348,9 +359,10 @@ Passes a set of switches to a service to modify or refine the nature of the requ These are similar to switches used in command-line shells because they are service specific. Any number of options can be specified. -The following example demonstrates the syntax that passes the values 1, 2, and 3 for the a, b, and c parameters: +The following example demonstrates the syntax that passes the values `1`, `2`, and `3` for the `a`, +`b`, and `c` parameters: --OptionSet @{a=1;b=2;c=3} +`-OptionSet @{a=1;b=2;c=3}` ```yaml Type: System.Collections.Hashtable @@ -366,12 +378,14 @@ Accept wildcard characters: False ### -Port -Specifies the port to use when the client connects to the WinRM service. -When the transport is HTTP, the default port is 80. -When the transport is HTTPS, the default port is 443. -When you use HTTPS as the transport, the value of the ComputerName parameter must match the server's certificate common name (CN). -However, if the SkipCNCheck parameter is specified as part of the SessionOption parameter, then the certificate common name of the server does not have to match the host name of the server. -The SkipCNCheck parameter should be used only for trusted machines. +Specifies the port to use when the client connects to the WinRM service. When the transport is HTTP, +the default port is 80. When the transport is HTTPS, the default port is 443. + +When you use HTTPS as the transport, the value of the **ComputerName** parameter must match the +server's certificate common name (CN). However, if the **SkipCNCheck** parameter is specified as +part of the **SessionOption** parameter, then the certificate common name of the server does not +have to match the host name of the server. The **SkipCNCheck** parameter should be used only for +trusted machines. ```yaml Type: System.Int32 @@ -412,11 +426,11 @@ Accept wildcard characters: False ### -SelectorSet Specifies a set of value pairs that are used to select particular management resource instances. -The SelectorSet parameter is used when more than one instance of the resource exists. -The value of the SelectorSet parameter must be a hash table. +The **SelectorSet** parameter is used when more than one instance of the resource exists. +The value of the **SelectorSet** parameter must be a hash table. The following example shows how to enter a value for this parameter: --SelectorSet @{Name="WinRM";ID="yyy"} +`-SelectorSet @{Name="WinRM";ID="yyy"}` ```yaml Type: System.Collections.Hashtable @@ -432,9 +446,9 @@ Accept wildcard characters: False ### -SessionOption -Defines a set of extended options for the WS-Management session. -Enter a SessionOption object that you create by using the New-WSManSessionOption cmdlet. -For more information about the options that are available, see New-WSManSessionOption. +Defines a set of extended options for the WS-Management session. Enter a **SessionOption** object +that you create with the `New-WSManSessionOption` cmdlet. For more information about the options +that are available, see [New-WSManSessionOption](New-WSManSessionOption.md). ```yaml Type: Microsoft.WSMan.Management.SessionOption @@ -450,12 +464,13 @@ Accept wildcard characters: False ### -UseSSL -Specifies that the Secure Sockets Layer (SSL) protocol should be used to establish a connection to the remote computer. -By default, SSL is not used. +Specifies that the Secure Sockets Layer (SSL) protocol should be used to establish a connection to +the remote computer. By default, SSL is not used. -WS-Management encrypts all the Windows PowerShell content that is transmitted over the network. -The UseSSL parameter lets you specify the additional protection of HTTPS instead of HTTP. -If SSL is not available on the port that is used for the connection and you specify this parameter, the command fails. +WS-Management encrypts all the Windows PowerShell content that is transmitted over the network. The +**UseSSL** parameter lets you specify the additional protection of HTTPS instead of HTTP. If SSL is +not available on the port that is used for the connection and you specify this parameter, the +command fails. ```yaml Type: System.Management.Automation.SwitchParameter @@ -471,9 +486,9 @@ Accept wildcard characters: False ### -ValueSet -Specifies a hash table that helps modify a management resource. -You specify the management resource by using the ResourceURI parameter and the SelectorSet parameter. -The value of the ValueSet parameter must be a hash table. +Specifies a hash table that helps modify a management resource. You specify the management resource +by using the **ResourceURI** parameter and the **SelectorSet** parameter. The value of the +**ValueSet** parameter must be a hash table. ```yaml Type: System.Collections.Hashtable @@ -489,7 +504,10 @@ Accept wildcard characters: False ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). ## INPUTS diff --git a/reference/7.1/CimCmdlets/Remove-CimInstance.md b/reference/7.1/CimCmdlets/Remove-CimInstance.md index 318589ddb217..b3d62129b080 100644 --- a/reference/7.1/CimCmdlets/Remove-CimInstance.md +++ b/reference/7.1/CimCmdlets/Remove-CimInstance.md @@ -2,7 +2,7 @@ external help file: Microsoft.Management.Infrastructure.CimCmdlets.dll-Help.xml Locale: en-US Module Name: CimCmdlets -ms.date: 06/21/2021 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/cimcmdlets/remove-ciminstance?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Remove-CimInstance @@ -153,7 +153,7 @@ Accept wildcard characters: False ### -Namespace -Specifies the namespace for the CIM operation. The default namespace is **root/cimv2**. You can use +Specifies the namespace for the CIM operation. The default namespace is `root/cimv2`. You can use tab completion to browse the list of namespaces, because PowerShell gets a list of namespaces from the local WMI server to provide the list of namespaces. @@ -172,7 +172,7 @@ Accept wildcard characters: False ### -OperationTimeoutSec Specifies the amount of time that the cmdlet waits for a response from the computer. By default, the -value of this parameter is 0, which means that the cmdlet uses the default timeout value for the +value of this parameter is `0`, which means that the cmdlet uses the default timeout value for the server. If the **OperationTimeoutSec** parameter is set to a value less than the robust connection retry @@ -199,7 +199,7 @@ Specifies a query to run on the CIM server. You can specify the query dialect us If the value specified contains double quotes (`"`), single quotes (`'`), or a backslash (`\`), you must escape those characters by prefixing them with the backslash (`\`) character. If the value -specified uses the WQL LIKE operator, then you must escape the following characters by enclosing +specified uses the WQL `LIKE` operator, then you must escape the following characters by enclosing them in square brackets (`[]`): percent (`%`), underscore (`_`), or opening square bracket (`[`). ```yaml @@ -217,7 +217,7 @@ Accept wildcard characters: False ### -QueryDialect Specifies the query language used for the Query parameter. The acceptable values for this parameter -are: **WQL** or **CQL**. The default value is **WQL**. +are: `WQL` or `CQL`. The default value is `WQL`. ```yaml Type: System.String @@ -247,7 +247,8 @@ By default, if you do not specify this parameter, the DMTF standard resource URI ResourceURI can only be used with CIM sessions created using the WSMan protocol, or when specifying the ComputerName parameter, which creates a CIM session using WSMan. If you specify this parameter without specifying the ComputerName parameter, or if you specify a CIM session created using DCOM -protocol, you get an error, because the DCOM protocol does not support the ResourceURI parameter. +protocol, you get an error, because the DCOM protocol does not support the **ResourceURI** +parameter. If both the **ResourceUri** parameter and the **Filter** parameter are specified, the **Filter** parameter is ignored. @@ -324,4 +325,3 @@ This cmdlet produces no outputs. [Get-CimInstance](get-ciminstance.md) [Set-CimInstance](Set-CimInstance.md) - diff --git a/reference/7.1/Microsoft.PowerShell.Diagnostics/Get-Counter.md b/reference/7.1/Microsoft.PowerShell.Diagnostics/Get-Counter.md index f3c2225b0db5..4f100e762cae 100644 --- a/reference/7.1/Microsoft.PowerShell.Diagnostics/Get-Counter.md +++ b/reference/7.1/Microsoft.PowerShell.Diagnostics/Get-Counter.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Diagnostics.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Diagnostics -ms.date: 06/21/2021 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.diagnostics/get-counter?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-Counter @@ -417,7 +417,7 @@ Path InstanceName CookedValue `Get-Counter` uses the **Counter** parameter to specify the counter `\Processor(*)\% Processor Time`. The values are stored in the `$Counter` variable. The objects stored in `$Counter.CounterSamples` are sent down the pipeline. `Where-Object` uses a script block -to compare each objects value against a specified value of 20. The `$_.CookedValue` is a variable +to compare each objects value against a specified value of `20`. The `$_.CookedValue` is a variable for the current object in the pipeline. Counters with a **CookedValue** that is less than 20 are displayed. @@ -609,7 +609,8 @@ Accept wildcard characters: False This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, --WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS @@ -661,4 +662,3 @@ In PowerShell 7, when using the **ListSet** parameter, `Get-Counter` can't retri [Start-Job](../Microsoft.PowerShell.Core/Start-Job.md) [Where-Object](..//Microsoft.PowerShell.Core/Where-Object.md) - diff --git a/reference/7.1/Microsoft.PowerShell.Management/Add-Content.md b/reference/7.1/Microsoft.PowerShell.Management/Add-Content.md index de0c3645a5fa..f40e5ada16ac 100644 --- a/reference/7.1/Microsoft.PowerShell.Management/Add-Content.md +++ b/reference/7.1/Microsoft.PowerShell.Management/Add-Content.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 11/03/2021 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/add-content?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Add-Content @@ -146,7 +146,7 @@ Mode LastWriteTime Length Name `IsReadOnlyTextFile.txt` in the current directory. - The `Set-ItemProperty` cmdlet uses the **Name** and **Value** parameters to change the file's **IsReadOnly** property to True. -- The `Get-ChildItem` cmdlet shows the file is empty (0) and has the read-only attribute (`r`). +- The `Get-ChildItem` cmdlet shows the file is empty (`0`) and has the read-only attribute (`r`). - The `Add-Content` cmdlet uses the **Path** parameter to specify the file. The **Value** parameter includes the text string to append to the file. The **Force** parameter writes the text to the read-only file. diff --git a/reference/7.1/Microsoft.PowerShell.Management/Get-PSDrive.md b/reference/7.1/Microsoft.PowerShell.Management/Get-PSDrive.md index 9364aac82fc2..4e99ae643778 100644 --- a/reference/7.1/Microsoft.PowerShell.Management/Get-PSDrive.md +++ b/reference/7.1/Microsoft.PowerShell.Management/Get-PSDrive.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 05/14/2019 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/get-psdrive?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-PSDrive @@ -213,7 +213,7 @@ Accept wildcard characters: False ### -Name Specifies, as a string array, the name or name of drives that this cmdlet gets in the operation. -Type the drive name or letter without a colon (:). +Type the drive name or letter without a colon (`:`). ```yaml Type: System.String[] @@ -308,4 +308,3 @@ This cmdlet returns objects that represent the drives in the session. [Remove-PSDrive](Remove-PSDrive.md) [Get-PSProvider](Get-PSProvider.md) - diff --git a/reference/7.1/Microsoft.PowerShell.Management/Get-PSProvider.md b/reference/7.1/Microsoft.PowerShell.Management/Get-PSProvider.md index 7636cdd9b51e..e9402147dd7c 100644 --- a/reference/7.1/Microsoft.PowerShell.Management/Get-PSProvider.md +++ b/reference/7.1/Microsoft.PowerShell.Management/Get-PSProvider.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 05/26/2021 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/get-psprovider?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-PSProvider @@ -108,7 +108,7 @@ PS C:\> (get-psprovider FileSystem).home C:\Users\User01 ``` -This example shows that the tilde symbol (~) represents the value of the **Home** property of the +This example shows that the tilde symbol (`~`) represents the value of the **Home** property of the FileSystem provider. The **Home** property value is optional, but for the **FileSystem** provider, it is defined as `$env:homedrive\$env:homepath` or `$home`. diff --git a/reference/7.1/Microsoft.PowerShell.Management/Get-Process.md b/reference/7.1/Microsoft.PowerShell.Management/Get-Process.md index 054d3a9fe6b0..75896a90788c 100644 --- a/reference/7.1/Microsoft.PowerShell.Management/Get-Process.md +++ b/reference/7.1/Microsoft.PowerShell.Management/Get-Process.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 06/09/2017 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/get-process?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-Process @@ -82,8 +82,8 @@ Get-Process winword, explorer | Format-List * This command gets all available data about the Winword and Explorer processes on the computer. It uses the **Name** parameter to specify the processes, but it omits the optional parameter name. The -pipeline operator `|` passes the data to the `Format-List` cmdlet, which displays all available -properties `*` of the Winword and Explorer process objects. +pipeline operator (`|`) passes the data to the `Format-List` cmdlet, which displays all available +properties (`*`) of the Winword and Explorer process objects. You can also identify the processes by their process IDs. For instance, `Get-Process -Id 664, 2060`. @@ -94,7 +94,7 @@ Get-Process | Where-Object {$_.WorkingSet -gt 20000000} ``` This command gets all processes that have a working set greater than 20 MB. It uses the -`Get-Process` cmdlet to get all running processes. The pipeline operator `|` passes the process +`Get-Process` cmdlet to get all running processes. The pipeline operator (`|`) passes the process objects to the `Where-Object` cmdlet, which selects only the object with a value greater than 20,000,000 bytes for the **WorkingSet** property. @@ -156,10 +156,10 @@ ProductVersion FileVersion FileName ``` This command uses the **FileVersionInfo** parameter to get the version information for the -pwsh.exe file that is the main module for the PowerShell process. +`pwsh.exe` file that is the main module for the PowerShell process. To run this command with processes that you do not own on Windows Vista and later versions of -Windows, you must open PowerShell with the Run as administrator option. +Windows, you must open PowerShell with the **Run as administrator** option. ### Example 7: Get modules loaded with the specified process @@ -168,10 +168,10 @@ Get-Process SQL* -Module ``` This command uses the **Module** parameter to get the modules that have been loaded by the process. -This command gets the modules for the processes that have names that begin with SQL. +This command gets the modules for the processes that have names that begin with `SQL`. To run this command on Windows Vista and later versions of Windows with processes that you do not -own, you must start PowerShell with the Run as administrator option. +own, you must start PowerShell with the **Run as administrator** option. ### Example 8: Find the owner of a process @@ -186,8 +186,9 @@ Handles WS(K) CPU(s) Id UserName ProcessName ``` This command shows how to find the owner of a process. -On Windows, the **IncludeUserName** parameter requires elevated user rights (Run as Administrator). -The output reveals that the owner is Domain01\user01. +On Windows, the **IncludeUserName** parameter requires elevated user rights +(**Run as Administrator**). +The output reveals that the owner is `Domain01\user01`. ### Example 9: Use an automatic variable to identify the process hosting the current session @@ -240,8 +241,8 @@ command to the `Get-Member` cmdlet `Get-Process | Get-Member`. Indicates that this cmdlet gets the file version information for the program that runs in the process. -On Windows Vista and later versions of Windows, you must open PowerShell with the Run as -administrator option to use this parameter on processes that you do not own. +On Windows Vista and later versions of Windows, you must open PowerShell with the **Run as +administrator** option to use this parameter on processes that you do not own. To get file version information for a process on a remote computer, use the `Invoke-Command` cmdlet. @@ -345,7 +346,7 @@ Accept wildcard characters: False ### -Name Specifies one or more processes by process name. You can type multiple process names (separated by -commas) and use wildcard characters. The parameter name ("Name") is optional. +commas) and use wildcard characters. The parameter name (`Name`) is optional. ```yaml Type: System.String[] @@ -383,26 +384,27 @@ use the **Module** parameter, without the **FileVersionInfo** parameter, it retu ## NOTES -- You can also refer to this cmdlet by its built-in aliases, ps and gps. For more information, see - [about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). +- You can also refer to this cmdlet by its built-in aliases, `ps` and `gps`. For more information, + see [about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). - On computers that are running a 64-bit version of Windows, the 64-bit version of PowerShell gets only 64-bit process modules and the 32-bit version of PowerShell gets only 32-bit process modules. - You can use the properties and methods of the Windows Management Instrumentation (WMI) - Win32_Process object in PowerShell. For information, see `Get-WmiObject` and the WMI SDK. + **Win32_Process** object in PowerShell. For information, see `Get-WmiObject` and the WMI SDK. - The default display of a process is a table that includes the following columns. For a description of all of the properties of process objects, see [Process Properties](/dotnet/api/system.diagnostics.process). - - Handles: The number of handles that the process has opened. - - NPM(K): The amount of non-paged memory that the process is using, in kilobytes. - - PM(K): The amount of pageable memory that the process is using, in kilobytes. - - WS(K): The size of the working set of the process, in kilobytes. - The working set consists of the pages of memory that were recently referenced by the process. - - VM(M): The amount of virtual memory that the process is using, in megabytes. - Virtual memory includes storage in the paging files on disk. - - CPU(s): The amount of processor time that the process has used on all processors, in seconds. - - ID: The process ID (PID) of the process. - - ProcessName: The name of the process. For explanations of the concepts related to processes, see - the Glossary in Help and Support Center and the Help for Task Manager. + - **Handles**: The number of handles that the process has opened. + - **NPM(K)**: The amount of non-paged memory that the process is using, in kilobytes. + - **PM(K)**: The amount of pageable memory that the process is using, in kilobytes. + - **WS(K)**: The size of the working set of the process, in kilobytes. The working set consists of + the pages of memory that were recently referenced by the process. + - **VM(M)**: The amount of virtual memory that the process is using, in megabytes. Virtual memory + includes storage in the paging files on disk. + - **CPU(s)**: The amount of processor time that the process has used on all processors, in + seconds. + - **ID**: The process ID (PID) of the process. + - **ProcessName**: The name of the process. For explanations of the concepts related to processes, + see the Glossary in Help and Support Center and the Help for Task Manager. - You can also use the built-in alternate views of the processes available with `Format-Table`, such as **StartTime** and **Priority**, and you can design your own views. diff --git a/reference/7.1/Microsoft.PowerShell.Management/Get-Service.md b/reference/7.1/Microsoft.PowerShell.Management/Get-Service.md index ac2e01e63aa0..3c6369ab5e12 100644 --- a/reference/7.1/Microsoft.PowerShell.Management/Get-Service.md +++ b/reference/7.1/Microsoft.PowerShell.Management/Get-Service.md @@ -2,12 +2,11 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 10/30/2019 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/get-service?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-Service --- - # Get-Service ## SYNOPSIS @@ -61,7 +60,7 @@ Get-Service ### Example 2: Get services that begin with a search string -This example retrieves services with service names that begin with WMI (Windows Management +This example retrieves services with service names that begin with `WMI` (Windows Management Instrumentation). ```powershell @@ -70,8 +69,8 @@ Get-Service "wmi*" ### Example 3: Display services that include a search string -This example displays services with a display name that includes the word network. Searching the -display name finds network-related services even when the service name doesn't include Net, such as +This example displays services with a display name that includes the word `network`. Searching the +display name finds network-related services even when the service name doesn't include `Net`, such as xmlprov, the Network Provisioning Service. ```powershell @@ -80,7 +79,7 @@ Get-Service -Displayname "*network*" ### Example 4: Get services that begin with a search string and an exclusion -This example only gets the services with service names that begin with **win**, except for the WinRM +This example only gets the services with service names that begin with `win`, except for the WinRM service. ```powershell @@ -89,14 +88,14 @@ Get-Service -Name "win*" -Exclude "WinRM" ### Example 5: Display services that are currently active -This example displays only the services with a status of Running. +This example displays only the services with a status of `Running`. ```powershell Get-Service | Where-Object {$_.Status -eq "Running"} ``` `Get-Service` gets all the services on the computer and sends the objects down the pipeline. The -`Where-Object` cmdlet, selects only the services with a **Status** property that equals Running. +`Where-Object` cmdlet, selects only the services with a **Status** property that equals `Running`. Status is only one property of service objects. To see all of the properties, type `Get-Service | Get-Member`. @@ -135,9 +134,9 @@ displays the number of dependent services for each service. ### Example 7: Sort services by property value This example shows that when you sort services in ascending order by the value of their **Status** -property, stopped services appear before running services. The reason is because the value of -**Status** is an enumeration, in which Stopped has a value of 1, and Running has a value of 4. For -more information, see +property, stopped services appear before running services. This happens because the value of +**Status** is an enumeration, in which `Stopped` has a value of `1`, and `Running` has a value of +`4`. For more information, see [ServiceControllerStatus](/dotnet/api/system.serviceprocess.servicecontrollerstatus). To list running services first, use the **Descending** parameter of the `Sort-Object` cmdlet. @@ -338,12 +337,13 @@ This cmdlet can display services only when the current user has permission to se cmdlet does not display services, you might not have permission to see them. To find the service name and display name of each service on your system, type `Get-Service`. The -service names appear in the Name column, and the display names appear in the **DisplayName** column. +service names appear in the **Name** column, and the display names appear in the **DisplayName** +column. -When you sort in ascending order by the **Status** property's value, Stopped services appear before -Running services. The service's **Status** property is an enumerated value and the status names -represent integer values. The sort order is based on the integer value, not the name. Stopped -appears before because Running because Stopped has a value of 1, and Running has a value of 4. For +When you sort in ascending order by status value, `Stopped` services appear before `Running` +services. The **Status** property of a service is an enumerated value in which the names of the +statuses represent integer values. The sort is based on the integer value, not the name. `Running` +appears before `Stopped` because `Stopped` has a value of `1`, and `Running` has a value of `4`. For more information, see [ServiceControllerStatus](/dotnet/api/system.serviceprocess.servicecontrollerstatus). diff --git a/reference/7.1/Microsoft.PowerShell.Management/New-ItemProperty.md b/reference/7.1/Microsoft.PowerShell.Management/New-ItemProperty.md index cc2021148028..e2c86f6cf834 100644 --- a/reference/7.1/Microsoft.PowerShell.Management/New-ItemProperty.md +++ b/reference/7.1/Microsoft.PowerShell.Management/New-ItemProperty.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 04/28/2022 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/new-itemproperty?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: New-ItemProperty @@ -45,10 +45,10 @@ This cmdlet does not add properties to an object. ### Example 1: Add a registry entry -This command adds a new registry entry, "NoOfEmployees", to the "MyCompany" key of the -"HKLM:\Software hive". +This command adds a new registry entry, `NoOfEmployees`, to the `MyCompany` key of the +`HKLM:\Software hive`. -The first command uses the **Path** parameter to specify the path of the "MyCompany" registry key. +The first command uses the **Path** parameter to specify the path of the `MyCompany` registry key. It uses the **Name** parameter to specify a name for the entry and the **Value** parameter to specify its value. @@ -71,25 +71,25 @@ NoOfEmployees : 822 ### Example 2: Add a registry entry to a key -This command adds a new registry entry to a registry key. -To specify the key, it uses a pipeline operator (`|`) to send an object that represents the key to -`New-ItemProperty`. +This command adds a new registry entry to a registry key. To specify the key, it uses a pipeline +operator (`|`) to send an object that represents the key to `New-ItemProperty`. -The first part of the command uses the `Get-Item` cmdlet to get the "MyCompany" registry key. -The pipeline operator sends the results of the command to `New-ItemProperty`, which adds the new -registry entry ("NoOfLocations"), and its value (3), to the "MyCompany" key. +The first part of the command uses the `Get-Item` cmdlet to get the `MyCompany` registry key. The +pipeline operator sends the results of the command to `New-ItemProperty`, which adds the new +registry entry (`NoOfLocations`), and its value (`3`), to the `MyCompany` key. ```powershell Get-Item -Path "HKLM:\Software\MyCompany" | New-ItemProperty -Name NoOfLocations -Value 3 ``` This command works because the parameter-binding feature of PowerShell associates the path of the -`RegistryKey` object that `Get-Item` returns with the **LiteralPath** parameter of -`New-ItemProperty`. For more information, see [about_Pipelines](../Microsoft.PowerShell.Core/About/about_pipelines.md). +**RegistryKey** object that `Get-Item` returns with the **LiteralPath** parameter of +`New-ItemProperty`. For more information, see +[about_Pipelines](../Microsoft.PowerShell.Core/About/about_pipelines.md). ### Example 3: Create a MultiString value in the registry using a Here-String -This example creates a MultiString value using a Here-String. +This example creates a `MultiString` value using a Here-String. ```powershell $newValue = New-ItemProperty -Path "HKLM:\SOFTWARE\ContosoCompany\" -Name 'HereString' -PropertyType MultiString -Value @" @@ -121,6 +121,13 @@ a ### -Credential +Specifies a user account that has permission to perform this action. +The default is the current user. + +Type a user name, such as `User01` or `Domain01\User01`, or enter a **PSCredential** object, such as +one generated by the `Get-Credential` cmdlet. If you type a user name, you are prompted for a +password. + > [!NOTE] > This parameter is not supported by any providers installed with PowerShell. > To impersonate another user, or elevate your credentials when running this cmdlet, @@ -160,11 +167,13 @@ Accept wildcard characters: True ### -Filter -Specifies a filter to qualify the **Path** parameter. The [FileSystem](../Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md) -provider is the only installed PowerShell provider that supports the use of filters. You can find -the syntax for the **FileSystem** filter language in [about_Wildcards](../Microsoft.PowerShell.Core/About/about_Wildcards.md). -Filters are more efficient than other parameters, because the provider applies them when the cmdlet -gets the objects rather than having PowerShell filter the objects after they are retrieved. +Specifies a filter to qualify the **Path** parameter. The +[FileSystem](../Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md) provider is the only +installed PowerShell provider that supports the use of filters. You can find the syntax for the +**FileSystem** filter language in +[about_Wildcards](../Microsoft.PowerShell.Core/About/about_Wildcards.md). Filters are more efficient +than other parameters, because the provider applies them when the cmdlet gets the objects rather +than having PowerShell filter the objects after they are retrieved. ```yaml Type: System.String @@ -200,7 +209,7 @@ Accept wildcard characters: False Specifies, as a string array, an item or items that this cmdlet includes in the operation. The value of this parameter qualifies the **Path** parameter. Enter a path element or pattern, such as -`"*.txt"`. Wildcard characters are permitted. The **Include** parameter is effective only when the +`*.txt`. Wildcard characters are permitted. The **Include** parameter is effective only when the command includes the contents of an item, such as `C:\Windows\*`, where the wildcard character specifies the contents of the `C:\Windows` directory. @@ -220,10 +229,11 @@ Accept wildcard characters: True Specifies a path to one or more locations. The value of **LiteralPath** is used exactly as it is typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose -it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters -as escape sequences. +it in single quotation marks (`'`). Single quotation marks tell PowerShell not to interpret any +characters as escape sequences. -For more information, see [about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). +For more information, see +[about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). ```yaml Type: System.String[] @@ -372,7 +382,8 @@ You cannot pipe input to this cmdlet. ## NOTES `New-ItemProperty` is designed to work with the data exposed by any provider. To list the providers -available in your session, type `Get-PSProvider`. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). +available in your session, type `Get-PSProvider`. For more information, see +[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). ## RELATED LINKS @@ -391,4 +402,3 @@ available in your session, type `Get-PSProvider`. For more information, see [abo [Set-ItemProperty](Set-ItemProperty.md) [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md) - diff --git a/reference/7.1/Microsoft.PowerShell.Management/Remove-PSDrive.md b/reference/7.1/Microsoft.PowerShell.Management/Remove-PSDrive.md index f6654c629e5f..ccd59a54111b 100644 --- a/reference/7.1/Microsoft.PowerShell.Management/Remove-PSDrive.md +++ b/reference/7.1/Microsoft.PowerShell.Management/Remove-PSDrive.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 06/09/2017 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/remove-psdrive?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Remove-PSDrive @@ -30,21 +30,24 @@ Remove-PSDrive [-LiteralName] <String[]> [-PSProvider <String[]>] [-Scope <Strin ## DESCRIPTION -The `Remove-PSDrive` cmdlet deletes temporary PowerShell drives that were created by using the `New-PSDrive` cmdlet. +The `Remove-PSDrive` cmdlet deletes temporary PowerShell drives that were created by using the +`New-PSDrive` cmdlet. -Beginning in Windows PowerShell 3.0, `Remove-PSDrive` also disconnects mapped network drives, including, but not limited to, drives created by using the `Persist` parameter of `New-PSDrive`. +Beginning in Windows PowerShell 3.0, `Remove-PSDrive` also disconnects mapped network drives, +including, but not limited to, drives created by using the **Persist** parameter of `New-PSDrive`. `Remove-PSDrive` cannot delete Windows physical or logical drives. -Beginning in Windows PowerShell 3.0, when an external drive is connected to the computer, PowerShell automatically adds a PSDrive to the file system that represents the new drive. -You do not need to restart PowerShell. -Similarly, when an external drive is disconnected from the computer, PowerShell automatically deletes the PSDrive that represents the removed drive. +Beginning in Windows PowerShell 3.0, when an external drive is connected to the computer, PowerShell +automatically adds a PSDrive to the file system that represents the new drive. You do not need to +restart PowerShell. Similarly, when an external drive is disconnected from the computer, PowerShell +automatically deletes the PSDrive that represents the removed drive. ## EXAMPLES ### Example 1: Remove a file system drive -This command removes a temporary file system drive named "smp". +This command removes a temporary file system drive named `smp`. ```powershell Remove-PSDrive -Name smp @@ -52,7 +55,7 @@ Remove-PSDrive -Name smp ### Example 2: Remove mapped network drives -This command uses `Remove-PSDrive` to disconnect the X: and S: mapped network drives. +This command uses `Remove-PSDrive` to disconnect the `X:` and `S:` mapped network drives. ```powershell Get-PSDrive X, S | Remove-PSDrive @@ -80,10 +83,9 @@ Accept wildcard characters: False Specifies the name of the drive. -The value of **LiteralName** is used exactly as typed. -No characters are interpreted as wildcards. -If the name includes escape characters, enclose it in single quotation marks ('). -Single quotation marks instruct PowerShell not to interpret any characters as escape sequences. +The value of **LiteralName** is used exactly as typed. No characters are interpreted as wildcards. +If the name includes escape characters, enclose it in single quotation marks (`'`). Single quotation +marks instruct PowerShell not to interpret any characters as escape sequences. ```yaml Type: System.String[] @@ -99,8 +101,7 @@ Accept wildcard characters: False ### -Name -Specifies the names of the drives to remove. -Do not type a colon (:) after the drive name. +Specifies the names of the drives to remove. Do not type a colon (`:`) after the drive name. ```yaml Type: System.String[] @@ -116,8 +117,8 @@ Accept wildcard characters: True ### -PSProvider -Specifies an array of **PSProvider** objects. -This cmdlet removes and disconnects all of the drives associated with the specified PowerShell provider. +Specifies an array of **PSProvider** objects. This cmdlet removes and disconnects all of the drives +associated with the specified PowerShell provider. ```yaml Type: System.String[] @@ -133,9 +134,10 @@ Accept wildcard characters: False ### -Scope -Specifies a scope for the drive. -The acceptable values for this parameter are: Global, Local, and Script, or a number relative to the current scope. Scopes number 0 through the number of scopes. The current scope number is 0 and its parent is 1. -For more information, see [about_Scopes](../Microsoft.PowerShell.Core/About/about_Scopes.md). +Specifies a scope for the drive. The acceptable values for this parameter are: `Global`, `Local`, +and `Script`, or a number relative to the current scope. Scopes number `0` through the number of +scopes. The current scope number is `0` and its parent is `1`. For more information, see +[about_Scopes](../Microsoft.PowerShell.Core/About/about_Scopes.md). ```yaml Type: System.String @@ -167,8 +169,7 @@ Accept wildcard characters: False ### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. +Shows what would happen if the cmdlet runs. The cmdlet is not run. ```yaml Type: System.Management.Automation.SwitchParameter @@ -184,13 +185,17 @@ Accept wildcard characters: False ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). ## INPUTS ### System.Management.Automation.PSDriveInfo -You can pipe a drive object, such as one from the `Get-PSDrive` cmdlet, to the `Remove-PSDrive` cmdlet. +You can pipe a drive object, such as one from the `Get-PSDrive` cmdlet, to the `Remove-PSDrive` +cmdlet. ## OUTPUTS @@ -200,7 +205,9 @@ This cmdlet does not return any output. ## NOTES -- The `Remove-PSDrive` cmdlet is designed to work with the data exposed by any PowerShell provider. To list the providers in your session, use the `Get-PSProvider` cmdlet. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). +- The `Remove-PSDrive` cmdlet is designed to work with the data exposed by any PowerShell provider. + To list the providers in your session, use the `Get-PSProvider` cmdlet. For more information, see + [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). ## RELATED LINKS @@ -209,4 +216,3 @@ This cmdlet does not return any output. [New-PSDrive](New-PSDrive.md) [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md) - diff --git a/reference/7.1/Microsoft.PowerShell.Management/Resolve-Path.md b/reference/7.1/Microsoft.PowerShell.Management/Resolve-Path.md index ad40913845de..becddeb58437 100644 --- a/reference/7.1/Microsoft.PowerShell.Management/Resolve-Path.md +++ b/reference/7.1/Microsoft.PowerShell.Management/Resolve-Path.md @@ -112,7 +112,7 @@ PS C:\> Resolve-Path -LiteralPath 'test[xml]' Specifies a user account that has permission to perform this action. The default is the current user. -Type a user name, such as User01 or Domain01\User01, or pass a **PSCredential** object. You can +Type a user name, such as `User01` or `Domain01\User01`, or pass a **PSCredential** object. You can create a **PSCredential** object using the `Get-Credential` cmdlet. If you type a user name, this cmdlet prompts you for a password. @@ -134,8 +134,8 @@ Accept wildcard characters: False Specifies the path to be resolved. The value of the **LiteralPath** parameter is used exactly as typed. No characters are interpreted as wildcard characters. If the path includes escape characters, -enclose it in single quotation marks. Single quotation marks tell PowerShell not to interpret any -characters as escape sequences. +enclose it in single quotation marks (`'`). Single quotation marks tell PowerShell not to interpret +any characters as escape sequences. ```yaml Type: System.String[] @@ -222,4 +222,3 @@ exist yet. [Split-Path](Split-Path.md) [Test-Path](Test-Path.md) - diff --git a/reference/7.1/Microsoft.PowerShell.Management/Start-Service.md b/reference/7.1/Microsoft.PowerShell.Management/Start-Service.md index 5221fd7d732d..f36dff0a75be 100644 --- a/reference/7.1/Microsoft.PowerShell.Management/Start-Service.md +++ b/reference/7.1/Microsoft.PowerShell.Management/Start-Service.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 06/09/2017 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/start-service?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Start-Service @@ -80,7 +80,7 @@ Start-Service -InputObject $s -PassThru | Format-List >> services.txt First we use `Get-Service` to get an object that represent the WMI service and store it in the `$s` variable. Next, we start the service. Without the **PassThru** parameter, `Start-Service` does not -create any output. The pipeline operator (|) passes the object output by `Start-Service` to the +create any output. The pipeline operator (`|`) passes the object output by `Start-Service` to the `Format-List` cmdlet to format the object as a list of its properties. The append redirection operator (`>>`) redirects the output to the services.txt file. The output is added to the end of the existing file. diff --git a/reference/7.1/Microsoft.PowerShell.Security/About/about_Certificate_Provider.md b/reference/7.1/Microsoft.PowerShell.Security/About/about_Certificate_Provider.md index 00d0fd7efdd7..f7057e75a8c8 100644 --- a/reference/7.1/Microsoft.PowerShell.Security/About/about_Certificate_Provider.md +++ b/reference/7.1/Microsoft.PowerShell.Security/About/about_Certificate_Provider.md @@ -1,7 +1,7 @@ --- description: Information about the Certificate provider. Locale: en-US -ms.date: 05/12/2022 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.security/about/about_certificate_provider?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: about Certificate Provider @@ -31,8 +31,8 @@ Provides access to X.509 certificate stores and certificates in PowerShell. The PowerShell **Certificate** provider lets you get, add, change, clear, and delete certificates and certificate stores in PowerShell. -The **Certificate** drive is a hierarchical namespace containing the -certificate stores and certificates on your computer. +The **Certificate** drive is a hierarchical namespace containing the certificate +stores and certificates on your computer. The **Certificate** provider supports the following cmdlets, which are covered in this article. @@ -78,9 +78,9 @@ the `Cert:` drive. Set-Location Cert: ``` -You can also work with the certificate provider from any other PowerShell -drive. To reference an alias from another location, use the `Cert:` drive name -in the path. +You can also work with the certificate provider from any other PowerShell drive. +To reference an alias from another location, use the `Cert:` drive name in the +path. ```powershell PS Cert:\> Set-Location -Path LocalMachine\Root @@ -163,8 +163,9 @@ Get-ChildItem -Path cert:\LocalMachine\My, cert:\LocalMachine\WebHosting ` ### Find expired certificates on remote computers This command uses the `Invoke-Command` cmdlet to run a `Get-ChildItem` command -on the Srv01 and Srv02 computers. A value of zero (0) in the **ExpiringInDays** -parameter gets certificates on the Srv01 and Srv02 computers that have expired. +on the Srv01 and Srv02 computers. A value of zero (`0`) in the +**ExpiringInDays** parameter gets certificates on the Srv01 and Srv02 computers +that have expired. ```powershell Invoke-Command -ComputerName Srv01, Srv02 {Get-ChildItem -Path cert:\* ` @@ -194,8 +195,8 @@ Get-ChildItem -Path cert:\* -Recurse -DNSName "*fabrikam*" ` ## Opening the Certificates MMC Snap-in -The `Invoke-Item` cmdlet will use the default application to open a path -you specify. For certificates, the default application is the Certificates MMC +The `Invoke-Item` cmdlet will use the default application to open a path you +specify. For certificates, the default application is the Certificates MMC snap-in. This command opens the Certificates MMC snap-in to manage the specified @@ -207,8 +208,8 @@ Invoke-Item cert:\CurrentUser\my\6B8223358119BB08840DEE50FD8AF9EA776CE66B ## Copying Certificates -Copying certificates is not supported by the **Certificate** provider. When -you attempt to copy a certificate, you see this error. +Copying certificates is not supported by the **Certificate** provider. When you +attempt to copy a certificate, you see this error. ``` $path = "Cert:\LocalMachine\Root\E2C0F6662D3C569705B4B31FE2CBF3434094B254" @@ -240,8 +241,8 @@ This command uses the **SSLServerAuthentication** parameter of the `Get-ChildItem` cmdlet to get SSL server authentication certificates in the `My` certificate store. -The returned certificates are piped to the `Move-Item` cmdlet, which moves -the certificates to the `WebHosting` store. +The returned certificates are piped to the `Move-Item` cmdlet, which moves the +certificates to the `WebHosting` store. ```powershell Get-ChildItem cert:\LocalMachine\My -SSLServerAuthentication | Move-Item ` @@ -251,12 +252,12 @@ Get-ChildItem cert:\LocalMachine\My -SSLServerAuthentication | Move-Item ` ## Deleting Certificates and Private Keys The `Remove-Item` cmdlet will remove certificates that you specify. The -`-DeleteKey` dynamic parameter deletes the private key. +**DeleteKey** dynamic parameter deletes the private key. ### Delete a Certificate from the CA store -This command deletes a certificate from the CA certificate store, but leaves -the associated private key intact. +This command deletes a certificate from the CA certificate store, but leaves the +associated private key intact. In the `Cert:` drive, the `Remove-Item` cmdlet supports only the **DeleteKey**, **Path**, **WhatIf**, and **Confirm** parameters. All other parameters are @@ -329,9 +330,9 @@ This command uses the **ExpiringInDays** parameter of the `Get-ChildItem` cmdlet with a value of `0` to get certificates in the `WebHosting` store that have expired. -The variable containing the returned certificates is piped to the -`Remove-Item` cmdlet, which deletes them. The command uses the **DeleteKey** -parameter to delete the private key along with the certificate. +The variable containing the returned certificates is piped to the `Remove-Item` +cmdlet, which deletes them. The command uses the **DeleteKey** parameter to +delete the private key along with the certificate. ```powershell $expired = Get-ChildItem cert:\LocalMachine\WebHosting -ExpiringInDays 0 @@ -349,8 +350,8 @@ cmdlet to create a certificate for testing purposes. In the `Cert:` drive, the `New-Item` cmdlet creates certificate stores in the `LocalMachine` store location. It supports the **Name**, **Path**, **WhatIf**, and **Confirm** parameters. All other parameters are ignored. The command -returns a **System.Security.Cryptography.X509Certificates.X509Store** -that represents the new certificate store. +returns a **System.Security.Cryptography.X509Certificates.X509Store** that +represents the new certificate store. This command creates a new certificate store named `CustomStore` in the `LocalMachine` store location. @@ -366,8 +367,8 @@ This command creates a new certificate store named `HostingStore` in the The command uses the `Invoke-Command` cmdlet to run a `New-Item` command on the Server01 computer. The command returns a -**System.Security.Cryptography.X509Certificates.X509Store** that represents -the new certificate store. +**System.Security.Cryptography.X509Certificates.X509Store** that represents the +new certificate store. ```powershell Invoke-Command { New-Item -Path cert:\LocalMachine\CustomStore } ` @@ -405,25 +406,25 @@ Invoke-Command { Remove-Item -Path cert:\LocalMachine\TestStore -Recurse } ` ## Dynamic parameters -Dynamic parameters are cmdlet parameters that are added by a PowerShell -provider and are available only when the cmdlet is being used in the -provider-enabled drive. These parameters are valid in all subdirectories of the -**Certificate** provider, but are effective only on certificates. +Dynamic parameters are cmdlet parameters that are added by a PowerShell provider +and are available only when the cmdlet is being used in the provider-enabled +drive. These parameters are valid in all subdirectories of the **Certificate** +provider, but are effective only on certificates. > [!NOTE] > Parameters that perform filtering against the **EnhancedKeyUsageList** -> property also return items with an empty**EnhancedKeyUsageList** property -> value. Certificates that have an empty **EnhancedKeyUsageList** can be used -> for all purposes. +> property also return items with an empty **EnhancedKeyUsageList** +> property value. Certificates that have an empty **EnhancedKeyUsageList** can +> be used for all purposes. The following Certificate provider parameters were reintroduced in PowerShell 7.1. -- DNSName -- DocumentEncryptionCert -- EKU -- ExpiringInDays -- SSLServerAuthentication +- **DNSName** +- **DocumentEncryptionCert** +- **EKU** +- **ExpiringInDays** +- **SSLServerAuthentication** ### CodeSigningCert <System.Management.Automation.SwitchParameter> @@ -441,14 +442,15 @@ This parameter gets certificates that have `Code Signing` in their - [Remove-Item](xref:Microsoft.PowerShell.Management.Remove-Item) -This parameter deletes the associated private key when it deletes the certificate. +This parameter deletes the associated private key when it deletes the +certificate. > [!IMPORTANT] > To delete a private key that is associated with a user certificate in the > `Cert:\CurrentUser` store on a remote computer, you must use delegated -> credentials. The `Invoke-Command` cmdlet supports credential delegation -> using the **CredSSP** parameter. You should consider any security risks -> before using `Remove-Item` with `Invoke-Command` and credential delegation. +> credentials. The `Invoke-Command` cmdlet supports credential delegation using +> the **CredSSP** parameter. You should consider any security risks before using +> `Remove-Item` with `Invoke-Command` and credential delegation. This parameter was reintroduced in PowerShell 7.1 @@ -505,10 +507,10 @@ This parameter allows you to specify the type of item created by `New-Item`. In a `Certificate` drive, the following values are allowed: -- Certificate Provider -- Certificate -- Store -- StoreLocation +- `Certificate Provider` +- `Certificate` +- `Store` +- `StoreLocation` #### Cmdlets Supported diff --git a/reference/7.1/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md b/reference/7.1/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md index cd24e12d60e3..813a91e14735 100644 --- a/reference/7.1/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md +++ b/reference/7.1/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 10/22/2021 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/convertfrom-csv?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: ConvertFrom-Csv @@ -147,11 +147,9 @@ generate objects from the CSV strings. ### -Delimiter -Specifies the delimiter that separates the property values in the CSV strings. -The default is a comma (,). - -Enter a character, such as a colon (:). -To specify a semicolon (;) enclose it in single quotation marks. +Specifies the delimiter that separates the property values in the CSV strings. The default is a +comma (`,`). Enter a character, such as a colon (`:`). To specify a semicolon (`;`) enclose it in +single quotation marks. If you specify a character other than the actual string delimiter in the file, `ConvertFrom-Csv` cannot create the objects from the CSV strings and will return the CSV strings. diff --git a/reference/7.1/Microsoft.PowerShell.Utility/ConvertTo-Html.md b/reference/7.1/Microsoft.PowerShell.Utility/ConvertTo-Html.md index c03ee1a0fd4b..089197477e8c 100644 --- a/reference/7.1/Microsoft.PowerShell.Utility/ConvertTo-Html.md +++ b/reference/7.1/Microsoft.PowerShell.Utility/ConvertTo-Html.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 08/10/2020 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/convertto-html?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: ConvertTo-Html @@ -103,7 +103,7 @@ on the computer. The command uses the pipeline operator (`|`) to send the proces The command uses the **Property** parameter to select three properties of the process objects to be included in the table. The command uses the **Title** parameter to specify a title for the HTML page. The command also uses the `Out-File` cmdlet to send the resulting HTML to a file named -Proc.htm. +`Proc.htm`. The second command uses the `Invoke-Item` cmdlet to open the `Proc.htm` in the default browser. @@ -157,7 +157,7 @@ Get-Date | ConvertTo-Html -Fragment ``` This command uses `ConvertTo-Html` to generate an HTML table of the current date. The command uses -the `Get-Date` cmdlet to get the current date. It uses a pipeline operator (|) to send the results +the `Get-Date` cmdlet to get the current date. It uses a pipeline operator (`|`) to send the results to the `ConvertTo-Html` cmdlet. The `ConvertTo-Html` command includes the **Fragment** parameter, which limits the output to an HTML @@ -194,12 +194,13 @@ Invoke-Item Services.htm ``` This command creates and opens a Web page that displays the services on the computer that begin with -A. It uses the **Title**, **Body**, **PreContent**, and **PostContent** parameters of +`A`. It uses the **Title**, **Body**, **PreContent**, and **PostContent** parameters of `ConvertTo-Html` to customize the output. The first part of the command uses the `Get-Service` cmdlet to get the services on the computer that -begin with A. The command uses a pipeline operator (`|`) to send the results to the `ConvertTo-Html` -cmdlet. The command also uses the `Out-File` cmdlet to send the output to the Services.htm file. +begin with `A`. The command uses a pipeline operator (`|`) to send the results to the +`ConvertTo-Html` cmdlet. The command also uses the `Out-File` cmdlet to send the output to the +`Services.htm` file. A semicolon (`;`) ends the first command and starts a second command, which uses the `Invoke-Item` cmdlet to open the `Services.htm` file in the default browser. @@ -223,7 +224,7 @@ The charset for the page is set to UTF-8 Get-Service | ConvertTo-HTML -Transitional ``` -This command sets the DOCTYPE of the returned HTML to XHTML Transitional DTD +This command sets the `DOCTYPE` of the returned HTML to **XHTML Transitional DTD** ## PARAMETERS @@ -307,7 +308,7 @@ Accept wildcard characters: False ### -Fragment -Generates only an HTML table. The HTML, HEAD, TITLE, and BODY tags are omitted. +Generates only an HTML table. The `<HTML>`, `<HEAD>`, `<TITLE>`, and `<BODY>` tags are omitted. ```yaml Type: System.Management.Automation.SwitchParameter @@ -418,11 +419,11 @@ Includes the specified properties of the objects in the HTML. The value of the * parameter can be a new calculated property. The calculated property can be a script block or a hash table. Valid key-value pairs are: -- Name (or label) - `<string>` (added in PowerShell 6.x) -- Expression - `<string>` or `<script block>` -- FormatString - `<string>` -- Width - `<int32>` - must be greater than `0` -- Alignment - value can be `Left`, `Center`, or `Right` +- `Name` (or label) - `<string>` (added in PowerShell 6.x) +- `Expression` - `<string>` or `<script block>` +- `FormatString` - `<string>` +- `Width` - `<int32>` - must be greater than `0` +- `Alignment` - value can be `Left`, `Center`, or `Right` For more information, see [about_Calculated_Properties](../Microsoft.PowerShell.Core/About/about_Calculated_Properties.md). @@ -457,7 +458,7 @@ Accept wildcard characters: False ### -Transitional -Changes the **DOCTYPE** to **XHTML Transitional DTD**, Default **DOCTYPE** is **XHTML Strict DTD**. +Changes the `DOCTYPE` to **XHTML Transitional DTD**, Default `DOCTYPE` is **XHTML Strict DTD**. This parameter was introduced in PowerShell 6.0. @@ -509,7 +510,7 @@ quite different. submit the processes on a computer to `ConvertTo-Html`, the resulting table displays an object array and its properties. - To comply with the XHTML Strict DTD, the DOCTYPE tag is modified accordingly: + To comply with the XHTML Strict DTD, the `DOCTYPE` tag is modified accordingly: `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"\>` diff --git a/reference/7.1/Microsoft.PowerShell.Utility/Format-List.md b/reference/7.1/Microsoft.PowerShell.Utility/Format-List.md index add3214fe48d..84ef6c97f140 100644 --- a/reference/7.1/Microsoft.PowerShell.Utility/Format-List.md +++ b/reference/7.1/Microsoft.PowerShell.Utility/Format-List.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 12/19/2018 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/format-list?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Format-List @@ -23,7 +23,7 @@ Format-List [[-Property] <Object[]>] [-GroupBy <Object>] [-View <string>] [-Show The `Format-List` cmdlet formats the output of a command as a list of properties in which each property is displayed on a separate line. You can use `Format-List` to format and display all or -selected properties of an object as a list (format-list *). +selected properties of an object as a list (`Format-List -Property *`). Because more space is available for each item in a list than in a table, PowerShell displays more properties of the object in the list, and the property values are less likely to be truncated. @@ -38,7 +38,7 @@ Get-Service | Format-List This command formats information about services on the computer as a list. By default, the services are formatted as a table. The `Get-Service` cmdlet gets objects representing the services on the -computer. The pipeline operator (|) passes the results through the pipeline to `Format-List`. +computer. The pipeline operator (`|`) passes the results through the pipeline to `Format-List`. Then, the `Format-List` command formats the service information in a list and sends it to the default output cmdlet for display. @@ -62,12 +62,12 @@ the formatted output to the default output cmdlet for display. This command displays the name, base priority, and priority class of each process on the computer. ```powershell -Get-Process | Format-List -Property name, basepriority, priorityclass +Get-Process | Format-List -Property Name, BasePriority, PriorityClass ``` It uses the `Get-Process` cmdlet to get an object representing each process. The pipeline operator -(|) passes the process objects through the pipeline to `Format-List`. `Format-List` formats the -processes as a list of the specified properties. The *Property* parameter name is optional, so you +(`|`) passes the process objects through the pipeline to `Format-List`. `Format-List` formats the +processes as a list of the specified properties. The **Property** parameter name is optional, so you can omit it. ### Example 4: Format all properties for a process @@ -79,9 +79,9 @@ Get-Process winlogon | Format-List -Property * ``` It uses the Get-Process cmdlet to get an object representing the Winlogon process. The pipeline -operator (|) passes the Winlogon process object through the pipeline to `Format-List`. The command -uses the *Property* parameter to specify the properties and the \* to indicate all properties. -Because the name of the *Property* parameter is optional, you can omit it and type the command as +operator (`|`) passes the Winlogon process object through the pipeline to `Format-List`. The command +uses the **Property** parameter to specify the properties and the `*` to indicate all properties. +Because the name of the **Property** parameter is optional, you can omit it and type the command as `Format-List *`. `Format-List` automatically sends the results to the default output cmdlet for display. @@ -129,12 +129,12 @@ Accept wildcard characters: False ### -Expand Specifies the formatted collection object, as well as the objects in the collection. This parameter -is designed to format objects that support the ICollection (System.Collections) interface. The -default value is EnumOnly. The acceptable values for this parameter are: +is designed to format objects that support the **System.Collections.ICollection** interface. The +default value is `EnumOnly`. The acceptable values for this parameter are: -- EnumOnly. Displays the properties of the objects in the collection. -- CoreOnly. Displays the properties of the collection object. -- Both. Displays the properties of the collection object and the properties of objects in the +- `EnumOnly`. Displays the properties of the objects in the collection. +- `CoreOnly`. Displays the properties of the collection object. +- `Both`. Displays the properties of the collection object and the properties of objects in the collection. ```yaml @@ -176,9 +176,9 @@ property of the output. The value of the **GroupBy** parameter can be a new calculated property. The calculated property can be a script block or a hash table. Valid key-value pairs are: -- Name (or Label) - `<string>` -- Expression - `<string>` or `<script block>` -- FormatString - `<string>` +- `Name` (or `Label`) - `<string>` +- `Expression` - `<string>` or `<script block>` +- `FormatString` - `<string>` For more information, see [about_Calculated_Properties](../Microsoft.PowerShell.Core/About/about_Calculated_Properties.md). @@ -218,15 +218,15 @@ Specifies the object properties that appear in the display and the order in whic Wildcards are permitted. If you omit this parameter, the properties that appear in the display depend on the object being -displayed. The parameter name "Property" is optional. You cannot use the **Property** and **View** +displayed. The parameter name **Property** is optional. You cannot use the **Property** and **View** parameters in the same command. The value of the **Property** parameter can be a new calculated property. The calculated property can be a script block or a hash table. Valid key-value pairs are: -- Name (or Label) - `<string>` -- Expression - `<string>` or `<script block>` -- FormatString - `<string>` +- `Name` (or `Label`) - `<string>` +- `Expression` - `<string>` or `<script block>` +- `FormatString` - `<string>` For more information, see [about_Calculated_Properties](../Microsoft.PowerShell.Core/About/about_Calculated_Properties.md). @@ -299,17 +299,17 @@ You can pipe any object to `Format-List`. ## NOTES -You can also refer to Format-List by its built-in alias, FL. For more information, see +You can also refer to `Format-List` by its built-in alias, `fl`. For more information, see [about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). The format cmdlets, such as `Format-List`, arrange the data to be displayed but do not display it. -The data is displayed by the output features of PowerShell and by the cmdlets that contain the Out -verb (the Out cmdlets), such as `Out-Host` or `Out-File`. +The data is displayed by the output features of PowerShell and by the cmdlets that contain the `Out` +verb (the `Out` cmdlets), such as `Out-Host` or `Out-File`. If you do not use a format cmdlet, PowerShell applies that default format for each object that it displays. -The **GroupBy** parameter assumes that the objects are sorted. Use Sort-Object before using +The **GroupBy** parameter assumes that the objects are sorted. Use `Sort-Object` before using `Format-List` to group the objects. The **View** parameter lets you specify an alternate format for the table. You can use the views diff --git a/reference/7.1/Microsoft.PowerShell.Utility/Format-Wide.md b/reference/7.1/Microsoft.PowerShell.Utility/Format-Wide.md index 35aa6abcc9cf..e4a0b6e6c6fc 100644 --- a/reference/7.1/Microsoft.PowerShell.Utility/Format-Wide.md +++ b/reference/7.1/Microsoft.PowerShell.Utility/Format-Wide.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 08/10/2020 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/format-wide?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Format-Wide @@ -36,23 +36,23 @@ screen. Get-ChildItem | Format-Wide -Column 3 ``` -The Get-ChildItem cmdlet gets objects representing each file in the directory. The pipeline -operator (|) passes the file objects through the pipeline to `Format-Wide`, which formats them for +The `Get-ChildItem` cmdlet gets objects representing each file in the directory. The pipeline +operator (`|`) passes the file objects through the pipeline to `Format-Wide`, which formats them for output. The **Column** parameter specifies the number of columns. ### Example 2: Format names of registry keys -This command displays the names of registry keys in the HKEY_CURRENT_USER\Software\Microsoft key. +This command displays the names of registry keys in the `HKEY_CURRENT_USER\Software\Microsoft` key. ```powershell Get-ChildItem HKCU:\software\microsoft | Format-Wide -Property pschildname -AutoSize ``` -The Get-ChildItem cmdlet gets objects representing the keys. The path is specified as HKCU:, one of -the drives exposed by the PowerShell Registry provider, followed by the key path. The pipeline -operator (|) passes the registry key objects through the pipeline to `Format-Wide`, which formats -them for output. The **Property** parameter specifies the name of the property, and the -**AutoSize** parameter adjusts the columns for readability. +The `Get-ChildItem` cmdlet gets objects representing the keys. The path is specified as `HKCU:`, one +of the drives exposed by the PowerShell Registry provider, followed by the key path. The pipeline +operator (`|`) passes the registry key objects through the pipeline to `Format-Wide`, which formats +them for output. The **Property** parameter specifies the name of the property, and the **AutoSize** +parameter adjusts the columns for readability. ### Example 3: Troubleshooting format errors @@ -131,14 +131,14 @@ Accept wildcard characters: False ### -Expand Formats the collection object, as well as the objects in the collection. This parameter is designed -to format objects that support the ICollection (System.Collections) interface. The default value is -**EnumOnly**. +to format objects that support the **System.Collections.ICollection** interface. The default value +is `EnumOnly`. Valid values are: -- EnumOnly: Displays the properties of the objects in the collection. -- CoreOnly: Displays the properties of the collection object. -- Both: Displays the properties of the collection object and the properties of objects in the +- `EnumOnly`: Displays the properties of the objects in the collection. +- `CoreOnly`: Displays the properties of the collection object. +- `Both`: Displays the properties of the collection object and the properties of objects in the collection. ```yaml @@ -181,9 +181,9 @@ of the output. The value of the **GroupBy** parameter can be a new calculated property. The calculated property can be a script block or a hash table. Valid key-value pairs are: -- Name (or Label) - `<string>` -- Expression - `<string>` or `<script block>` -- FormatString - `<string>` +- `Name` (or `Label`) - `<string>` +- `Expression` - `<string>` or `<script block>` +- `FormatString` - `<string>` For more information, see [about_Calculated_Properties](../Microsoft.PowerShell.Core/About/about_Calculated_Properties.md). @@ -219,18 +219,17 @@ Accept wildcard characters: False ### -Property -Specifies the object property that appears in the display. -Wildcards are permitted. +Specifies the object property that appears in the display. Wildcards are permitted. If you omit this parameter, the properties that appear in the display depend on the object being -displayed. The parameter name "Property" is optional. You cannot use the **Property** and **View** +displayed. The parameter name **Property** is optional. You cannot use the **Property** and **View** parameters in the same command. -The value of the **Property** parameter can be a new calculated property. The calculated property can -be a script block or a hash table. Valid key-value pairs are: +The value of the **Property** parameter can be a new calculated property. The calculated property +can be a script block or a hash table. Valid key-value pairs are: -- Expression - `<string>` or `<script block>` -- FormatString - `<string>` +- `Expression` - `<string>` or `<script block>` +- `FormatString` - `<string>` For more information, see [about_Calculated_Properties](../Microsoft.PowerShell.Core/About/about_Calculated_Properties.md). @@ -303,7 +302,8 @@ You can pipe any object to `Format-Wide`. ## NOTES -You can also refer to `Format-Wide` by its built-in alias, `fw`. For more information, see [about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). +You can also refer to `Format-Wide` by its built-in alias, `fw`. For more information, see +[about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). The **GroupBy** parameter assumes that the objects are sorted. Use `Sort-Object` before using `Format-Custom` to group the objects. @@ -314,7 +314,7 @@ in new PS1XML files and use the `Update-FormatData` cmdlet to include them in Po The alternate view for the **View** parameter must use table format; if it does not, the command fails. If the alternate view is a list, use `Format-List`. If the alternate view is neither a list -nor a table, use Format-Custom. +nor a table, use `Format-Custom`. ## RELATED LINKS diff --git a/reference/7.1/Microsoft.PowerShell.Utility/Get-Unique.md b/reference/7.1/Microsoft.PowerShell.Utility/Get-Unique.md index cd204e26ce94..0a84c0d74b09 100644 --- a/reference/7.1/Microsoft.PowerShell.Utility/Get-Unique.md +++ b/reference/7.1/Microsoft.PowerShell.Utility/Get-Unique.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 03/12/2019 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/get-unique?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-Unique @@ -47,10 +47,10 @@ $A = $( foreach ($line in Get-Content C:\Test1\File1.txt) { $A.count ``` -The first command gets the content of the File.txt file. It converts each line of text to lowercase -letters and then splits each word onto a separate line at the space (" "). Then, it sorts the -resulting list alphabetically (the default) and uses the `Get-Unique` cmdlet to eliminate any -duplicate words. The results are stored in the `$A` variable. +The first command gets the content of the `File.txt` file. It converts each line of text to +lowercase letters and then splits each word onto a separate line at the space (`" "`). Then, it +sorts the resulting list alphabetically (the default) and uses the `Get-Unique` cmdlet to eliminate +any duplicate words. The results are stored in the `$A` variable. The second command uses the **Count** property of the collection of strings in `$A` to determine how many items are in `$A`. @@ -86,7 +86,7 @@ includes files and directories. Get-ChildItem | Sort-Object {$_.GetType()} | Get-Unique -OnType ``` -The pipeline operator (|) sends the results to the `Sort-Object` cmdlet. The `$_.GetType()` +The pipeline operator (`|`) sends the results to the `Sort-Object` cmdlet. The `$_.GetType()` statement applies the **GetType** method to each file or directory. Then, `Sort-Object` sorts the items by type. Another pipeline operator sends the results to `Get-Unique`. The **OnType** parameter directs `Get-Unique` to return only one object of each type. @@ -99,11 +99,11 @@ This command gets the names of processes running on the computer with duplicates Get-Process | Sort-Object | Select-Object processname | Get-Unique -AsString ``` -The `Get-Process` command gets all of the processes on the computer. The pipeline operator (|) +The `Get-Process` command gets all of the processes on the computer. The pipeline operator (`|`) passes the result to `Sort-Object`, which, by default, sorts the processes alphabetically by -ProcessName. The results are piped to the `Select-Object` cmdlet, which selects only the values of -the ProcessName property of each object. The results are then piped to `Get-Unique` to eliminate -duplicates. +**ProcessName**. The results are piped to the `Select-Object` cmdlet, which selects only the values +of the **ProcessName** property of each object. The results are then piped to `Get-Unique` to +eliminate duplicates. The **AsString** parameter tells `Get-Unique` to treat the **ProcessName** values as strings. Without this parameter, `Get-Unique` treats the **ProcessName** values as objects and returns only @@ -187,14 +187,14 @@ The type of object that `Get-Unique` returns is determined by the input. ## NOTES -You can also refer to `Get-Unique` by its built-in alias, `gu`. For more information, see [about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). +You can also refer to `Get-Unique` by its built-in alias, `gu`. For more information, see +[about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). -To sort a list, use Sort-Object. You can also use the **Unique** parameter of `Sort-Object` to find -the unique items in a list. +To sort a list, use `Sort-Object`. You can also use the **Unique** parameter of `Sort-Object` to +find the unique items in a list. ## RELATED LINKS [Select-Object](Select-Object.md) [Sort-Object](Sort-Object.md) - diff --git a/reference/7.1/Microsoft.PowerShell.Utility/Out-GridView.md b/reference/7.1/Microsoft.PowerShell.Utility/Out-GridView.md index b0b3a6828964..02f81c68874f 100644 --- a/reference/7.1/Microsoft.PowerShell.Utility/Out-GridView.md +++ b/reference/7.1/Microsoft.PowerShell.Utility/Out-GridView.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 10/28/2019 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/out-gridview?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Out-GridView @@ -45,10 +45,10 @@ Nano Server. You can use the following features of the table to examine your data: -- Hide, Show, and Reorder Columns +- Hide, show, and reorder columns - Sort rows -- Quick Filter -- Add Criteria Filter +- Quick filter +- Add criteria filter - Copy and paste For full instructions, see the [Notes](#notes) section of this article. @@ -71,7 +71,8 @@ Get-Process | Out-GridView ### Example 2: Use a variable to output processes to a grid view -This example also gets the processes running on the local computer and sends them to a grid view window. +This example also gets the processes running on the local computer and sends them to a grid view +window. ```powershell $P = Get-Process @@ -190,10 +191,10 @@ the pipeline, click to select the items and then click OK. The values of this parameter determine how many items you can send down the pipeline. -- None. No items. This is the default value. -- Single. Zero items or one item. Use this value when the next command can take only one input +- `None`. No items. This is the default value. +- `Single`. Zero items or one item. Use this value when the next command can take only one input object. -- Multiple. Zero, one, or many items. Use this value when the next command can take multiple input +- `Multiple`. Zero, one, or many items. Use this value when the next command can take multiple input objects. This value is equivalent to the **Passthru** parameter. ```yaml @@ -361,7 +362,7 @@ include the typed text appear in the table. - Search for text. To search for text in the table, in the Filter box, type the text to find. - Search for multiple words. To search for multiple words in the table, type the words separated by - spaces. `Out-GridView` displays rows that include all the words (logical AND). + spaces. `Out-GridView` displays rows that include all the words (logical **AND**). - Search for literal phrases. To search for phrases that include spaces or special characters, enclose the phrase in quotation marks. `Out-GridView` displays rows that include an exact match for the phrase. @@ -426,4 +427,3 @@ The criteria only affects the display. It does not delete items from the table. [Out-Printer](Out-Printer.md) [Out-String](Out-String.md) - diff --git a/reference/7.1/Microsoft.PowerShell.Utility/Set-Date.md b/reference/7.1/Microsoft.PowerShell.Utility/Set-Date.md index daa0255cbab3..2ad779e27f92 100644 --- a/reference/7.1/Microsoft.PowerShell.Utility/Set-Date.md +++ b/reference/7.1/Microsoft.PowerShell.Utility/Set-Date.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 04/30/2019 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/set-date?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Set-Date @@ -30,6 +30,7 @@ Set-Date [-Adjust] <TimeSpan> [-DisplayHint <DisplayHintType>] [-WhatIf] [-Confi The `Set-Date` cmdlet changes the system date and time on the computer to a date and time that you specify. + You can specify a new date and/or time by typing a string or by passing a **DateTime** or **TimeSpan** object to `Set-Date`. To specify a new date or time, use the **Date** parameter. To specify a change interval, use the **Adjust** parameter. @@ -38,12 +39,11 @@ To specify a change interval, use the **Adjust** parameter. ### Example 1: Add three days to the system date -This command adds three days to the current system date. -It does not affect the time. -The command uses the **Date** parameter to specify the date. +This command adds three days to the current system date. It does not affect the time. The command +uses the **Date** parameter to specify the date. The `Get-Date` cmdlet returns the current date as a **DateTime** object. The **DateTime** object's -**AddDays** method adds a specified number of days (3) to the current **DateTime** object. +**AddDays** method adds a specified number of days (`3`) to the current **DateTime** object. ```powershell Set-Date -Date (Get-Date).AddDays(3) @@ -137,9 +137,9 @@ Accept wildcard characters: False Specifies which elements of the date and time are displayed.The acceptable values for this parameter are: -- **Date** - displays only the date. -- **Time** - displays only the time. -- **DateTime** - displays the date and time. +- `Date` - displays only the date. +- `Time` - displays only the time. +- `DateTime` - displays the date and time. This parameter affects only the display. It does not affect the **DateTime** object that `Get-Date` retrieves. @@ -216,7 +216,6 @@ You can pipe a date to `Set-Date`. - You can use standard .NET methods with the **DateTime** and **TimeSpan** objects used with `Set-Date`, such as **AddDays**, **AddMonths**, and **FromFileTime**. For more information, see [DateTime Methods](/dotnet/api/system.datetime) and - [TimeSpan Methods](/dotnet/api/system.timespan) in the .NET SDK. ## RELATED LINKS diff --git a/reference/7.1/Microsoft.PowerShell.Utility/Test-Json.md b/reference/7.1/Microsoft.PowerShell.Utility/Test-Json.md index 72b78369a51c..635b6d8dd8d4 100644 --- a/reference/7.1/Microsoft.PowerShell.Utility/Test-Json.md +++ b/reference/7.1/Microsoft.PowerShell.Utility/Test-Json.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 07/21/2021 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/test-json?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Test-Json @@ -118,7 +118,7 @@ For more information, see [JSON Schema](https://json-schema.org/). ### Example 3: Test an object against a schema from file JSON schema can reference definitions using `$ref` keyword. The `$ref` can resolve to a URI that -references another file. The `SchemaFile` parameter accepts literal path to the JSON schema file +references another file. The **SchemaFile** parameter accepts literal path to the JSON schema file and allows JSON files to be validated against such schemas. In this example we have `schema.json` file which references `definitions.json`. @@ -162,7 +162,8 @@ PS> Get-Content definitions.json True ``` -For more information, see [Structuring a complex schema](https://json-schema.org/understanding-json-schema/structuring.html). +For more information, see +[Structuring a complex schema](https://json-schema.org/understanding-json-schema/structuring.html). ## PARAMETERS @@ -187,9 +188,9 @@ Accept wildcard characters: False ### -Schema -Specifies a Schema to validate the JSON input against. If passed `Test-Json` will validate that the -Json input conforms to the spec specified by the **Schema** parameter and return `$True` only if the -input conforms to the provided Schema. +Specifies a schema to validate the JSON input against. If passed, `Test-Json` will validate that the +JSON input conforms to the spec specified by the **Schema** parameter and return `$true` only if the +input conforms to the provided schema. For more information, see [JSON Schema](https://json-schema.org/). @@ -207,8 +208,8 @@ Accept wildcard characters: False ### -SchemaFile -Specifies a schema file used to validate the JSON input. When used, the `Test-Json` returns `$True` -only if the JSON input conforms to the Schema defined in the file specified by the **SchemaFile** +Specifies a schema file used to validate the JSON input. When used, the `Test-Json` returns `$true` +only if the JSON input conforms to the schema defined in the file specified by the **SchemaFile** parameter. For more information, see [JSON Schema](https://json-schema.org/). diff --git a/reference/7.1/Microsoft.PowerShell.Utility/Unblock-File.md b/reference/7.1/Microsoft.PowerShell.Utility/Unblock-File.md index 5d5fe82d37f0..f36147413c36 100644 --- a/reference/7.1/Microsoft.PowerShell.Utility/Unblock-File.md +++ b/reference/7.1/Microsoft.PowerShell.Utility/Unblock-File.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 06/09/2017 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/unblock-file?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Unblock-File @@ -10,7 +10,7 @@ title: Unblock-File # Unblock-File ## SYNOPSIS -Unblocks files that were downloaded from the Internet. +Unblocks files that were downloaded from the internet. ## SYNTAX @@ -30,16 +30,16 @@ Unblock-File -LiteralPath <String[]> [-WhatIf] [-Confirm] [<CommonParameters>] > **This cmdlet only works on the Windows and macOS platforms.** -The `Unblock-File` cmdlet lets you open files that were downloaded from the Internet. It unblocks -PowerShell script files that were downloaded from the Internet so you can run them, even when the +The `Unblock-File` cmdlet lets you open files that were downloaded from the internet. It unblocks +PowerShell script files that were downloaded from the internet so you can run them, even when the PowerShell execution policy is **RemoteSigned**. By default, these files are blocked to protect the computer from untrusted files. Before using the `Unblock-File` cmdlet, review the file and its source and verify that it is safe to open. -Internally, the `Unblock-File` cmdlet removes the Zone.Identifier alternate data stream, which has a -value of "3" to indicate that it was downloaded from the Internet. +Internally, the `Unblock-File` cmdlet removes the **Zone.Identifier** alternate data stream, which +has a value of `3` to indicate that it was downloaded from the internet. For more information about PowerShell execution policies, see [about_Execution_Policies](../Microsoft.PowerShell.Core/about/about_Execution_Policies.md). @@ -50,7 +50,7 @@ This cmdlet was introduced in Windows PowerShell 3.0. ### Example 1: Unblock a file -This command unblocks the PowerShellTips.chm file. +This command unblocks the `PowerShellTips.chm` file. ``` PS C:\> Unblock-File -Path C:\Users\User01\Documents\Downloads\PowerShellTips.chm @@ -70,11 +70,11 @@ PS C:\> dir C:\Downloads\*PowerShell* | Unblock-File This command shows how to find and unblock PowerShell scripts. The first command uses the **Stream** parameter of the *Get-Item* cmdlet get files with the -Zone.Identifier stream. +**Zone.Identifier** stream. The second command shows what happens when you run a blocked script in a PowerShell session in which -the execution policy is **RemoteSigned**. The RemoteSigned policy prevents you from running scripts -that are downloaded from the Internet unless they are digitally signed. +the execution policy is **RemoteSigned**. The **RemoteSigned** policy prevents you from running +scripts that are downloaded from the internet unless they are digitally signed. The third command uses the `Unblock-File` cmdlet to unblock the script so it can run in the session. @@ -106,8 +106,8 @@ PS C:\> Get-Item C:\ps-test\Start-ActivityTracker.ps1 | Unblock-File Specifies the files to unblock. Unlike **Path**, the value of the **LiteralPath** parameter is used exactly as it is typed. No characters are interpreted as wildcards. If the path includes escape -characters, enclose it in single quotation marks. Single quotation marks tell PowerShell not to -interpret any characters as escape sequences. +characters, enclose it in single quotation marks (`'`). Single quotation marks tell PowerShell not +to interpret any characters as escape sequences. ```yaml Type: System.String[] diff --git a/reference/7.1/Microsoft.WSMan.Management/Set-WSManInstance.md b/reference/7.1/Microsoft.WSMan.Management/Set-WSManInstance.md index 4657e4258c9b..4193658ab29b 100644 --- a/reference/7.1/Microsoft.WSMan.Management/Set-WSManInstance.md +++ b/reference/7.1/Microsoft.WSMan.Management/Set-WSManInstance.md @@ -2,7 +2,7 @@ external help file: Microsoft.WSMan.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.WSMan.Management -ms.date: 06/09/2017 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.wsman.management/set-wsmaninstance?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Set-WSManInstance @@ -37,7 +37,7 @@ Set-WSManInstance [-ConnectionURI <Uri>] [-Dialect <Uri>] [-FilePath <String>] [ > **This cmdlet is only available on the Windows platform.** -The Set-WSManInstance cmdlet modifies the management information that is related to a resource. +The `Set-WSManInstance` cmdlet modifies the management information that is related to a resource. This cmdlet uses the WinRM connection/transport layer to modify the information. @@ -63,9 +63,10 @@ CertificateThumbprint : ListeningOn : {127.0.0.1, 172.30.168.171, ::1, 2001:4898:0:fff:0:5efe:172.30.168.171...} ``` -This command disables the https listener on the local computer. +This command disables the HTTPS listener on the local computer. -Important: The *ValueSet* parameter is case-sensitive when matching the properties specified. +> [!IMPORTANT] +> The **ValueSet** parameter is case-sensitive when matching the properties specified. For example, in this command, @@ -91,15 +92,16 @@ Service : Service Winrs : Winrs ``` -This command sets the MaxEnvelopeSizekb value to 200 on the local computer. +This command sets the **MaxEnvelopeSizekb** value to 200 on the local computer. -Important: The ValueSet parameter is case-sensitive when matching the properties specified. +> [!IMPORTANT] +> The **ValueSet** parameter is case-sensitive when matching the properties specified. For example, using the above command. -This fails: -ValueSet @{MaxEnvelopeSizeKB ="200"} +This fails: `-ValueSet @{MaxEnvelopeSizeKB ="200"}` -This succeeds: -ValueSet @{MaxEnvelopeSizekb ="200"} +This succeeds: `-ValueSet @{MaxEnvelopeSizekb ="200"}` ### Example 3: Disable a listener on a remote computer @@ -121,34 +123,35 @@ CertificateThumbprint : ListeningOn : {127.0.0.1, 172.30.168.172, ::1, 2001:4898:0:fff:0:5efe:172.30.168.172...} ``` -This command disables the https listener on the remote computer SERVER02. +This command disables the HTTPS listener on the remote computer SERVER02. -Important: The ValueSet parameter is case-sensitive when matching the properties specified. +> [!IMPORTANT] +> The **ValueSet** parameter is case-sensitive when matching the properties specified. For example, using the above command. -This fails: -ValueSet @{enabled="False"} +This fails: `-ValueSet @{enabled="False"}` -This succeeds: -ValueSet @{Enabled="False"} +This succeeds: `-ValueSet @{Enabled="False"}` ## PARAMETERS ### -ApplicationName -Specifies the application name in the connection. -The default value of the ApplicationName parameter is "WSMAN". -The complete identifier for the remote endpoint is in the following format: +Specifies the application name in the connection. The default value of the **ApplicationName** +parameter is "WSMAN". The complete identifier for the remote endpoint is in the following format: -\<transport\>://\<server\>:\<port\>/\<ApplicationName\> +`<transport>://<server>:<port>/<ApplicationName>` For example: `http://server01:8080/WSMAN` -Internet Information Services (IIS), which hosts the session, forwards requests with this endpoint to the specified application. -This default setting of "WSMAN" is appropriate for most uses. -This parameter is designed to be used when numerous computers establish remote connections to one computer that is running Windows PowerShell. -In this case, IIS hosts Web Services for Management (WS-Management ) for efficiency. +Internet Information Services (IIS), which hosts the session, forwards requests with this endpoint +to the specified application. This default setting of `WSMAN` is appropriate for most uses. This +parameter is designed to be used when numerous computers establish remote connections to one +computer that is running Windows PowerShell. In this case, IIS hosts Web Services for Management +(WS-Management) for efficiency. ```yaml Type: System.String @@ -167,16 +170,26 @@ Accept wildcard characters: False Specifies the authentication mechanism to be used at the server. Possible values are: -- Basic: Basic is a scheme in which the user name and password are sent in clear text to the server or proxy. -- Default : Use the authentication method implemented by the WS-Management protocol. This is the default. -- Digest: Digest is a challenge-response scheme that uses a server-specified data string for the challenge. -- Kerberos: The client computer and the server mutually authenticate by using Kerberos certificates. -- Negotiate: Negotiate is a challenge-response scheme that negotiates with the server or proxy to determine the scheme to use for authentication. For example, this parameter value allows negotiation to determine whether the Kerberos protocol or NTLM is used. -- CredSSP: Use Credential Security Support Provider (CredSSP) authentication, which allows the user to delegate credentials. This option is designed for commands that run on one remote computer but collect data from or run additional commands on other remote computers. - -Caution: CredSSP delegates the user's credentials from the local computer to a remote computer. -This practice increases the security risk of the remote operation. -If the remote computer is compromised, when credentials are passed to it, the credentials can be used to control the network session. +- `Basic`: Basic is a scheme in which the user name and password are sent in clear text to the + server or proxy. +- `Default` : Use the authentication method implemented by the WS-Management protocol. This is the + default. +- `Digest`: Digest is a challenge-response scheme that uses a server-specified data string for the + challenge. +- `Kerberos`: The client computer and the server mutually authenticate by using Kerberos + certificates. +- `Negotiate`: Negotiate is a challenge-response scheme that negotiates with the server or proxy to + determine the scheme to use for authentication. For example, this parameter value allows + negotiation to determine whether the Kerberos protocol or NTLM is used. +- `CredSSP`: Use Credential Security Support Provider (CredSSP) authentication, which allows the + user to delegate credentials. This option is designed for commands that run on one remote computer + but collect data from or run additional commands on other remote computers. + +> [!CAUTION] +> CredSSP delegates the user's credentials from the local computer to a remote computer. This +> practice increases the security risk of the remote operation. If the remote computer is +> compromised, when credentials are passed to it, the credentials can be used to control the network +> session. ```yaml Type: Microsoft.WSMan.Management.AuthenticationMechanism @@ -192,13 +205,14 @@ Accept wildcard characters: False ### -CertificateThumbprint -Specifies the digital public key certificate (X509) of a user account that has permission to perform this action. -Enter the certificate thumbprint of the certificate. +Specifies the digital public key certificate (X509) of a user account that has permission to perform +this action. Enter the certificate thumbprint of the certificate. -Certificates are used in client certificate-based authentication. -They can be mapped only to local user accounts; they do not work with domain accounts. +Certificates are used in client certificate-based authentication. They can be mapped only to local +user accounts; they do not work with domain accounts. -To get a certificate thumbprint, use the Get-Item or Get-ChildItem command in the PowerShell Cert: drive. +To get a certificate thumbprint, use the `Get-Item` or `Get-ChildItem` command in the PowerShell +`Cert:` drive. ```yaml Type: System.String @@ -214,12 +228,12 @@ Accept wildcard characters: False ### -ComputerName -Specifies the computer against which you want to run the management operation. -The value can be a fully qualified domain name, a NetBIOS name, or an IP address. -Use the local computer name, use localhost, or use a dot (.) to specify the local computer. -The local computer is the default. -When the remote computer is in a different domain from the user, you must use a fully qualified domain name must be used. -You can pipe a value for this parameter to the cmdlet. +Specifies the computer against which you want to run the management operation. The value can be a +fully qualified domain name, a NetBIOS name, or an IP address. Use the local computer name, +`localhost`, or a dot (`.`) to specify the local computer. The local computer is the default. + +When the remote computer is in a different domain from the user, you must use a fully qualified +domain name. You can pipe a value for this parameter to the cmdlet. ```yaml Type: System.String @@ -235,16 +249,15 @@ Accept wildcard characters: False ### -ConnectionURI -Specifies the connection endpoint. -The format of this string is: +Specifies the connection endpoint. The format of this string is: -\<Transport\>://\<Server\>:\<Port\>/\<ApplicationName\> +`<Transport>://<Server>:<Port>/<ApplicationName>` The following string is a properly formatted value for this parameter: `http://Server01:8080/WSMAN` -The URI must be fully qualified . +The URI must be fully qualified. ```yaml Type: System.Uri @@ -260,11 +273,10 @@ Accept wildcard characters: False ### -Credential -Specifies a user account that has permission to perform this action. -The default is the current user. -Type a user name, such as "User01", "Domain01\User01", or "User@Domain.com". -Or, enter a PSCredential object, such as one returned by the Get-Credential cmdlet. -When you type a user name, you will be prompted for a password. +Specifies a user account that has permission to perform this action. The default is the current +user. Type a user name, such as `User01`, `Domain01\User01`, or `User@Domain.com`. Alternatively, +enter a **PSCredential** object, such as one returned by the `Get-Credential` cmdlet. When you type +a user name, you will be prompted for a password. ```yaml Type: System.Management.Automation.PSCredential @@ -280,13 +292,12 @@ Accept wildcard characters: False ### -Dialect -Specifies the dialect to use in the filter predicate. -This can be any dialect that is supported by the remote service. -The following aliases can be used for the dialect URI: +Specifies the dialect to use in the filter predicate. This can be any dialect that is supported by +the remote service. The following aliases can be used for the dialect URI: -- WQL: `http://schemas.microsoft.com/wbem/wsman/1/WQL` -- Selector: `http://schemas.microsoft.com/wbem/wsman/1/wsman/SelectorFilter` -- Association: `http://schemas.dmtf.org/wbem/wsman/1/cimbinding/associationFilter` +- `WQL`: `http://schemas.microsoft.com/wbem/wsman/1/WQL` +- `Selector`: `http://schemas.microsoft.com/wbem/wsman/1/wsman/SelectorFilter` +- `Association`: `http://schemas.dmtf.org/wbem/wsman/1/cimbinding/associationFilter` ```yaml Type: System.Uri @@ -302,14 +313,14 @@ Accept wildcard characters: False ### -FilePath -Specifies the path of a file that is used to update a management resource. -You specify the management resource by using the ResourceURI parameter and the SelectorSet parameter . -For example, the following command uses the FilePath parameter: +Specifies the path of a file that is used to update a management resource. You specify the +management resource by using the **ResourceURI** parameter and the **SelectorSet** parameter. For +example, the following command uses the **FilePath** parameter: -`Invoke-WSManAction -action StopService -resourceuri wmicimv2/Win32_Service -SelectorSet @{Name="spooler"} -FilePath:c:\input.xml -authentication default` +`Invoke-WSManAction -Action StopService -ResourceUri wmicimv2/Win32_Service -SelectorSet @{Name="spooler"} -FilePath:c:\input.xml -authentication default` -This command calls the StopService method on the Spooler service by using input from a file. -The file, Input.xml, contains the following content: +This command calls the **StopService** method on the Spooler service by using input from a file. +The file, `Input.xml`, contains the following content: `<p:StopService_INPUT xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Service" />` @@ -327,8 +338,8 @@ Accept wildcard characters: False ### -Fragment -Specifies a section inside the instance that is to be updated or retrieved for the specified operation. -For example, to get the status of a spooler service, specify "-Fragment Status". +Specifies a section inside the instance that is to be updated or retrieved for the specified +operation. For example, to get the status of a spooler service, specify `-Fragment Status`. ```yaml Type: System.String @@ -348,9 +359,10 @@ Passes a set of switches to a service to modify or refine the nature of the requ These are similar to switches used in command-line shells because they are service specific. Any number of options can be specified. -The following example demonstrates the syntax that passes the values 1, 2, and 3 for the a, b, and c parameters: +The following example demonstrates the syntax that passes the values `1`, `2`, and `3` for the `a`, +`b`, and `c` parameters: --OptionSet @{a=1;b=2;c=3} +`-OptionSet @{a=1;b=2;c=3}` ```yaml Type: System.Collections.Hashtable @@ -366,12 +378,14 @@ Accept wildcard characters: False ### -Port -Specifies the port to use when the client connects to the WinRM service. -When the transport is HTTP, the default port is 80. -When the transport is HTTPS, the default port is 443. -When you use HTTPS as the transport, the value of the ComputerName parameter must match the server's certificate common name (CN). -However, if the SkipCNCheck parameter is specified as part of the SessionOption parameter, then the certificate common name of the server does not have to match the host name of the server. -The SkipCNCheck parameter should be used only for trusted machines. +Specifies the port to use when the client connects to the WinRM service. When the transport is HTTP, +the default port is 80. When the transport is HTTPS, the default port is 443. + +When you use HTTPS as the transport, the value of the **ComputerName** parameter must match the +server's certificate common name (CN). However, if the **SkipCNCheck** parameter is specified as +part of the **SessionOption** parameter, then the certificate common name of the server does not +have to match the host name of the server. The **SkipCNCheck** parameter should be used only for +trusted machines. ```yaml Type: System.Int32 @@ -412,11 +426,11 @@ Accept wildcard characters: False ### -SelectorSet Specifies a set of value pairs that are used to select particular management resource instances. -The SelectorSet parameter is used when more than one instance of the resource exists. -The value of the SelectorSet parameter must be a hash table. +The **SelectorSet** parameter is used when more than one instance of the resource exists. +The value of the **SelectorSet** parameter must be a hash table. The following example shows how to enter a value for this parameter: --SelectorSet @{Name="WinRM";ID="yyy"} +`-SelectorSet @{Name="WinRM";ID="yyy"}` ```yaml Type: System.Collections.Hashtable @@ -432,9 +446,9 @@ Accept wildcard characters: False ### -SessionOption -Defines a set of extended options for the WS-Management session. -Enter a SessionOption object that you create by using the New-WSManSessionOption cmdlet. -For more information about the options that are available, see New-WSManSessionOption. +Defines a set of extended options for the WS-Management session. Enter a **SessionOption** object +that you create with the `New-WSManSessionOption` cmdlet. For more information about the options +that are available, see [New-WSManSessionOption](New-WSManSessionOption.md). ```yaml Type: Microsoft.WSMan.Management.SessionOption @@ -450,12 +464,13 @@ Accept wildcard characters: False ### -UseSSL -Specifies that the Secure Sockets Layer (SSL) protocol should be used to establish a connection to the remote computer. -By default, SSL is not used. +Specifies that the Secure Sockets Layer (SSL) protocol should be used to establish a connection to +the remote computer. By default, SSL is not used. -WS-Management encrypts all the Windows PowerShell content that is transmitted over the network. -The UseSSL parameter lets you specify the additional protection of HTTPS instead of HTTP. -If SSL is not available on the port that is used for the connection and you specify this parameter, the command fails. +WS-Management encrypts all the Windows PowerShell content that is transmitted over the network. The +**UseSSL** parameter lets you specify the additional protection of HTTPS instead of HTTP. If SSL is +not available on the port that is used for the connection and you specify this parameter, the +command fails. ```yaml Type: System.Management.Automation.SwitchParameter @@ -471,9 +486,9 @@ Accept wildcard characters: False ### -ValueSet -Specifies a hash table that helps modify a management resource. -You specify the management resource by using the ResourceURI parameter and the SelectorSet parameter. -The value of the ValueSet parameter must be a hash table. +Specifies a hash table that helps modify a management resource. You specify the management resource +by using the **ResourceURI** parameter and the **SelectorSet** parameter. The value of the +**ValueSet** parameter must be a hash table. ```yaml Type: System.Collections.Hashtable @@ -489,7 +504,10 @@ Accept wildcard characters: False ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). ## INPUTS @@ -530,4 +548,3 @@ This cmdlet does not generate any output. [Set-WSManQuickConfig](Set-WSManQuickConfig.md) [Test-WSMan](Test-WSMan.md) - diff --git a/reference/7.2/CimCmdlets/Remove-CimInstance.md b/reference/7.2/CimCmdlets/Remove-CimInstance.md index dd9e05f48351..7022aa6f2cf4 100644 --- a/reference/7.2/CimCmdlets/Remove-CimInstance.md +++ b/reference/7.2/CimCmdlets/Remove-CimInstance.md @@ -2,7 +2,7 @@ external help file: Microsoft.Management.Infrastructure.CimCmdlets.dll-Help.xml Locale: en-US Module Name: CimCmdlets -ms.date: 06/21/2021 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/cimcmdlets/remove-ciminstance?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 title: Remove-CimInstance @@ -153,7 +153,7 @@ Accept wildcard characters: False ### -Namespace -Specifies the namespace for the CIM operation. The default namespace is **root/cimv2**. You can use +Specifies the namespace for the CIM operation. The default namespace is `root/cimv2`. You can use tab completion to browse the list of namespaces, because PowerShell gets a list of namespaces from the local WMI server to provide the list of namespaces. @@ -172,7 +172,7 @@ Accept wildcard characters: False ### -OperationTimeoutSec Specifies the amount of time that the cmdlet waits for a response from the computer. By default, the -value of this parameter is 0, which means that the cmdlet uses the default timeout value for the +value of this parameter is `0`, which means that the cmdlet uses the default timeout value for the server. If the **OperationTimeoutSec** parameter is set to a value less than the robust connection retry @@ -199,7 +199,7 @@ Specifies a query to run on the CIM server. You can specify the query dialect us If the value specified contains double quotes (`"`), single quotes (`'`), or a backslash (`\`), you must escape those characters by prefixing them with the backslash (`\`) character. If the value -specified uses the WQL LIKE operator, then you must escape the following characters by enclosing +specified uses the WQL `LIKE` operator, then you must escape the following characters by enclosing them in square brackets (`[]`): percent (`%`), underscore (`_`), or opening square bracket (`[`). ```yaml @@ -217,7 +217,7 @@ Accept wildcard characters: False ### -QueryDialect Specifies the query language used for the Query parameter. The acceptable values for this parameter -are: **WQL** or **CQL**. The default value is **WQL**. +are: `WQL` or `CQL`. The default value is `WQL`. ```yaml Type: System.String @@ -247,7 +247,8 @@ By default, if you do not specify this parameter, the DMTF standard resource URI ResourceURI can only be used with CIM sessions created using the WSMan protocol, or when specifying the ComputerName parameter, which creates a CIM session using WSMan. If you specify this parameter without specifying the ComputerName parameter, or if you specify a CIM session created using DCOM -protocol, you get an error, because the DCOM protocol does not support the ResourceURI parameter. +protocol, you get an error, because the DCOM protocol does not support the **ResourceURI** +parameter. If both the **ResourceUri** parameter and the **Filter** parameter are specified, the **Filter** parameter is ignored. @@ -324,4 +325,3 @@ This cmdlet produces no outputs. [Get-CimInstance](get-ciminstance.md) [Set-CimInstance](Set-CimInstance.md) - diff --git a/reference/7.2/Microsoft.PowerShell.Diagnostics/Get-Counter.md b/reference/7.2/Microsoft.PowerShell.Diagnostics/Get-Counter.md index 23a08feb4c90..98f1026a2eba 100644 --- a/reference/7.2/Microsoft.PowerShell.Diagnostics/Get-Counter.md +++ b/reference/7.2/Microsoft.PowerShell.Diagnostics/Get-Counter.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Diagnostics.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Diagnostics -ms.date: 06/21/2021 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.diagnostics/get-counter?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-Counter @@ -417,7 +417,7 @@ Path InstanceName CookedValue `Get-Counter` uses the **Counter** parameter to specify the counter `\Processor(*)\% Processor Time`. The values are stored in the `$Counter` variable. The objects stored in `$Counter.CounterSamples` are sent down the pipeline. `Where-Object` uses a script block -to compare each objects value against a specified value of 20. The `$_.CookedValue` is a variable +to compare each objects value against a specified value of `20`. The `$_.CookedValue` is a variable for the current object in the pipeline. Counters with a **CookedValue** that is less than 20 are displayed. @@ -609,7 +609,8 @@ Accept wildcard characters: False This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, --WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS @@ -661,4 +662,3 @@ In PowerShell 7, when using the **ListSet** parameter, `Get-Counter` can't retri [Start-Job](../Microsoft.PowerShell.Core/Start-Job.md) [Where-Object](..//Microsoft.PowerShell.Core/Where-Object.md) - diff --git a/reference/7.2/Microsoft.PowerShell.Management/Add-Content.md b/reference/7.2/Microsoft.PowerShell.Management/Add-Content.md index bb5f0c2b1082..07cb25ecdeb5 100644 --- a/reference/7.2/Microsoft.PowerShell.Management/Add-Content.md +++ b/reference/7.2/Microsoft.PowerShell.Management/Add-Content.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 11/03/2021 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/add-content?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 title: Add-Content @@ -146,7 +146,7 @@ Mode LastWriteTime Length Name `IsReadOnlyTextFile.txt` in the current directory. - The `Set-ItemProperty` cmdlet uses the **Name** and **Value** parameters to change the file's **IsReadOnly** property to True. -- The `Get-ChildItem` cmdlet shows the file is empty (0) and has the read-only attribute (`r`). +- The `Get-ChildItem` cmdlet shows the file is empty (`0`) and has the read-only attribute (`r`). - The `Add-Content` cmdlet uses the **Path** parameter to specify the file. The **Value** parameter includes the text string to append to the file. The **Force** parameter writes the text to the read-only file. diff --git a/reference/7.2/Microsoft.PowerShell.Management/Get-PSDrive.md b/reference/7.2/Microsoft.PowerShell.Management/Get-PSDrive.md index 7cbabb317340..8b61e5262a36 100644 --- a/reference/7.2/Microsoft.PowerShell.Management/Get-PSDrive.md +++ b/reference/7.2/Microsoft.PowerShell.Management/Get-PSDrive.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 05/14/2019 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/get-psdrive?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-PSDrive @@ -213,7 +213,7 @@ Accept wildcard characters: False ### -Name Specifies, as a string array, the name or name of drives that this cmdlet gets in the operation. -Type the drive name or letter without a colon (:). +Type the drive name or letter without a colon (`:`). ```yaml Type: System.String[] @@ -308,4 +308,3 @@ This cmdlet returns objects that represent the drives in the session. [Remove-PSDrive](Remove-PSDrive.md) [Get-PSProvider](Get-PSProvider.md) - diff --git a/reference/7.2/Microsoft.PowerShell.Management/Get-PSProvider.md b/reference/7.2/Microsoft.PowerShell.Management/Get-PSProvider.md index f35df6a23b6e..b5f7c8159de9 100644 --- a/reference/7.2/Microsoft.PowerShell.Management/Get-PSProvider.md +++ b/reference/7.2/Microsoft.PowerShell.Management/Get-PSProvider.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 05/26/2021 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/get-psprovider?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-PSProvider @@ -108,7 +108,7 @@ PS C:\> (get-psprovider FileSystem).home C:\Users\User01 ``` -This example shows that the tilde symbol (~) represents the value of the **Home** property of the +This example shows that the tilde symbol (`~`) represents the value of the **Home** property of the FileSystem provider. The **Home** property value is optional, but for the **FileSystem** provider, it is defined as `$env:homedrive\$env:homepath` or `$home`. diff --git a/reference/7.2/Microsoft.PowerShell.Management/Get-Process.md b/reference/7.2/Microsoft.PowerShell.Management/Get-Process.md index bff6fafef1f3..1c571a9d12dd 100644 --- a/reference/7.2/Microsoft.PowerShell.Management/Get-Process.md +++ b/reference/7.2/Microsoft.PowerShell.Management/Get-Process.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 06/09/2017 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/get-process?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-Process @@ -82,8 +82,8 @@ Get-Process winword, explorer | Format-List * This command gets all available data about the Winword and Explorer processes on the computer. It uses the **Name** parameter to specify the processes, but it omits the optional parameter name. The -pipeline operator `|` passes the data to the `Format-List` cmdlet, which displays all available -properties `*` of the Winword and Explorer process objects. +pipeline operator (`|`) passes the data to the `Format-List` cmdlet, which displays all available +properties (`*`) of the Winword and Explorer process objects. You can also identify the processes by their process IDs. For instance, `Get-Process -Id 664, 2060`. @@ -94,7 +94,7 @@ Get-Process | Where-Object {$_.WorkingSet -gt 20000000} ``` This command gets all processes that have a working set greater than 20 MB. It uses the -`Get-Process` cmdlet to get all running processes. The pipeline operator `|` passes the process +`Get-Process` cmdlet to get all running processes. The pipeline operator (`|`) passes the process objects to the `Where-Object` cmdlet, which selects only the object with a value greater than 20,000,000 bytes for the **WorkingSet** property. @@ -156,10 +156,10 @@ ProductVersion FileVersion FileName ``` This command uses the **FileVersionInfo** parameter to get the version information for the -pwsh.exe file that is the main module for the PowerShell process. +`pwsh.exe` file that is the main module for the PowerShell process. To run this command with processes that you do not own on Windows Vista and later versions of -Windows, you must open PowerShell with the Run as administrator option. +Windows, you must open PowerShell with the **Run as administrator** option. ### Example 7: Get modules loaded with the specified process @@ -168,10 +168,10 @@ Get-Process SQL* -Module ``` This command uses the **Module** parameter to get the modules that have been loaded by the process. -This command gets the modules for the processes that have names that begin with SQL. +This command gets the modules for the processes that have names that begin with `SQL`. To run this command on Windows Vista and later versions of Windows with processes that you do not -own, you must start PowerShell with the Run as administrator option. +own, you must start PowerShell with the **Run as administrator** option. ### Example 8: Find the owner of a process @@ -186,8 +186,9 @@ Handles WS(K) CPU(s) Id UserName ProcessName ``` This command shows how to find the owner of a process. -On Windows, the **IncludeUserName** parameter requires elevated user rights (Run as Administrator). -The output reveals that the owner is Domain01\user01. +On Windows, the **IncludeUserName** parameter requires elevated user rights +(**Run as Administrator**). +The output reveals that the owner is `Domain01\user01`. ### Example 9: Use an automatic variable to identify the process hosting the current session @@ -240,8 +241,8 @@ command to the `Get-Member` cmdlet `Get-Process | Get-Member`. Indicates that this cmdlet gets the file version information for the program that runs in the process. -On Windows Vista and later versions of Windows, you must open PowerShell with the Run as -administrator option to use this parameter on processes that you do not own. +On Windows Vista and later versions of Windows, you must open PowerShell with the **Run as +administrator** option to use this parameter on processes that you do not own. To get file version information for a process on a remote computer, use the `Invoke-Command` cmdlet. @@ -345,7 +346,7 @@ Accept wildcard characters: False ### -Name Specifies one or more processes by process name. You can type multiple process names (separated by -commas) and use wildcard characters. The parameter name ("Name") is optional. +commas) and use wildcard characters. The parameter name (`Name`) is optional. ```yaml Type: System.String[] @@ -383,26 +384,27 @@ use the **Module** parameter, without the **FileVersionInfo** parameter, it retu ## NOTES -- You can also refer to this cmdlet by its built-in aliases, ps and gps. For more information, see - [about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). +- You can also refer to this cmdlet by its built-in aliases, `ps` and `gps`. For more information, + see [about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). - On computers that are running a 64-bit version of Windows, the 64-bit version of PowerShell gets only 64-bit process modules and the 32-bit version of PowerShell gets only 32-bit process modules. - You can use the properties and methods of the Windows Management Instrumentation (WMI) - Win32_Process object in PowerShell. For information, see `Get-WmiObject` and the WMI SDK. + **Win32_Process** object in PowerShell. For information, see `Get-WmiObject` and the WMI SDK. - The default display of a process is a table that includes the following columns. For a description of all of the properties of process objects, see [Process Properties](/dotnet/api/system.diagnostics.process). - - Handles: The number of handles that the process has opened. - - NPM(K): The amount of non-paged memory that the process is using, in kilobytes. - - PM(K): The amount of pageable memory that the process is using, in kilobytes. - - WS(K): The size of the working set of the process, in kilobytes. - The working set consists of the pages of memory that were recently referenced by the process. - - VM(M): The amount of virtual memory that the process is using, in megabytes. - Virtual memory includes storage in the paging files on disk. - - CPU(s): The amount of processor time that the process has used on all processors, in seconds. - - ID: The process ID (PID) of the process. - - ProcessName: The name of the process. For explanations of the concepts related to processes, see - the Glossary in Help and Support Center and the Help for Task Manager. + - **Handles**: The number of handles that the process has opened. + - **NPM(K)**: The amount of non-paged memory that the process is using, in kilobytes. + - **PM(K)**: The amount of pageable memory that the process is using, in kilobytes. + - **WS(K)**: The size of the working set of the process, in kilobytes. The working set consists of + the pages of memory that were recently referenced by the process. + - **VM(M)**: The amount of virtual memory that the process is using, in megabytes. Virtual memory + includes storage in the paging files on disk. + - **CPU(s)**: The amount of processor time that the process has used on all processors, in + seconds. + - **ID**: The process ID (PID) of the process. + - **ProcessName**: The name of the process. For explanations of the concepts related to processes, + see the Glossary in Help and Support Center and the Help for Task Manager. - You can also use the built-in alternate views of the processes available with `Format-Table`, such as **StartTime** and **Priority**, and you can design your own views. diff --git a/reference/7.2/Microsoft.PowerShell.Management/Get-Service.md b/reference/7.2/Microsoft.PowerShell.Management/Get-Service.md index d3067b335124..6259d6fa45ae 100644 --- a/reference/7.2/Microsoft.PowerShell.Management/Get-Service.md +++ b/reference/7.2/Microsoft.PowerShell.Management/Get-Service.md @@ -2,12 +2,11 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 10/30/2019 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/get-service?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-Service --- - # Get-Service ## SYNOPSIS @@ -61,7 +60,7 @@ Get-Service ### Example 2: Get services that begin with a search string -This example retrieves services with service names that begin with WMI (Windows Management +This example retrieves services with service names that begin with `WMI` (Windows Management Instrumentation). ```powershell @@ -70,8 +69,8 @@ Get-Service "wmi*" ### Example 3: Display services that include a search string -This example displays services with a display name that includes the word network. Searching the -display name finds network-related services even when the service name doesn't include Net, such as +This example displays services with a display name that includes the word `network`. Searching the +display name finds network-related services even when the service name doesn't include `Net`, such as xmlprov, the Network Provisioning Service. ```powershell @@ -80,7 +79,7 @@ Get-Service -Displayname "*network*" ### Example 4: Get services that begin with a search string and an exclusion -This example only gets the services with service names that begin with **win**, except for the WinRM +This example only gets the services with service names that begin with `win`, except for the WinRM service. ```powershell @@ -89,14 +88,14 @@ Get-Service -Name "win*" -Exclude "WinRM" ### Example 5: Display services that are currently active -This example displays only the services with a status of Running. +This example displays only the services with a status of `Running`. ```powershell Get-Service | Where-Object {$_.Status -eq "Running"} ``` `Get-Service` gets all the services on the computer and sends the objects down the pipeline. The -`Where-Object` cmdlet, selects only the services with a **Status** property that equals Running. +`Where-Object` cmdlet, selects only the services with a **Status** property that equals `Running`. Status is only one property of service objects. To see all of the properties, type `Get-Service | Get-Member`. @@ -135,9 +134,9 @@ displays the number of dependent services for each service. ### Example 7: Sort services by property value This example shows that when you sort services in ascending order by the value of their **Status** -property, stopped services appear before running services. The reason is because the value of -**Status** is an enumeration, in which Stopped has a value of 1, and Running has a value of 4. For -more information, see +property, stopped services appear before running services. This happens because the value of +**Status** is an enumeration, in which `Stopped` has a value of `1`, and `Running` has a value of +`4`. For more information, see [ServiceControllerStatus](/dotnet/api/system.serviceprocess.servicecontrollerstatus). To list running services first, use the **Descending** parameter of the `Sort-Object` cmdlet. @@ -338,12 +337,13 @@ This cmdlet can display services only when the current user has permission to se cmdlet does not display services, you might not have permission to see them. To find the service name and display name of each service on your system, type `Get-Service`. The -service names appear in the Name column, and the display names appear in the **DisplayName** column. +service names appear in the **Name** column, and the display names appear in the **DisplayName** +column. -When you sort in ascending order by the **Status** property's value, Stopped services appear before -Running services. The service's **Status** property is an enumerated value and the status names -represent integer values. The sort order is based on the integer value, not the name. Stopped -appears before because Running because Stopped has a value of 1, and Running has a value of 4. For +When you sort in ascending order by status value, `Stopped` services appear before `Running` +services. The **Status** property of a service is an enumerated value in which the names of the +statuses represent integer values. The sort is based on the integer value, not the name. `Running` +appears before `Stopped` because `Stopped` has a value of `1`, and `Running` has a value of `4`. For more information, see [ServiceControllerStatus](/dotnet/api/system.serviceprocess.servicecontrollerstatus). diff --git a/reference/7.2/Microsoft.PowerShell.Management/New-ItemProperty.md b/reference/7.2/Microsoft.PowerShell.Management/New-ItemProperty.md index 024ca2b95b79..195e39bf47af 100644 --- a/reference/7.2/Microsoft.PowerShell.Management/New-ItemProperty.md +++ b/reference/7.2/Microsoft.PowerShell.Management/New-ItemProperty.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 04/28/2022 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/new-itemproperty?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 title: New-ItemProperty @@ -45,10 +45,10 @@ This cmdlet does not add properties to an object. ### Example 1: Add a registry entry -This command adds a new registry entry, "NoOfEmployees", to the "MyCompany" key of the -"HKLM:\Software hive". +This command adds a new registry entry, `NoOfEmployees`, to the `MyCompany` key of the +`HKLM:\Software hive`. -The first command uses the **Path** parameter to specify the path of the "MyCompany" registry key. +The first command uses the **Path** parameter to specify the path of the `MyCompany` registry key. It uses the **Name** parameter to specify a name for the entry and the **Value** parameter to specify its value. @@ -71,25 +71,25 @@ NoOfEmployees : 822 ### Example 2: Add a registry entry to a key -This command adds a new registry entry to a registry key. -To specify the key, it uses a pipeline operator (`|`) to send an object that represents the key to -`New-ItemProperty`. +This command adds a new registry entry to a registry key. To specify the key, it uses a pipeline +operator (`|`) to send an object that represents the key to `New-ItemProperty`. -The first part of the command uses the `Get-Item` cmdlet to get the "MyCompany" registry key. -The pipeline operator sends the results of the command to `New-ItemProperty`, which adds the new -registry entry ("NoOfLocations"), and its value (3), to the "MyCompany" key. +The first part of the command uses the `Get-Item` cmdlet to get the `MyCompany` registry key. The +pipeline operator sends the results of the command to `New-ItemProperty`, which adds the new +registry entry (`NoOfLocations`), and its value (`3`), to the `MyCompany` key. ```powershell Get-Item -Path "HKLM:\Software\MyCompany" | New-ItemProperty -Name NoOfLocations -Value 3 ``` This command works because the parameter-binding feature of PowerShell associates the path of the -`RegistryKey` object that `Get-Item` returns with the **LiteralPath** parameter of -`New-ItemProperty`. For more information, see [about_Pipelines](../Microsoft.PowerShell.Core/About/about_pipelines.md). +**RegistryKey** object that `Get-Item` returns with the **LiteralPath** parameter of +`New-ItemProperty`. For more information, see +[about_Pipelines](../Microsoft.PowerShell.Core/About/about_pipelines.md). ### Example 3: Create a MultiString value in the registry using a Here-String -This example creates a MultiString value using a Here-String. +This example creates a `MultiString` value using a Here-String. ```powershell $newValue = New-ItemProperty -Path "HKLM:\SOFTWARE\ContosoCompany\" -Name 'HereString' -PropertyType MultiString -Value @" @@ -121,6 +121,13 @@ a ### -Credential +Specifies a user account that has permission to perform this action. +The default is the current user. + +Type a user name, such as `User01` or `Domain01\User01`, or enter a **PSCredential** object, such as +one generated by the `Get-Credential` cmdlet. If you type a user name, you are prompted for a +password. + > [!NOTE] > This parameter is not supported by any providers installed with PowerShell. > To impersonate another user, or elevate your credentials when running this cmdlet, @@ -160,11 +167,13 @@ Accept wildcard characters: True ### -Filter -Specifies a filter to qualify the **Path** parameter. The [FileSystem](../Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md) -provider is the only installed PowerShell provider that supports the use of filters. You can find -the syntax for the **FileSystem** filter language in [about_Wildcards](../Microsoft.PowerShell.Core/About/about_Wildcards.md). -Filters are more efficient than other parameters, because the provider applies them when the cmdlet -gets the objects rather than having PowerShell filter the objects after they are retrieved. +Specifies a filter to qualify the **Path** parameter. The +[FileSystem](../Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md) provider is the only +installed PowerShell provider that supports the use of filters. You can find the syntax for the +**FileSystem** filter language in +[about_Wildcards](../Microsoft.PowerShell.Core/About/about_Wildcards.md). Filters are more efficient +than other parameters, because the provider applies them when the cmdlet gets the objects rather +than having PowerShell filter the objects after they are retrieved. ```yaml Type: System.String @@ -200,7 +209,7 @@ Accept wildcard characters: False Specifies, as a string array, an item or items that this cmdlet includes in the operation. The value of this parameter qualifies the **Path** parameter. Enter a path element or pattern, such as -`"*.txt"`. Wildcard characters are permitted. The **Include** parameter is effective only when the +`*.txt`. Wildcard characters are permitted. The **Include** parameter is effective only when the command includes the contents of an item, such as `C:\Windows\*`, where the wildcard character specifies the contents of the `C:\Windows` directory. @@ -220,10 +229,11 @@ Accept wildcard characters: True Specifies a path to one or more locations. The value of **LiteralPath** is used exactly as it is typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose -it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters -as escape sequences. +it in single quotation marks (`'`). Single quotation marks tell PowerShell not to interpret any +characters as escape sequences. -For more information, see [about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). +For more information, see +[about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). ```yaml Type: System.String[] @@ -372,7 +382,8 @@ You cannot pipe input to this cmdlet. ## NOTES `New-ItemProperty` is designed to work with the data exposed by any provider. To list the providers -available in your session, type `Get-PSProvider`. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). +available in your session, type `Get-PSProvider`. For more information, see +[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). ## RELATED LINKS @@ -391,4 +402,3 @@ available in your session, type `Get-PSProvider`. For more information, see [abo [Set-ItemProperty](Set-ItemProperty.md) [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md) - diff --git a/reference/7.2/Microsoft.PowerShell.Management/Remove-PSDrive.md b/reference/7.2/Microsoft.PowerShell.Management/Remove-PSDrive.md index fa3aeeb42c12..1b113b9f2aea 100644 --- a/reference/7.2/Microsoft.PowerShell.Management/Remove-PSDrive.md +++ b/reference/7.2/Microsoft.PowerShell.Management/Remove-PSDrive.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 06/09/2017 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/remove-psdrive?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 title: Remove-PSDrive @@ -30,21 +30,24 @@ Remove-PSDrive [-LiteralName] <String[]> [-PSProvider <String[]>] [-Scope <Strin ## DESCRIPTION -The `Remove-PSDrive` cmdlet deletes temporary PowerShell drives that were created by using the `New-PSDrive` cmdlet. +The `Remove-PSDrive` cmdlet deletes temporary PowerShell drives that were created by using the +`New-PSDrive` cmdlet. -Beginning in Windows PowerShell 3.0, `Remove-PSDrive` also disconnects mapped network drives, including, but not limited to, drives created by using the `Persist` parameter of `New-PSDrive`. +Beginning in Windows PowerShell 3.0, `Remove-PSDrive` also disconnects mapped network drives, +including, but not limited to, drives created by using the **Persist** parameter of `New-PSDrive`. `Remove-PSDrive` cannot delete Windows physical or logical drives. -Beginning in Windows PowerShell 3.0, when an external drive is connected to the computer, PowerShell automatically adds a PSDrive to the file system that represents the new drive. -You do not need to restart PowerShell. -Similarly, when an external drive is disconnected from the computer, PowerShell automatically deletes the PSDrive that represents the removed drive. +Beginning in Windows PowerShell 3.0, when an external drive is connected to the computer, PowerShell +automatically adds a PSDrive to the file system that represents the new drive. You do not need to +restart PowerShell. Similarly, when an external drive is disconnected from the computer, PowerShell +automatically deletes the PSDrive that represents the removed drive. ## EXAMPLES ### Example 1: Remove a file system drive -This command removes a temporary file system drive named "smp". +This command removes a temporary file system drive named `smp`. ```powershell Remove-PSDrive -Name smp @@ -52,7 +55,7 @@ Remove-PSDrive -Name smp ### Example 2: Remove mapped network drives -This command uses `Remove-PSDrive` to disconnect the X: and S: mapped network drives. +This command uses `Remove-PSDrive` to disconnect the `X:` and `S:` mapped network drives. ```powershell Get-PSDrive X, S | Remove-PSDrive @@ -80,10 +83,9 @@ Accept wildcard characters: False Specifies the name of the drive. -The value of **LiteralName** is used exactly as typed. -No characters are interpreted as wildcards. -If the name includes escape characters, enclose it in single quotation marks ('). -Single quotation marks instruct PowerShell not to interpret any characters as escape sequences. +The value of **LiteralName** is used exactly as typed. No characters are interpreted as wildcards. +If the name includes escape characters, enclose it in single quotation marks (`'`). Single quotation +marks instruct PowerShell not to interpret any characters as escape sequences. ```yaml Type: System.String[] @@ -99,8 +101,7 @@ Accept wildcard characters: False ### -Name -Specifies the names of the drives to remove. -Do not type a colon (:) after the drive name. +Specifies the names of the drives to remove. Do not type a colon (`:`) after the drive name. ```yaml Type: System.String[] @@ -116,8 +117,8 @@ Accept wildcard characters: True ### -PSProvider -Specifies an array of **PSProvider** objects. -This cmdlet removes and disconnects all of the drives associated with the specified PowerShell provider. +Specifies an array of **PSProvider** objects. This cmdlet removes and disconnects all of the drives +associated with the specified PowerShell provider. ```yaml Type: System.String[] @@ -133,9 +134,10 @@ Accept wildcard characters: False ### -Scope -Specifies a scope for the drive. -The acceptable values for this parameter are: Global, Local, and Script, or a number relative to the current scope. Scopes number 0 through the number of scopes. The current scope number is 0 and its parent is 1. -For more information, see [about_Scopes](../Microsoft.PowerShell.Core/About/about_Scopes.md). +Specifies a scope for the drive. The acceptable values for this parameter are: `Global`, `Local`, +and `Script`, or a number relative to the current scope. Scopes number `0` through the number of +scopes. The current scope number is `0` and its parent is `1`. For more information, see +[about_Scopes](../Microsoft.PowerShell.Core/About/about_Scopes.md). ```yaml Type: System.String @@ -167,8 +169,7 @@ Accept wildcard characters: False ### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. +Shows what would happen if the cmdlet runs. The cmdlet is not run. ```yaml Type: System.Management.Automation.SwitchParameter @@ -184,13 +185,17 @@ Accept wildcard characters: False ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). ## INPUTS ### System.Management.Automation.PSDriveInfo -You can pipe a drive object, such as one from the `Get-PSDrive` cmdlet, to the `Remove-PSDrive` cmdlet. +You can pipe a drive object, such as one from the `Get-PSDrive` cmdlet, to the `Remove-PSDrive` +cmdlet. ## OUTPUTS @@ -200,7 +205,9 @@ This cmdlet does not return any output. ## NOTES -- The `Remove-PSDrive` cmdlet is designed to work with the data exposed by any PowerShell provider. To list the providers in your session, use the `Get-PSProvider` cmdlet. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). +- The `Remove-PSDrive` cmdlet is designed to work with the data exposed by any PowerShell provider. + To list the providers in your session, use the `Get-PSProvider` cmdlet. For more information, see + [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). ## RELATED LINKS @@ -209,4 +216,3 @@ This cmdlet does not return any output. [New-PSDrive](New-PSDrive.md) [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md) - diff --git a/reference/7.2/Microsoft.PowerShell.Management/Resolve-Path.md b/reference/7.2/Microsoft.PowerShell.Management/Resolve-Path.md index d6c8ca3eea48..ced88d0677d0 100644 --- a/reference/7.2/Microsoft.PowerShell.Management/Resolve-Path.md +++ b/reference/7.2/Microsoft.PowerShell.Management/Resolve-Path.md @@ -112,7 +112,7 @@ PS C:\> Resolve-Path -LiteralPath 'test[xml]' Specifies a user account that has permission to perform this action. The default is the current user. -Type a user name, such as User01 or Domain01\User01, or pass a **PSCredential** object. You can +Type a user name, such as `User01` or `Domain01\User01`, or pass a **PSCredential** object. You can create a **PSCredential** object using the `Get-Credential` cmdlet. If you type a user name, this cmdlet prompts you for a password. @@ -134,8 +134,8 @@ Accept wildcard characters: False Specifies the path to be resolved. The value of the **LiteralPath** parameter is used exactly as typed. No characters are interpreted as wildcard characters. If the path includes escape characters, -enclose it in single quotation marks. Single quotation marks tell PowerShell not to interpret any -characters as escape sequences. +enclose it in single quotation marks (`'`). Single quotation marks tell PowerShell not to interpret +any characters as escape sequences. ```yaml Type: System.String[] diff --git a/reference/7.2/Microsoft.PowerShell.Management/Start-Service.md b/reference/7.2/Microsoft.PowerShell.Management/Start-Service.md index 7354587ce050..dc879212d16d 100644 --- a/reference/7.2/Microsoft.PowerShell.Management/Start-Service.md +++ b/reference/7.2/Microsoft.PowerShell.Management/Start-Service.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 06/09/2017 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/start-service?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 title: Start-Service @@ -80,7 +80,7 @@ Start-Service -InputObject $s -PassThru | Format-List >> services.txt First we use `Get-Service` to get an object that represent the WMI service and store it in the `$s` variable. Next, we start the service. Without the **PassThru** parameter, `Start-Service` does not -create any output. The pipeline operator (|) passes the object output by `Start-Service` to the +create any output. The pipeline operator (`|`) passes the object output by `Start-Service` to the `Format-List` cmdlet to format the object as a list of its properties. The append redirection operator (`>>`) redirects the output to the services.txt file. The output is added to the end of the existing file. diff --git a/reference/7.2/Microsoft.PowerShell.Security/About/about_Certificate_Provider.md b/reference/7.2/Microsoft.PowerShell.Security/About/about_Certificate_Provider.md index 2fb6125fe028..75634ec5b6e4 100644 --- a/reference/7.2/Microsoft.PowerShell.Security/About/about_Certificate_Provider.md +++ b/reference/7.2/Microsoft.PowerShell.Security/About/about_Certificate_Provider.md @@ -1,7 +1,7 @@ --- description: Information about the Certificate provider. Locale: en-US -ms.date: 05/12/2022 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.security/about/about_certificate_provider?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 title: about Certificate Provider @@ -31,8 +31,8 @@ Provides access to X.509 certificate stores and certificates in PowerShell. The PowerShell **Certificate** provider lets you get, add, change, clear, and delete certificates and certificate stores in PowerShell. -The **Certificate** drive is a hierarchical namespace containing the -certificate stores and certificates on your computer. +The **Certificate** drive is a hierarchical namespace containing the certificate +stores and certificates on your computer. The **Certificate** provider supports the following cmdlets, which are covered in this article. @@ -78,9 +78,9 @@ the `Cert:` drive. Set-Location Cert: ``` -You can also work with the certificate provider from any other PowerShell -drive. To reference an alias from another location, use the `Cert:` drive name -in the path. +You can also work with the certificate provider from any other PowerShell drive. +To reference an alias from another location, use the `Cert:` drive name in the +path. ```powershell PS Cert:\> Set-Location -Path LocalMachine\Root @@ -163,8 +163,9 @@ Get-ChildItem -Path cert:\LocalMachine\My, cert:\LocalMachine\WebHosting ` ### Find expired certificates on remote computers This command uses the `Invoke-Command` cmdlet to run a `Get-ChildItem` command -on the Srv01 and Srv02 computers. A value of zero (0) in the **ExpiringInDays** -parameter gets certificates on the Srv01 and Srv02 computers that have expired. +on the Srv01 and Srv02 computers. A value of zero (`0`) in the +**ExpiringInDays** parameter gets certificates on the Srv01 and Srv02 computers +that have expired. ```powershell Invoke-Command -ComputerName Srv01, Srv02 {Get-ChildItem -Path cert:\* ` @@ -194,8 +195,8 @@ Get-ChildItem -Path cert:\* -Recurse -DNSName "*fabrikam*" ` ## Opening the Certificates MMC Snap-in -The `Invoke-Item` cmdlet will use the default application to open a path -you specify. For certificates, the default application is the Certificates MMC +The `Invoke-Item` cmdlet will use the default application to open a path you +specify. For certificates, the default application is the Certificates MMC snap-in. This command opens the Certificates MMC snap-in to manage the specified @@ -207,8 +208,8 @@ Invoke-Item cert:\CurrentUser\my\6B8223358119BB08840DEE50FD8AF9EA776CE66B ## Copying Certificates -Copying certificates is not supported by the **Certificate** provider. When -you attempt to copy a certificate, you see this error. +Copying certificates is not supported by the **Certificate** provider. When you +attempt to copy a certificate, you see this error. ``` $path = "Cert:\LocalMachine\Root\E2C0F6662D3C569705B4B31FE2CBF3434094B254" @@ -240,8 +241,8 @@ This command uses the **SSLServerAuthentication** parameter of the `Get-ChildItem` cmdlet to get SSL server authentication certificates in the `My` certificate store. -The returned certificates are piped to the `Move-Item` cmdlet, which moves -the certificates to the `WebHosting` store. +The returned certificates are piped to the `Move-Item` cmdlet, which moves the +certificates to the `WebHosting` store. ```powershell Get-ChildItem cert:\LocalMachine\My -SSLServerAuthentication | Move-Item ` @@ -251,12 +252,12 @@ Get-ChildItem cert:\LocalMachine\My -SSLServerAuthentication | Move-Item ` ## Deleting Certificates and Private Keys The `Remove-Item` cmdlet will remove certificates that you specify. The -`-DeleteKey` dynamic parameter deletes the private key. +**DeleteKey** dynamic parameter deletes the private key. ### Delete a Certificate from the CA store -This command deletes a certificate from the CA certificate store, but leaves -the associated private key intact. +This command deletes a certificate from the CA certificate store, but leaves the +associated private key intact. In the `Cert:` drive, the `Remove-Item` cmdlet supports only the **DeleteKey**, **Path**, **WhatIf**, and **Confirm** parameters. All other parameters are @@ -329,9 +330,9 @@ This command uses the **ExpiringInDays** parameter of the `Get-ChildItem` cmdlet with a value of `0` to get certificates in the `WebHosting` store that have expired. -The variable containing the returned certificates is piped to the -`Remove-Item` cmdlet, which deletes them. The command uses the **DeleteKey** -parameter to delete the private key along with the certificate. +The variable containing the returned certificates is piped to the `Remove-Item` +cmdlet, which deletes them. The command uses the **DeleteKey** parameter to +delete the private key along with the certificate. ```powershell $expired = Get-ChildItem cert:\LocalMachine\WebHosting -ExpiringInDays 0 @@ -349,8 +350,8 @@ cmdlet to create a certificate for testing purposes. In the `Cert:` drive, the `New-Item` cmdlet creates certificate stores in the `LocalMachine` store location. It supports the **Name**, **Path**, **WhatIf**, and **Confirm** parameters. All other parameters are ignored. The command -returns a **System.Security.Cryptography.X509Certificates.X509Store** -that represents the new certificate store. +returns a **System.Security.Cryptography.X509Certificates.X509Store** that +represents the new certificate store. This command creates a new certificate store named `CustomStore` in the `LocalMachine` store location. @@ -366,8 +367,8 @@ This command creates a new certificate store named `HostingStore` in the The command uses the `Invoke-Command` cmdlet to run a `New-Item` command on the Server01 computer. The command returns a -**System.Security.Cryptography.X509Certificates.X509Store** that represents -the new certificate store. +**System.Security.Cryptography.X509Certificates.X509Store** that represents the +new certificate store. ```powershell Invoke-Command { New-Item -Path cert:\LocalMachine\CustomStore } ` @@ -405,25 +406,25 @@ Invoke-Command { Remove-Item -Path cert:\LocalMachine\TestStore -Recurse } ` ## Dynamic parameters -Dynamic parameters are cmdlet parameters that are added by a PowerShell -provider and are available only when the cmdlet is being used in the -provider-enabled drive. These parameters are valid in all subdirectories of the -**Certificate** provider, but are effective only on certificates. +Dynamic parameters are cmdlet parameters that are added by a PowerShell provider +and are available only when the cmdlet is being used in the provider-enabled +drive. These parameters are valid in all subdirectories of the **Certificate** +provider, but are effective only on certificates. > [!NOTE] > Parameters that perform filtering against the **EnhancedKeyUsageList** -> property also return items with an empty**EnhancedKeyUsageList** property -> value. Certificates that have an empty **EnhancedKeyUsageList** can be used -> for all purposes. +> property also return items with an empty **EnhancedKeyUsageList** +> property value. Certificates that have an empty **EnhancedKeyUsageList** can +> be used for all purposes. The following Certificate provider parameters were reintroduced in PowerShell 7.1. -- DNSName -- DocumentEncryptionCert -- EKU -- ExpiringInDays -- SSLServerAuthentication +- **DNSName** +- **DocumentEncryptionCert** +- **EKU** +- **ExpiringInDays** +- **SSLServerAuthentication** ### CodeSigningCert <System.Management.Automation.SwitchParameter> @@ -441,14 +442,15 @@ This parameter gets certificates that have `Code Signing` in their - [Remove-Item](xref:Microsoft.PowerShell.Management.Remove-Item) -This parameter deletes the associated private key when it deletes the certificate. +This parameter deletes the associated private key when it deletes the +certificate. > [!IMPORTANT] > To delete a private key that is associated with a user certificate in the > `Cert:\CurrentUser` store on a remote computer, you must use delegated -> credentials. The `Invoke-Command` cmdlet supports credential delegation -> using the **CredSSP** parameter. You should consider any security risks -> before using `Remove-Item` with `Invoke-Command` and credential delegation. +> credentials. The `Invoke-Command` cmdlet supports credential delegation using +> the **CredSSP** parameter. You should consider any security risks before using +> `Remove-Item` with `Invoke-Command` and credential delegation. This parameter was reintroduced in PowerShell 7.1 @@ -505,10 +507,10 @@ This parameter allows you to specify the type of item created by `New-Item`. In a `Certificate` drive, the following values are allowed: -- Certificate Provider -- Certificate -- Store -- StoreLocation +- `Certificate Provider` +- `Certificate` +- `Store` +- `StoreLocation` #### Cmdlets Supported diff --git a/reference/7.2/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md b/reference/7.2/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md index a82019fc61f5..0fd7602f63d8 100644 --- a/reference/7.2/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md +++ b/reference/7.2/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 10/22/2021 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/convertfrom-csv?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 title: ConvertFrom-Csv @@ -147,11 +147,9 @@ generate objects from the CSV strings. ### -Delimiter -Specifies the delimiter that separates the property values in the CSV strings. -The default is a comma (,). - -Enter a character, such as a colon (:). -To specify a semicolon (;) enclose it in single quotation marks. +Specifies the delimiter that separates the property values in the CSV strings. The default is a +comma (`,`). Enter a character, such as a colon (`:`). To specify a semicolon (`;`) enclose it in +single quotation marks. If you specify a character other than the actual string delimiter in the file, `ConvertFrom-Csv` cannot create the objects from the CSV strings and will return the CSV strings. diff --git a/reference/7.2/Microsoft.PowerShell.Utility/ConvertTo-Html.md b/reference/7.2/Microsoft.PowerShell.Utility/ConvertTo-Html.md index b66f3d8c3859..43960e433030 100644 --- a/reference/7.2/Microsoft.PowerShell.Utility/ConvertTo-Html.md +++ b/reference/7.2/Microsoft.PowerShell.Utility/ConvertTo-Html.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 08/10/2020 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/convertto-html?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 title: ConvertTo-Html @@ -72,7 +72,7 @@ the `Out-File` cmdlet to send the HTML code to the `aliases.htm` file. ### Example 3: Create a web page to display PowerShell events ```powershell -`Get-EventLog` -LogName "Windows PowerShell" | ConvertTo-Html | Out-File pslog.htm +Get-EventLog -LogName "Windows PowerShell" | ConvertTo-Html | Out-File pslog.htm ``` This command creates an HTML page called `pslog.htm` that displays the events in the Windows @@ -103,7 +103,7 @@ on the computer. The command uses the pipeline operator (`|`) to send the proces The command uses the **Property** parameter to select three properties of the process objects to be included in the table. The command uses the **Title** parameter to specify a title for the HTML page. The command also uses the `Out-File` cmdlet to send the resulting HTML to a file named -Proc.htm. +`Proc.htm`. The second command uses the `Invoke-Item` cmdlet to open the `Proc.htm` in the default browser. @@ -157,7 +157,7 @@ Get-Date | ConvertTo-Html -Fragment ``` This command uses `ConvertTo-Html` to generate an HTML table of the current date. The command uses -the `Get-Date` cmdlet to get the current date. It uses a pipeline operator (|) to send the results +the `Get-Date` cmdlet to get the current date. It uses a pipeline operator (`|`) to send the results to the `ConvertTo-Html` cmdlet. The `ConvertTo-Html` command includes the **Fragment** parameter, which limits the output to an HTML @@ -194,12 +194,13 @@ Invoke-Item Services.htm ``` This command creates and opens a Web page that displays the services on the computer that begin with -A. It uses the **Title**, **Body**, **PreContent**, and **PostContent** parameters of +`A`. It uses the **Title**, **Body**, **PreContent**, and **PostContent** parameters of `ConvertTo-Html` to customize the output. The first part of the command uses the `Get-Service` cmdlet to get the services on the computer that -begin with A. The command uses a pipeline operator (`|`) to send the results to the `ConvertTo-Html` -cmdlet. The command also uses the `Out-File` cmdlet to send the output to the Services.htm file. +begin with `A`. The command uses a pipeline operator (`|`) to send the results to the +`ConvertTo-Html` cmdlet. The command also uses the `Out-File` cmdlet to send the output to the +`Services.htm` file. A semicolon (`;`) ends the first command and starts a second command, which uses the `Invoke-Item` cmdlet to open the `Services.htm` file in the default browser. @@ -223,7 +224,7 @@ The charset for the page is set to UTF-8 Get-Service | ConvertTo-HTML -Transitional ``` -This command sets the DOCTYPE of the returned HTML to XHTML Transitional DTD +This command sets the `DOCTYPE` of the returned HTML to **XHTML Transitional DTD** ## PARAMETERS @@ -307,7 +308,7 @@ Accept wildcard characters: False ### -Fragment -Generates only an HTML table. The HTML, HEAD, TITLE, and BODY tags are omitted. +Generates only an HTML table. The `<HTML>`, `<HEAD>`, `<TITLE>`, and `<BODY>` tags are omitted. ```yaml Type: System.Management.Automation.SwitchParameter @@ -418,11 +419,11 @@ Includes the specified properties of the objects in the HTML. The value of the * parameter can be a new calculated property. The calculated property can be a script block or a hash table. Valid key-value pairs are: -- Name (or label) - `<string>` (added in PowerShell 6.x) -- Expression - `<string>` or `<script block>` -- FormatString - `<string>` -- Width - `<int32>` - must be greater than `0` -- Alignment - value can be `Left`, `Center`, or `Right` +- `Name` (or label) - `<string>` (added in PowerShell 6.x) +- `Expression` - `<string>` or `<script block>` +- `FormatString` - `<string>` +- `Width` - `<int32>` - must be greater than `0` +- `Alignment` - value can be `Left`, `Center`, or `Right` For more information, see [about_Calculated_Properties](../Microsoft.PowerShell.Core/About/about_Calculated_Properties.md). @@ -457,7 +458,7 @@ Accept wildcard characters: False ### -Transitional -Changes the **DOCTYPE** to **XHTML Transitional DTD**, Default **DOCTYPE** is **XHTML Strict DTD**. +Changes the `DOCTYPE` to **XHTML Transitional DTD**, Default `DOCTYPE` is **XHTML Strict DTD**. This parameter was introduced in PowerShell 6.0. @@ -509,7 +510,7 @@ quite different. submit the processes on a computer to `ConvertTo-Html`, the resulting table displays an object array and its properties. - To comply with the XHTML Strict DTD, the DOCTYPE tag is modified accordingly: + To comply with the XHTML Strict DTD, the `DOCTYPE` tag is modified accordingly: `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"\>` diff --git a/reference/7.2/Microsoft.PowerShell.Utility/Format-List.md b/reference/7.2/Microsoft.PowerShell.Utility/Format-List.md index 71739af78c21..452349a5697a 100644 --- a/reference/7.2/Microsoft.PowerShell.Utility/Format-List.md +++ b/reference/7.2/Microsoft.PowerShell.Utility/Format-List.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 12/19/2018 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/format-list?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 title: Format-List @@ -23,7 +23,7 @@ Format-List [[-Property] <Object[]>] [-GroupBy <Object>] [-View <string>] [-Show The `Format-List` cmdlet formats the output of a command as a list of properties in which each property is displayed on a separate line. You can use `Format-List` to format and display all or -selected properties of an object as a list (format-list *). +selected properties of an object as a list (`Format-List -Property *`). Because more space is available for each item in a list than in a table, PowerShell displays more properties of the object in the list, and the property values are less likely to be truncated. @@ -38,7 +38,7 @@ Get-Service | Format-List This command formats information about services on the computer as a list. By default, the services are formatted as a table. The `Get-Service` cmdlet gets objects representing the services on the -computer. The pipeline operator (|) passes the results through the pipeline to `Format-List`. +computer. The pipeline operator (`|`) passes the results through the pipeline to `Format-List`. Then, the `Format-List` command formats the service information in a list and sends it to the default output cmdlet for display. @@ -62,12 +62,12 @@ the formatted output to the default output cmdlet for display. This command displays the name, base priority, and priority class of each process on the computer. ```powershell -Get-Process | Format-List -Property name, basepriority, priorityclass +Get-Process | Format-List -Property Name, BasePriority, PriorityClass ``` It uses the `Get-Process` cmdlet to get an object representing each process. The pipeline operator -(|) passes the process objects through the pipeline to `Format-List`. `Format-List` formats the -processes as a list of the specified properties. The *Property* parameter name is optional, so you +(`|`) passes the process objects through the pipeline to `Format-List`. `Format-List` formats the +processes as a list of the specified properties. The **Property** parameter name is optional, so you can omit it. ### Example 4: Format all properties for a process @@ -79,9 +79,9 @@ Get-Process winlogon | Format-List -Property * ``` It uses the Get-Process cmdlet to get an object representing the Winlogon process. The pipeline -operator (|) passes the Winlogon process object through the pipeline to `Format-List`. The command -uses the *Property* parameter to specify the properties and the \* to indicate all properties. -Because the name of the *Property* parameter is optional, you can omit it and type the command as +operator (`|`) passes the Winlogon process object through the pipeline to `Format-List`. The command +uses the **Property** parameter to specify the properties and the `*` to indicate all properties. +Because the name of the **Property** parameter is optional, you can omit it and type the command as `Format-List *`. `Format-List` automatically sends the results to the default output cmdlet for display. @@ -129,12 +129,12 @@ Accept wildcard characters: False ### -Expand Specifies the formatted collection object, as well as the objects in the collection. This parameter -is designed to format objects that support the ICollection (System.Collections) interface. The -default value is EnumOnly. The acceptable values for this parameter are: +is designed to format objects that support the **System.Collections.ICollection** interface. The +default value is `EnumOnly`. The acceptable values for this parameter are: -- EnumOnly. Displays the properties of the objects in the collection. -- CoreOnly. Displays the properties of the collection object. -- Both. Displays the properties of the collection object and the properties of objects in the +- `EnumOnly`. Displays the properties of the objects in the collection. +- `CoreOnly`. Displays the properties of the collection object. +- `Both`. Displays the properties of the collection object and the properties of objects in the collection. ```yaml @@ -176,9 +176,9 @@ property of the output. The value of the **GroupBy** parameter can be a new calculated property. The calculated property can be a script block or a hash table. Valid key-value pairs are: -- Name (or Label) - `<string>` -- Expression - `<string>` or `<script block>` -- FormatString - `<string>` +- `Name` (or `Label`) - `<string>` +- `Expression` - `<string>` or `<script block>` +- `FormatString` - `<string>` For more information, see [about_Calculated_Properties](../Microsoft.PowerShell.Core/About/about_Calculated_Properties.md). @@ -218,15 +218,15 @@ Specifies the object properties that appear in the display and the order in whic Wildcards are permitted. If you omit this parameter, the properties that appear in the display depend on the object being -displayed. The parameter name "Property" is optional. You cannot use the **Property** and **View** +displayed. The parameter name **Property** is optional. You cannot use the **Property** and **View** parameters in the same command. The value of the **Property** parameter can be a new calculated property. The calculated property can be a script block or a hash table. Valid key-value pairs are: -- Name (or Label) - `<string>` -- Expression - `<string>` or `<script block>` -- FormatString - `<string>` +- `Name` (or `Label`) - `<string>` +- `Expression` - `<string>` or `<script block>` +- `FormatString` - `<string>` For more information, see [about_Calculated_Properties](../Microsoft.PowerShell.Core/About/about_Calculated_Properties.md). @@ -299,17 +299,17 @@ You can pipe any object to `Format-List`. ## NOTES -You can also refer to Format-List by its built-in alias, FL. For more information, see +You can also refer to `Format-List` by its built-in alias, `fl`. For more information, see [about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). The format cmdlets, such as `Format-List`, arrange the data to be displayed but do not display it. -The data is displayed by the output features of PowerShell and by the cmdlets that contain the Out -verb (the Out cmdlets), such as `Out-Host` or `Out-File`. +The data is displayed by the output features of PowerShell and by the cmdlets that contain the `Out` +verb (the `Out` cmdlets), such as `Out-Host` or `Out-File`. If you do not use a format cmdlet, PowerShell applies that default format for each object that it displays. -The **GroupBy** parameter assumes that the objects are sorted. Use Sort-Object before using +The **GroupBy** parameter assumes that the objects are sorted. Use `Sort-Object` before using `Format-List` to group the objects. The **View** parameter lets you specify an alternate format for the table. You can use the views diff --git a/reference/7.2/Microsoft.PowerShell.Utility/Format-Wide.md b/reference/7.2/Microsoft.PowerShell.Utility/Format-Wide.md index dc13cb6346a5..83a487fa01b3 100644 --- a/reference/7.2/Microsoft.PowerShell.Utility/Format-Wide.md +++ b/reference/7.2/Microsoft.PowerShell.Utility/Format-Wide.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 08/10/2020 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/format-wide?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 title: Format-Wide @@ -36,23 +36,23 @@ screen. Get-ChildItem | Format-Wide -Column 3 ``` -The Get-ChildItem cmdlet gets objects representing each file in the directory. The pipeline -operator (|) passes the file objects through the pipeline to `Format-Wide`, which formats them for +The `Get-ChildItem` cmdlet gets objects representing each file in the directory. The pipeline +operator (`|`) passes the file objects through the pipeline to `Format-Wide`, which formats them for output. The **Column** parameter specifies the number of columns. ### Example 2: Format names of registry keys -This command displays the names of registry keys in the HKEY_CURRENT_USER\Software\Microsoft key. +This command displays the names of registry keys in the `HKEY_CURRENT_USER\Software\Microsoft` key. ```powershell Get-ChildItem HKCU:\software\microsoft | Format-Wide -Property pschildname -AutoSize ``` -The Get-ChildItem cmdlet gets objects representing the keys. The path is specified as HKCU:, one of -the drives exposed by the PowerShell Registry provider, followed by the key path. The pipeline -operator (|) passes the registry key objects through the pipeline to `Format-Wide`, which formats -them for output. The **Property** parameter specifies the name of the property, and the -**AutoSize** parameter adjusts the columns for readability. +The `Get-ChildItem` cmdlet gets objects representing the keys. The path is specified as `HKCU:`, one +of the drives exposed by the PowerShell Registry provider, followed by the key path. The pipeline +operator (`|`) passes the registry key objects through the pipeline to `Format-Wide`, which formats +them for output. The **Property** parameter specifies the name of the property, and the **AutoSize** +parameter adjusts the columns for readability. ### Example 3: Troubleshooting format errors @@ -131,14 +131,14 @@ Accept wildcard characters: False ### -Expand Formats the collection object, as well as the objects in the collection. This parameter is designed -to format objects that support the ICollection (System.Collections) interface. The default value is -**EnumOnly**. +to format objects that support the **System.Collections.ICollection** interface. The default value +is `EnumOnly`. Valid values are: -- EnumOnly: Displays the properties of the objects in the collection. -- CoreOnly: Displays the properties of the collection object. -- Both: Displays the properties of the collection object and the properties of objects in the +- `EnumOnly`: Displays the properties of the objects in the collection. +- `CoreOnly`: Displays the properties of the collection object. +- `Both`: Displays the properties of the collection object and the properties of objects in the collection. ```yaml @@ -181,9 +181,9 @@ of the output. The value of the **GroupBy** parameter can be a new calculated property. The calculated property can be a script block or a hash table. Valid key-value pairs are: -- Name (or Label) - `<string>` -- Expression - `<string>` or `<script block>` -- FormatString - `<string>` +- `Name` (or `Label`) - `<string>` +- `Expression` - `<string>` or `<script block>` +- `FormatString` - `<string>` For more information, see [about_Calculated_Properties](../Microsoft.PowerShell.Core/About/about_Calculated_Properties.md). @@ -219,18 +219,17 @@ Accept wildcard characters: False ### -Property -Specifies the object property that appears in the display. -Wildcards are permitted. +Specifies the object property that appears in the display. Wildcards are permitted. If you omit this parameter, the properties that appear in the display depend on the object being -displayed. The parameter name "Property" is optional. You cannot use the **Property** and **View** +displayed. The parameter name **Property** is optional. You cannot use the **Property** and **View** parameters in the same command. -The value of the **Property** parameter can be a new calculated property. The calculated property can -be a script block or a hash table. Valid key-value pairs are: +The value of the **Property** parameter can be a new calculated property. The calculated property +can be a script block or a hash table. Valid key-value pairs are: -- Expression - `<string>` or `<script block>` -- FormatString - `<string>` +- `Expression` - `<string>` or `<script block>` +- `FormatString` - `<string>` For more information, see [about_Calculated_Properties](../Microsoft.PowerShell.Core/About/about_Calculated_Properties.md). @@ -303,7 +302,8 @@ You can pipe any object to `Format-Wide`. ## NOTES -You can also refer to `Format-Wide` by its built-in alias, `fw`. For more information, see [about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). +You can also refer to `Format-Wide` by its built-in alias, `fw`. For more information, see +[about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). The **GroupBy** parameter assumes that the objects are sorted. Use `Sort-Object` before using `Format-Custom` to group the objects. @@ -314,7 +314,7 @@ in new PS1XML files and use the `Update-FormatData` cmdlet to include them in Po The alternate view for the **View** parameter must use table format; if it does not, the command fails. If the alternate view is a list, use `Format-List`. If the alternate view is neither a list -nor a table, use Format-Custom. +nor a table, use `Format-Custom`. ## RELATED LINKS diff --git a/reference/7.2/Microsoft.PowerShell.Utility/Get-Unique.md b/reference/7.2/Microsoft.PowerShell.Utility/Get-Unique.md index 1f9579527fdf..aca6041b25e1 100644 --- a/reference/7.2/Microsoft.PowerShell.Utility/Get-Unique.md +++ b/reference/7.2/Microsoft.PowerShell.Utility/Get-Unique.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 03/12/2019 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/get-unique?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-Unique @@ -47,10 +47,10 @@ $A = $( foreach ($line in Get-Content C:\Test1\File1.txt) { $A.count ``` -The first command gets the content of the File.txt file. It converts each line of text to lowercase -letters and then splits each word onto a separate line at the space (" "). Then, it sorts the -resulting list alphabetically (the default) and uses the `Get-Unique` cmdlet to eliminate any -duplicate words. The results are stored in the `$A` variable. +The first command gets the content of the `File.txt` file. It converts each line of text to +lowercase letters and then splits each word onto a separate line at the space (`" "`). Then, it +sorts the resulting list alphabetically (the default) and uses the `Get-Unique` cmdlet to eliminate +any duplicate words. The results are stored in the `$A` variable. The second command uses the **Count** property of the collection of strings in `$A` to determine how many items are in `$A`. @@ -86,7 +86,7 @@ includes files and directories. Get-ChildItem | Sort-Object {$_.GetType()} | Get-Unique -OnType ``` -The pipeline operator (|) sends the results to the `Sort-Object` cmdlet. The `$_.GetType()` +The pipeline operator (`|`) sends the results to the `Sort-Object` cmdlet. The `$_.GetType()` statement applies the **GetType** method to each file or directory. Then, `Sort-Object` sorts the items by type. Another pipeline operator sends the results to `Get-Unique`. The **OnType** parameter directs `Get-Unique` to return only one object of each type. @@ -99,11 +99,11 @@ This command gets the names of processes running on the computer with duplicates Get-Process | Sort-Object | Select-Object processname | Get-Unique -AsString ``` -The `Get-Process` command gets all of the processes on the computer. The pipeline operator (|) +The `Get-Process` command gets all of the processes on the computer. The pipeline operator (`|`) passes the result to `Sort-Object`, which, by default, sorts the processes alphabetically by -ProcessName. The results are piped to the `Select-Object` cmdlet, which selects only the values of -the ProcessName property of each object. The results are then piped to `Get-Unique` to eliminate -duplicates. +**ProcessName**. The results are piped to the `Select-Object` cmdlet, which selects only the values +of the **ProcessName** property of each object. The results are then piped to `Get-Unique` to +eliminate duplicates. The **AsString** parameter tells `Get-Unique` to treat the **ProcessName** values as strings. Without this parameter, `Get-Unique` treats the **ProcessName** values as objects and returns only @@ -187,14 +187,14 @@ The type of object that `Get-Unique` returns is determined by the input. ## NOTES -You can also refer to `Get-Unique` by its built-in alias, `gu`. For more information, see [about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). +You can also refer to `Get-Unique` by its built-in alias, `gu`. For more information, see +[about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). -To sort a list, use Sort-Object. You can also use the **Unique** parameter of `Sort-Object` to find -the unique items in a list. +To sort a list, use `Sort-Object`. You can also use the **Unique** parameter of `Sort-Object` to +find the unique items in a list. ## RELATED LINKS [Select-Object](Select-Object.md) [Sort-Object](Sort-Object.md) - diff --git a/reference/7.2/Microsoft.PowerShell.Utility/Out-GridView.md b/reference/7.2/Microsoft.PowerShell.Utility/Out-GridView.md index d3cd15abe96d..c1edcf40e3d8 100644 --- a/reference/7.2/Microsoft.PowerShell.Utility/Out-GridView.md +++ b/reference/7.2/Microsoft.PowerShell.Utility/Out-GridView.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 10/28/2019 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/out-gridview?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 title: Out-GridView @@ -45,10 +45,10 @@ Nano Server. You can use the following features of the table to examine your data: -- Hide, Show, and Reorder Columns +- Hide, show, and reorder columns - Sort rows -- Quick Filter -- Add Criteria Filter +- Quick filter +- Add criteria filter - Copy and paste For full instructions, see the [Notes](#notes) section of this article. @@ -71,7 +71,8 @@ Get-Process | Out-GridView ### Example 2: Use a variable to output processes to a grid view -This example also gets the processes running on the local computer and sends them to a grid view window. +This example also gets the processes running on the local computer and sends them to a grid view +window. ```powershell $P = Get-Process @@ -190,10 +191,10 @@ the pipeline, click to select the items and then click OK. The values of this parameter determine how many items you can send down the pipeline. -- None. No items. This is the default value. -- Single. Zero items or one item. Use this value when the next command can take only one input +- `None`. No items. This is the default value. +- `Single`. Zero items or one item. Use this value when the next command can take only one input object. -- Multiple. Zero, one, or many items. Use this value when the next command can take multiple input +- `Multiple`. Zero, one, or many items. Use this value when the next command can take multiple input objects. This value is equivalent to the **Passthru** parameter. ```yaml @@ -361,7 +362,7 @@ include the typed text appear in the table. - Search for text. To search for text in the table, in the Filter box, type the text to find. - Search for multiple words. To search for multiple words in the table, type the words separated by - spaces. `Out-GridView` displays rows that include all the words (logical AND). + spaces. `Out-GridView` displays rows that include all the words (logical **AND**). - Search for literal phrases. To search for phrases that include spaces or special characters, enclose the phrase in quotation marks. `Out-GridView` displays rows that include an exact match for the phrase. @@ -426,4 +427,3 @@ The criteria only affects the display. It does not delete items from the table. [Out-Printer](Out-Printer.md) [Out-String](Out-String.md) - diff --git a/reference/7.2/Microsoft.PowerShell.Utility/Set-Date.md b/reference/7.2/Microsoft.PowerShell.Utility/Set-Date.md index 5d035e2e4342..f008f4416469 100644 --- a/reference/7.2/Microsoft.PowerShell.Utility/Set-Date.md +++ b/reference/7.2/Microsoft.PowerShell.Utility/Set-Date.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 04/30/2019 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/set-date?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 title: Set-Date @@ -30,6 +30,7 @@ Set-Date [-Adjust] <TimeSpan> [-DisplayHint <DisplayHintType>] [-WhatIf] [-Confi The `Set-Date` cmdlet changes the system date and time on the computer to a date and time that you specify. + You can specify a new date and/or time by typing a string or by passing a **DateTime** or **TimeSpan** object to `Set-Date`. To specify a new date or time, use the **Date** parameter. To specify a change interval, use the **Adjust** parameter. @@ -38,12 +39,11 @@ To specify a change interval, use the **Adjust** parameter. ### Example 1: Add three days to the system date -This command adds three days to the current system date. -It does not affect the time. -The command uses the **Date** parameter to specify the date. +This command adds three days to the current system date. It does not affect the time. The command +uses the **Date** parameter to specify the date. The `Get-Date` cmdlet returns the current date as a **DateTime** object. The **DateTime** object's -**AddDays** method adds a specified number of days (3) to the current **DateTime** object. +**AddDays** method adds a specified number of days (`3`) to the current **DateTime** object. ```powershell Set-Date -Date (Get-Date).AddDays(3) @@ -137,9 +137,9 @@ Accept wildcard characters: False Specifies which elements of the date and time are displayed.The acceptable values for this parameter are: -- **Date** - displays only the date. -- **Time** - displays only the time. -- **DateTime** - displays the date and time. +- `Date` - displays only the date. +- `Time` - displays only the time. +- `DateTime` - displays the date and time. This parameter affects only the display. It does not affect the **DateTime** object that `Get-Date` retrieves. @@ -216,7 +216,6 @@ You can pipe a date to `Set-Date`. - You can use standard .NET methods with the **DateTime** and **TimeSpan** objects used with `Set-Date`, such as **AddDays**, **AddMonths**, and **FromFileTime**. For more information, see [DateTime Methods](/dotnet/api/system.datetime) and - [TimeSpan Methods](/dotnet/api/system.timespan) in the .NET SDK. ## RELATED LINKS diff --git a/reference/7.2/Microsoft.PowerShell.Utility/Test-Json.md b/reference/7.2/Microsoft.PowerShell.Utility/Test-Json.md index 0f71e5172171..8ffe324e46d7 100644 --- a/reference/7.2/Microsoft.PowerShell.Utility/Test-Json.md +++ b/reference/7.2/Microsoft.PowerShell.Utility/Test-Json.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 07/21/2021 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/test-json?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 title: Test-Json @@ -118,7 +118,7 @@ For more information, see [JSON Schema](https://json-schema.org/). ### Example 3: Test an object against a schema from file JSON schema can reference definitions using `$ref` keyword. The `$ref` can resolve to a URI that -references another file. The `SchemaFile` parameter accepts literal path to the JSON schema file +references another file. The **SchemaFile** parameter accepts literal path to the JSON schema file and allows JSON files to be validated against such schemas. In this example we have `schema.json` file which references `definitions.json`. @@ -162,7 +162,8 @@ PS> Get-Content definitions.json True ``` -For more information, see [Structuring a complex schema](https://json-schema.org/understanding-json-schema/structuring.html). +For more information, see +[Structuring a complex schema](https://json-schema.org/understanding-json-schema/structuring.html). ## PARAMETERS @@ -187,9 +188,9 @@ Accept wildcard characters: False ### -Schema -Specifies a Schema to validate the JSON input against. If passed `Test-Json` will validate that the -Json input conforms to the spec specified by the **Schema** parameter and return `$True` only if the -input conforms to the provided Schema. +Specifies a schema to validate the JSON input against. If passed, `Test-Json` will validate that the +JSON input conforms to the spec specified by the **Schema** parameter and return `$true` only if the +input conforms to the provided schema. For more information, see [JSON Schema](https://json-schema.org/). @@ -207,8 +208,8 @@ Accept wildcard characters: False ### -SchemaFile -Specifies a schema file used to validate the JSON input. When used, the `Test-Json` returns `$True` -only if the JSON input conforms to the Schema defined in the file specified by the **SchemaFile** +Specifies a schema file used to validate the JSON input. When used, the `Test-Json` returns `$true` +only if the JSON input conforms to the schema defined in the file specified by the **SchemaFile** parameter. For more information, see [JSON Schema](https://json-schema.org/). diff --git a/reference/7.2/Microsoft.PowerShell.Utility/Unblock-File.md b/reference/7.2/Microsoft.PowerShell.Utility/Unblock-File.md index 75a431f3ccb2..155b728eddc7 100644 --- a/reference/7.2/Microsoft.PowerShell.Utility/Unblock-File.md +++ b/reference/7.2/Microsoft.PowerShell.Utility/Unblock-File.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 06/09/2017 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/unblock-file?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 title: Unblock-File @@ -10,7 +10,7 @@ title: Unblock-File # Unblock-File ## SYNOPSIS -Unblocks files that were downloaded from the Internet. +Unblocks files that were downloaded from the internet. ## SYNTAX @@ -30,16 +30,16 @@ Unblock-File -LiteralPath <String[]> [-WhatIf] [-Confirm] [<CommonParameters>] > **This cmdlet only works on the Windows and macOS platforms.** -The `Unblock-File` cmdlet lets you open files that were downloaded from the Internet. It unblocks -PowerShell script files that were downloaded from the Internet so you can run them, even when the +The `Unblock-File` cmdlet lets you open files that were downloaded from the internet. It unblocks +PowerShell script files that were downloaded from the internet so you can run them, even when the PowerShell execution policy is **RemoteSigned**. By default, these files are blocked to protect the computer from untrusted files. Before using the `Unblock-File` cmdlet, review the file and its source and verify that it is safe to open. -Internally, the `Unblock-File` cmdlet removes the Zone.Identifier alternate data stream, which has a -value of "3" to indicate that it was downloaded from the Internet. +Internally, the `Unblock-File` cmdlet removes the **Zone.Identifier** alternate data stream, which +has a value of `3` to indicate that it was downloaded from the internet. For more information about PowerShell execution policies, see [about_Execution_Policies](../Microsoft.PowerShell.Core/about/about_Execution_Policies.md). @@ -50,7 +50,7 @@ This cmdlet was introduced in Windows PowerShell 3.0. ### Example 1: Unblock a file -This command unblocks the PowerShellTips.chm file. +This command unblocks the `PowerShellTips.chm` file. ``` PS C:\> Unblock-File -Path C:\Users\User01\Documents\Downloads\PowerShellTips.chm @@ -70,11 +70,11 @@ PS C:\> dir C:\Downloads\*PowerShell* | Unblock-File This command shows how to find and unblock PowerShell scripts. The first command uses the **Stream** parameter of the *Get-Item* cmdlet get files with the -Zone.Identifier stream. +**Zone.Identifier** stream. The second command shows what happens when you run a blocked script in a PowerShell session in which -the execution policy is **RemoteSigned**. The RemoteSigned policy prevents you from running scripts -that are downloaded from the Internet unless they are digitally signed. +the execution policy is **RemoteSigned**. The **RemoteSigned** policy prevents you from running +scripts that are downloaded from the internet unless they are digitally signed. The third command uses the `Unblock-File` cmdlet to unblock the script so it can run in the session. @@ -106,8 +106,8 @@ PS C:\> Get-Item C:\ps-test\Start-ActivityTracker.ps1 | Unblock-File Specifies the files to unblock. Unlike **Path**, the value of the **LiteralPath** parameter is used exactly as it is typed. No characters are interpreted as wildcards. If the path includes escape -characters, enclose it in single quotation marks. Single quotation marks tell PowerShell not to -interpret any characters as escape sequences. +characters, enclose it in single quotation marks (`'`). Single quotation marks tell PowerShell not +to interpret any characters as escape sequences. ```yaml Type: System.String[] diff --git a/reference/7.2/Microsoft.WSMan.Management/Set-WSManInstance.md b/reference/7.2/Microsoft.WSMan.Management/Set-WSManInstance.md index 20419ea6148d..509591947718 100644 --- a/reference/7.2/Microsoft.WSMan.Management/Set-WSManInstance.md +++ b/reference/7.2/Microsoft.WSMan.Management/Set-WSManInstance.md @@ -2,8 +2,8 @@ external help file: Microsoft.WSMan.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.WSMan.Management -ms.date: 06/09/2017 -online version: https://docs.microsoft.com/powershell/module/microsoft.wsman.management/set-wsmaninstance?view=powershell-7&WT.mc_id=ps-gethelp +ms.date: 05/16/2022 +online version: https://docs.microsoft.com/powershell/module/microsoft.wsman.management/set-wsmaninstance?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 title: Set-WSManInstance --- @@ -35,7 +35,7 @@ Set-WSManInstance [-ConnectionURI <Uri>] [-Dialect <Uri>] [-FilePath <String>] [ ## DESCRIPTION -The Set-WSManInstance cmdlet modifies the management information that is related to a resource. +The `Set-WSManInstance` cmdlet modifies the management information that is related to a resource. This cmdlet uses the WinRM connection/transport layer to modify the information. @@ -61,9 +61,10 @@ CertificateThumbprint : ListeningOn : {127.0.0.1, 172.30.168.171, ::1, 2001:4898:0:fff:0:5efe:172.30.168.171...} ``` -This command disables the https listener on the local computer. +This command disables the HTTPS listener on the local computer. -Important: The *ValueSet* parameter is case-sensitive when matching the properties specified. +> [!IMPORTANT] +> The **ValueSet** parameter is case-sensitive when matching the properties specified. For example, in this command, @@ -89,15 +90,16 @@ Service : Service Winrs : Winrs ``` -This command sets the MaxEnvelopeSizekb value to 200 on the local computer. +This command sets the **MaxEnvelopeSizekb** value to 200 on the local computer. -Important: The ValueSet parameter is case-sensitive when matching the properties specified. +> [!IMPORTANT] +> The **ValueSet** parameter is case-sensitive when matching the properties specified. For example, using the above command. -This fails: -ValueSet @{MaxEnvelopeSizeKB ="200"} +This fails: `-ValueSet @{MaxEnvelopeSizeKB ="200"}` -This succeeds: -ValueSet @{MaxEnvelopeSizekb ="200"} +This succeeds: `-ValueSet @{MaxEnvelopeSizekb ="200"}` ### Example 3: Disable a listener on a remote computer @@ -119,34 +121,35 @@ CertificateThumbprint : ListeningOn : {127.0.0.1, 172.30.168.172, ::1, 2001:4898:0:fff:0:5efe:172.30.168.172...} ``` -This command disables the https listener on the remote computer SERVER02. +This command disables the HTTPS listener on the remote computer SERVER02. -Important: The ValueSet parameter is case-sensitive when matching the properties specified. +> [!IMPORTANT] +> The **ValueSet** parameter is case-sensitive when matching the properties specified. For example, using the above command. -This fails: -ValueSet @{enabled="False"} +This fails: `-ValueSet @{enabled="False"}` -This succeeds: -ValueSet @{Enabled="False"} +This succeeds: `-ValueSet @{Enabled="False"}` ## PARAMETERS ### -ApplicationName -Specifies the application name in the connection. -The default value of the ApplicationName parameter is "WSMAN". -The complete identifier for the remote endpoint is in the following format: +Specifies the application name in the connection. The default value of the **ApplicationName** +parameter is "WSMAN". The complete identifier for the remote endpoint is in the following format: -\<transport\>://\<server\>:\<port\>/\<ApplicationName\> +`<transport>://<server>:<port>/<ApplicationName>` For example: `http://server01:8080/WSMAN` -Internet Information Services (IIS), which hosts the session, forwards requests with this endpoint to the specified application. -This default setting of "WSMAN" is appropriate for most uses. -This parameter is designed to be used when numerous computers establish remote connections to one computer that is running Windows PowerShell. -In this case, IIS hosts Web Services for Management (WS-Management ) for efficiency. +Internet Information Services (IIS), which hosts the session, forwards requests with this endpoint +to the specified application. This default setting of `WSMAN` is appropriate for most uses. This +parameter is designed to be used when numerous computers establish remote connections to one +computer that is running Windows PowerShell. In this case, IIS hosts Web Services for Management +(WS-Management) for efficiency. ```yaml Type: System.String @@ -165,16 +168,26 @@ Accept wildcard characters: False Specifies the authentication mechanism to be used at the server. Possible values are: -- Basic: Basic is a scheme in which the user name and password are sent in clear text to the server or proxy. -- Default : Use the authentication method implemented by the WS-Management protocol. This is the default. -- Digest: Digest is a challenge-response scheme that uses a server-specified data string for the challenge. -- Kerberos: The client computer and the server mutually authenticate by using Kerberos certificates. -- Negotiate: Negotiate is a challenge-response scheme that negotiates with the server or proxy to determine the scheme to use for authentication. For example, this parameter value allows negotiation to determine whether the Kerberos protocol or NTLM is used. -- CredSSP: Use Credential Security Support Provider (CredSSP) authentication, which allows the user to delegate credentials. This option is designed for commands that run on one remote computer but collect data from or run additional commands on other remote computers. - -Caution: CredSSP delegates the user's credentials from the local computer to a remote computer. -This practice increases the security risk of the remote operation. -If the remote computer is compromised, when credentials are passed to it, the credentials can be used to control the network session. +- `Basic`: Basic is a scheme in which the user name and password are sent in clear text to the + server or proxy. +- `Default` : Use the authentication method implemented by the WS-Management protocol. This is the + default. +- `Digest`: Digest is a challenge-response scheme that uses a server-specified data string for the + challenge. +- `Kerberos`: The client computer and the server mutually authenticate by using Kerberos + certificates. +- `Negotiate`: Negotiate is a challenge-response scheme that negotiates with the server or proxy to + determine the scheme to use for authentication. For example, this parameter value allows + negotiation to determine whether the Kerberos protocol or NTLM is used. +- `CredSSP`: Use Credential Security Support Provider (CredSSP) authentication, which allows the + user to delegate credentials. This option is designed for commands that run on one remote computer + but collect data from or run additional commands on other remote computers. + +> [!CAUTION] +> CredSSP delegates the user's credentials from the local computer to a remote computer. This +> practice increases the security risk of the remote operation. If the remote computer is +> compromised, when credentials are passed to it, the credentials can be used to control the network +> session. ```yaml Type: Microsoft.WSMan.Management.AuthenticationMechanism @@ -190,13 +203,14 @@ Accept wildcard characters: False ### -CertificateThumbprint -Specifies the digital public key certificate (X509) of a user account that has permission to perform this action. -Enter the certificate thumbprint of the certificate. +Specifies the digital public key certificate (X509) of a user account that has permission to perform +this action. Enter the certificate thumbprint of the certificate. -Certificates are used in client certificate-based authentication. -They can be mapped only to local user accounts; they do not work with domain accounts. +Certificates are used in client certificate-based authentication. They can be mapped only to local +user accounts; they do not work with domain accounts. -To get a certificate thumbprint, use the Get-Item or Get-ChildItem command in the PowerShell Cert: drive. +To get a certificate thumbprint, use the `Get-Item` or `Get-ChildItem` command in the PowerShell +`Cert:` drive. ```yaml Type: System.String @@ -212,12 +226,12 @@ Accept wildcard characters: False ### -ComputerName -Specifies the computer against which you want to run the management operation. -The value can be a fully qualified domain name, a NetBIOS name, or an IP address. -Use the local computer name, use localhost, or use a dot (.) to specify the local computer. -The local computer is the default. -When the remote computer is in a different domain from the user, you must use a fully qualified domain name must be used. -You can pipe a value for this parameter to the cmdlet. +Specifies the computer against which you want to run the management operation. The value can be a +fully qualified domain name, a NetBIOS name, or an IP address. Use the local computer name, +`localhost`, or a dot (`.`) to specify the local computer. The local computer is the default. + +When the remote computer is in a different domain from the user, you must use a fully qualified +domain name. You can pipe a value for this parameter to the cmdlet. ```yaml Type: System.String @@ -233,10 +247,9 @@ Accept wildcard characters: False ### -ConnectionURI -Specifies the connection endpoint. -The format of this string is: +Specifies the connection endpoint. The format of this string is: -\<Transport\>://\<Server\>:\<Port\>/\<ApplicationName\> +`<Transport>://<Server>:<Port>/<ApplicationName>` The following string is a properly formatted value for this parameter: @@ -258,11 +271,10 @@ Accept wildcard characters: False ### -Credential -Specifies a user account that has permission to perform this action. -The default is the current user. -Type a user name, such as "User01", "Domain01\User01", or "User@Domain.com". -Or, enter a PSCredential object, such as one returned by the Get-Credential cmdlet. -When you type a user name, you will be prompted for a password. +Specifies a user account that has permission to perform this action. The default is the current +user. Type a user name, such as `User01`, `Domain01\User01`, or `User@Domain.com`. Alternatively, +enter a **PSCredential** object, such as one returned by the `Get-Credential` cmdlet. When you type +a user name, you will be prompted for a password. ```yaml Type: System.Management.Automation.PSCredential @@ -278,13 +290,12 @@ Accept wildcard characters: False ### -Dialect -Specifies the dialect to use in the filter predicate. -This can be any dialect that is supported by the remote service. -The following aliases can be used for the dialect URI: +Specifies the dialect to use in the filter predicate. This can be any dialect that is supported by +the remote service. The following aliases can be used for the dialect URI: -- WQL: `http://schemas.microsoft.com/wbem/wsman/1/WQL` -- Selector: `http://schemas.microsoft.com/wbem/wsman/1/wsman/SelectorFilter` -- Association: `http://schemas.dmtf.org/wbem/wsman/1/cimbinding/associationFilter` +- `WQL`: `http://schemas.microsoft.com/wbem/wsman/1/WQL` +- `Selector`: `http://schemas.microsoft.com/wbem/wsman/1/wsman/SelectorFilter` +- `Association`: `http://schemas.dmtf.org/wbem/wsman/1/cimbinding/associationFilter` ```yaml Type: System.Uri @@ -300,14 +311,14 @@ Accept wildcard characters: False ### -FilePath -Specifies the path of a file that is used to update a management resource. -You specify the management resource by using the ResourceURI parameter and the SelectorSet parameter . -For example, the following command uses the FilePath parameter: +Specifies the path of a file that is used to update a management resource. You specify the +management resource by using the **ResourceURI** parameter and the **SelectorSet** parameter. For +example, the following command uses the **FilePath** parameter: -`Invoke-WSManAction -action StopService -resourceuri wmicimv2/Win32_Service -SelectorSet @{Name="spooler"} -FilePath:c:\input.xml -authentication default` +`Invoke-WSManAction -Action StopService -ResourceUri wmicimv2/Win32_Service -SelectorSet @{Name="spooler"} -FilePath:c:\input.xml -authentication default` -This command calls the StopService method on the Spooler service by using input from a file. -The file, Input.xml, contains the following content: +This command calls the **StopService** method on the Spooler service by using input from a file. +The file, `Input.xml`, contains the following content: `<p:StopService_INPUT xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Service" />` @@ -325,8 +336,8 @@ Accept wildcard characters: False ### -Fragment -Specifies a section inside the instance that is to be updated or retrieved for the specified operation. -For example, to get the status of a spooler service, specify "-Fragment Status". +Specifies a section inside the instance that is to be updated or retrieved for the specified +operation. For example, to get the status of a spooler service, specify `-Fragment Status`. ```yaml Type: System.String @@ -346,9 +357,10 @@ Passes a set of switches to a service to modify or refine the nature of the requ These are similar to switches used in command-line shells because they are service specific. Any number of options can be specified. -The following example demonstrates the syntax that passes the values 1, 2, and 3 for the a, b, and c parameters: +The following example demonstrates the syntax that passes the values `1`, `2`, and `3` for the `a`, +`b`, and `c` parameters: --OptionSet @{a=1;b=2;c=3} +`-OptionSet @{a=1;b=2;c=3}` ```yaml Type: System.Collections.Hashtable @@ -364,12 +376,14 @@ Accept wildcard characters: False ### -Port -Specifies the port to use when the client connects to the WinRM service. -When the transport is HTTP, the default port is 80. -When the transport is HTTPS, the default port is 443. -When you use HTTPS as the transport, the value of the ComputerName parameter must match the server's certificate common name (CN). -However, if the SkipCNCheck parameter is specified as part of the SessionOption parameter, then the certificate common name of the server does not have to match the host name of the server. -The SkipCNCheck parameter should be used only for trusted machines. +Specifies the port to use when the client connects to the WinRM service. When the transport is HTTP, +the default port is 80. When the transport is HTTPS, the default port is 443. + +When you use HTTPS as the transport, the value of the **ComputerName** parameter must match the +server's certificate common name (CN). However, if the **SkipCNCheck** parameter is specified as +part of the **SessionOption** parameter, then the certificate common name of the server does not +have to match the host name of the server. The **SkipCNCheck** parameter should be used only for +trusted machines. ```yaml Type: System.Int32 @@ -410,11 +424,11 @@ Accept wildcard characters: False ### -SelectorSet Specifies a set of value pairs that are used to select particular management resource instances. -The SelectorSet parameter is used when more than one instance of the resource exists. -The value of the SelectorSet parameter must be a hash table. +The **SelectorSet** parameter is used when more than one instance of the resource exists. +The value of the **SelectorSet** parameter must be a hash table. The following example shows how to enter a value for this parameter: --SelectorSet @{Name="WinRM";ID="yyy"} +`-SelectorSet @{Name="WinRM";ID="yyy"}` ```yaml Type: System.Collections.Hashtable @@ -430,9 +444,9 @@ Accept wildcard characters: False ### -SessionOption -Defines a set of extended options for the WS-Management session. -Enter a SessionOption object that you create by using the New-WSManSessionOption cmdlet. -For more information about the options that are available, see New-WSManSessionOption. +Defines a set of extended options for the WS-Management session. Enter a **SessionOption** object +that you create with the `New-WSManSessionOption` cmdlet. For more information about the options +that are available, see [New-WSManSessionOption](New-WSManSessionOption.md). ```yaml Type: Microsoft.WSMan.Management.SessionOption @@ -448,12 +462,13 @@ Accept wildcard characters: False ### -UseSSL -Specifies that the Secure Sockets Layer (SSL) protocol should be used to establish a connection to the remote computer. -By default, SSL is not used. +Specifies that the Secure Sockets Layer (SSL) protocol should be used to establish a connection to +the remote computer. By default, SSL is not used. -WS-Management encrypts all the Windows PowerShell content that is transmitted over the network. -The UseSSL parameter lets you specify the additional protection of HTTPS instead of HTTP. -If SSL is not available on the port that is used for the connection and you specify this parameter, the command fails. +WS-Management encrypts all the Windows PowerShell content that is transmitted over the network. The +**UseSSL** parameter lets you specify the additional protection of HTTPS instead of HTTP. If SSL is +not available on the port that is used for the connection and you specify this parameter, the +command fails. ```yaml Type: System.Management.Automation.SwitchParameter @@ -469,9 +484,9 @@ Accept wildcard characters: False ### -ValueSet -Specifies a hash table that helps modify a management resource. -You specify the management resource by using the ResourceURI parameter and the SelectorSet parameter. -The value of the ValueSet parameter must be a hash table. +Specifies a hash table that helps modify a management resource. You specify the management resource +by using the **ResourceURI** parameter and the **SelectorSet** parameter. The value of the +**ValueSet** parameter must be a hash table. ```yaml Type: System.Collections.Hashtable @@ -487,7 +502,10 @@ Accept wildcard characters: False ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). ## INPUTS @@ -528,4 +546,3 @@ This cmdlet does not generate any output. [Set-WSManQuickConfig](Set-WSManQuickConfig.md) [Test-WSMan](Test-WSMan.md) - diff --git a/reference/7.3/CimCmdlets/Remove-CimInstance.md b/reference/7.3/CimCmdlets/Remove-CimInstance.md index 9f0d2f3dd0b3..614276b75cd3 100644 --- a/reference/7.3/CimCmdlets/Remove-CimInstance.md +++ b/reference/7.3/CimCmdlets/Remove-CimInstance.md @@ -2,7 +2,7 @@ external help file: Microsoft.Management.Infrastructure.CimCmdlets.dll-Help.xml Locale: en-US Module Name: CimCmdlets -ms.date: 06/21/2021 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/cimcmdlets/remove-ciminstance?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 title: Remove-CimInstance @@ -153,7 +153,7 @@ Accept wildcard characters: False ### -Namespace -Specifies the namespace for the CIM operation. The default namespace is **root/cimv2**. You can use +Specifies the namespace for the CIM operation. The default namespace is `root/cimv2`. You can use tab completion to browse the list of namespaces, because PowerShell gets a list of namespaces from the local WMI server to provide the list of namespaces. @@ -172,7 +172,7 @@ Accept wildcard characters: False ### -OperationTimeoutSec Specifies the amount of time that the cmdlet waits for a response from the computer. By default, the -value of this parameter is 0, which means that the cmdlet uses the default timeout value for the +value of this parameter is `0`, which means that the cmdlet uses the default timeout value for the server. If the **OperationTimeoutSec** parameter is set to a value less than the robust connection retry @@ -199,7 +199,7 @@ Specifies a query to run on the CIM server. You can specify the query dialect us If the value specified contains double quotes (`"`), single quotes (`'`), or a backslash (`\`), you must escape those characters by prefixing them with the backslash (`\`) character. If the value -specified uses the WQL LIKE operator, then you must escape the following characters by enclosing +specified uses the WQL `LIKE` operator, then you must escape the following characters by enclosing them in square brackets (`[]`): percent (`%`), underscore (`_`), or opening square bracket (`[`). ```yaml @@ -217,7 +217,7 @@ Accept wildcard characters: False ### -QueryDialect Specifies the query language used for the Query parameter. The acceptable values for this parameter -are: **WQL** or **CQL**. The default value is **WQL**. +are: `WQL` or `CQL`. The default value is `WQL`. ```yaml Type: System.String @@ -247,7 +247,8 @@ By default, if you do not specify this parameter, the DMTF standard resource URI ResourceURI can only be used with CIM sessions created using the WSMan protocol, or when specifying the ComputerName parameter, which creates a CIM session using WSMan. If you specify this parameter without specifying the ComputerName parameter, or if you specify a CIM session created using DCOM -protocol, you get an error, because the DCOM protocol does not support the ResourceURI parameter. +protocol, you get an error, because the DCOM protocol does not support the **ResourceURI** +parameter. If both the **ResourceUri** parameter and the **Filter** parameter are specified, the **Filter** parameter is ignored. @@ -324,4 +325,3 @@ This cmdlet produces no outputs. [Get-CimInstance](get-ciminstance.md) [Set-CimInstance](Set-CimInstance.md) - diff --git a/reference/7.3/Microsoft.PowerShell.Diagnostics/Get-Counter.md b/reference/7.3/Microsoft.PowerShell.Diagnostics/Get-Counter.md index 622a7b84be82..0c711398bba7 100644 --- a/reference/7.3/Microsoft.PowerShell.Diagnostics/Get-Counter.md +++ b/reference/7.3/Microsoft.PowerShell.Diagnostics/Get-Counter.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Diagnostics.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Diagnostics -ms.date: 06/21/2021 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.diagnostics/get-counter?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-Counter @@ -417,7 +417,7 @@ Path InstanceName CookedValue `Get-Counter` uses the **Counter** parameter to specify the counter `\Processor(*)\% Processor Time`. The values are stored in the `$Counter` variable. The objects stored in `$Counter.CounterSamples` are sent down the pipeline. `Where-Object` uses a script block -to compare each objects value against a specified value of 20. The `$_.CookedValue` is a variable +to compare each objects value against a specified value of `20`. The `$_.CookedValue` is a variable for the current object in the pipeline. Counters with a **CookedValue** that is less than 20 are displayed. @@ -609,7 +609,8 @@ Accept wildcard characters: False This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, --WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS @@ -661,4 +662,3 @@ In PowerShell 7, when using the **ListSet** parameter, `Get-Counter` can't retri [Start-Job](../Microsoft.PowerShell.Core/Start-Job.md) [Where-Object](..//Microsoft.PowerShell.Core/Where-Object.md) - diff --git a/reference/7.3/Microsoft.PowerShell.Management/Add-Content.md b/reference/7.3/Microsoft.PowerShell.Management/Add-Content.md index e90af563dc40..c2663b547e49 100644 --- a/reference/7.3/Microsoft.PowerShell.Management/Add-Content.md +++ b/reference/7.3/Microsoft.PowerShell.Management/Add-Content.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 11/03/2021 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/add-content?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 title: Add-Content @@ -146,7 +146,7 @@ Mode LastWriteTime Length Name `IsReadOnlyTextFile.txt` in the current directory. - The `Set-ItemProperty` cmdlet uses the **Name** and **Value** parameters to change the file's **IsReadOnly** property to True. -- The `Get-ChildItem` cmdlet shows the file is empty (0) and has the read-only attribute (`r`). +- The `Get-ChildItem` cmdlet shows the file is empty (`0`) and has the read-only attribute (`r`). - The `Add-Content` cmdlet uses the **Path** parameter to specify the file. The **Value** parameter includes the text string to append to the file. The **Force** parameter writes the text to the read-only file. diff --git a/reference/7.3/Microsoft.PowerShell.Management/Get-PSDrive.md b/reference/7.3/Microsoft.PowerShell.Management/Get-PSDrive.md index dcd9cb2b7b10..4541066d9640 100644 --- a/reference/7.3/Microsoft.PowerShell.Management/Get-PSDrive.md +++ b/reference/7.3/Microsoft.PowerShell.Management/Get-PSDrive.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 05/14/2019 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/get-psdrive?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-PSDrive @@ -213,7 +213,7 @@ Accept wildcard characters: False ### -Name Specifies, as a string array, the name or name of drives that this cmdlet gets in the operation. -Type the drive name or letter without a colon (:). +Type the drive name or letter without a colon (`:`). ```yaml Type: System.String[] @@ -308,4 +308,3 @@ This cmdlet returns objects that represent the drives in the session. [Remove-PSDrive](Remove-PSDrive.md) [Get-PSProvider](Get-PSProvider.md) - diff --git a/reference/7.3/Microsoft.PowerShell.Management/Get-PSProvider.md b/reference/7.3/Microsoft.PowerShell.Management/Get-PSProvider.md index 23b292429a08..c5e8a70c65aa 100644 --- a/reference/7.3/Microsoft.PowerShell.Management/Get-PSProvider.md +++ b/reference/7.3/Microsoft.PowerShell.Management/Get-PSProvider.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 05/26/2021 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/get-psprovider?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-PSProvider @@ -108,7 +108,7 @@ PS C:\> (get-psprovider FileSystem).home C:\Users\User01 ``` -This example shows that the tilde symbol (~) represents the value of the **Home** property of the +This example shows that the tilde symbol (`~`) represents the value of the **Home** property of the FileSystem provider. The **Home** property value is optional, but for the **FileSystem** provider, it is defined as `$env:homedrive\$env:homepath` or `$home`. diff --git a/reference/7.3/Microsoft.PowerShell.Management/Get-Process.md b/reference/7.3/Microsoft.PowerShell.Management/Get-Process.md index 861a64f96f88..37f9ddb7d2a9 100644 --- a/reference/7.3/Microsoft.PowerShell.Management/Get-Process.md +++ b/reference/7.3/Microsoft.PowerShell.Management/Get-Process.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 06/09/2017 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/get-process?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-Process @@ -82,8 +82,8 @@ Get-Process winword, explorer | Format-List * This command gets all available data about the Winword and Explorer processes on the computer. It uses the **Name** parameter to specify the processes, but it omits the optional parameter name. The -pipeline operator `|` passes the data to the `Format-List` cmdlet, which displays all available -properties `*` of the Winword and Explorer process objects. +pipeline operator (`|`) passes the data to the `Format-List` cmdlet, which displays all available +properties (`*`) of the Winword and Explorer process objects. You can also identify the processes by their process IDs. For instance, `Get-Process -Id 664, 2060`. @@ -94,7 +94,7 @@ Get-Process | Where-Object {$_.WorkingSet -gt 20000000} ``` This command gets all processes that have a working set greater than 20 MB. It uses the -`Get-Process` cmdlet to get all running processes. The pipeline operator `|` passes the process +`Get-Process` cmdlet to get all running processes. The pipeline operator (`|`) passes the process objects to the `Where-Object` cmdlet, which selects only the object with a value greater than 20,000,000 bytes for the **WorkingSet** property. @@ -156,10 +156,10 @@ ProductVersion FileVersion FileName ``` This command uses the **FileVersionInfo** parameter to get the version information for the -pwsh.exe file that is the main module for the PowerShell process. +`pwsh.exe` file that is the main module for the PowerShell process. To run this command with processes that you do not own on Windows Vista and later versions of -Windows, you must open PowerShell with the Run as administrator option. +Windows, you must open PowerShell with the **Run as administrator** option. ### Example 7: Get modules loaded with the specified process @@ -168,10 +168,10 @@ Get-Process SQL* -Module ``` This command uses the **Module** parameter to get the modules that have been loaded by the process. -This command gets the modules for the processes that have names that begin with SQL. +This command gets the modules for the processes that have names that begin with `SQL`. To run this command on Windows Vista and later versions of Windows with processes that you do not -own, you must start PowerShell with the Run as administrator option. +own, you must start PowerShell with the **Run as administrator** option. ### Example 8: Find the owner of a process @@ -186,8 +186,9 @@ Handles WS(K) CPU(s) Id UserName ProcessName ``` This command shows how to find the owner of a process. -On Windows, the **IncludeUserName** parameter requires elevated user rights (Run as Administrator). -The output reveals that the owner is Domain01\user01. +On Windows, the **IncludeUserName** parameter requires elevated user rights +(**Run as Administrator**). +The output reveals that the owner is `Domain01\user01`. ### Example 9: Use an automatic variable to identify the process hosting the current session @@ -240,8 +241,8 @@ command to the `Get-Member` cmdlet `Get-Process | Get-Member`. Indicates that this cmdlet gets the file version information for the program that runs in the process. -On Windows Vista and later versions of Windows, you must open PowerShell with the Run as -administrator option to use this parameter on processes that you do not own. +On Windows Vista and later versions of Windows, you must open PowerShell with the **Run as +administrator** option to use this parameter on processes that you do not own. To get file version information for a process on a remote computer, use the `Invoke-Command` cmdlet. @@ -345,7 +346,7 @@ Accept wildcard characters: False ### -Name Specifies one or more processes by process name. You can type multiple process names (separated by -commas) and use wildcard characters. The parameter name ("Name") is optional. +commas) and use wildcard characters. The parameter name (`Name`) is optional. ```yaml Type: System.String[] @@ -383,26 +384,27 @@ use the **Module** parameter, without the **FileVersionInfo** parameter, it retu ## NOTES -- You can also refer to this cmdlet by its built-in aliases, ps and gps. For more information, see - [about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). +- You can also refer to this cmdlet by its built-in aliases, `ps` and `gps`. For more information, + see [about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). - On computers that are running a 64-bit version of Windows, the 64-bit version of PowerShell gets only 64-bit process modules and the 32-bit version of PowerShell gets only 32-bit process modules. - You can use the properties and methods of the Windows Management Instrumentation (WMI) - Win32_Process object in PowerShell. For information, see `Get-WmiObject` and the WMI SDK. + **Win32_Process** object in PowerShell. For information, see `Get-WmiObject` and the WMI SDK. - The default display of a process is a table that includes the following columns. For a description of all of the properties of process objects, see [Process Properties](/dotnet/api/system.diagnostics.process). - - Handles: The number of handles that the process has opened. - - NPM(K): The amount of non-paged memory that the process is using, in kilobytes. - - PM(K): The amount of pageable memory that the process is using, in kilobytes. - - WS(K): The size of the working set of the process, in kilobytes. - The working set consists of the pages of memory that were recently referenced by the process. - - VM(M): The amount of virtual memory that the process is using, in megabytes. - Virtual memory includes storage in the paging files on disk. - - CPU(s): The amount of processor time that the process has used on all processors, in seconds. - - ID: The process ID (PID) of the process. - - ProcessName: The name of the process. For explanations of the concepts related to processes, see - the Glossary in Help and Support Center and the Help for Task Manager. + - **Handles**: The number of handles that the process has opened. + - **NPM(K)**: The amount of non-paged memory that the process is using, in kilobytes. + - **PM(K)**: The amount of pageable memory that the process is using, in kilobytes. + - **WS(K)**: The size of the working set of the process, in kilobytes. The working set consists of + the pages of memory that were recently referenced by the process. + - **VM(M)**: The amount of virtual memory that the process is using, in megabytes. Virtual memory + includes storage in the paging files on disk. + - **CPU(s)**: The amount of processor time that the process has used on all processors, in + seconds. + - **ID**: The process ID (PID) of the process. + - **ProcessName**: The name of the process. For explanations of the concepts related to processes, + see the Glossary in Help and Support Center and the Help for Task Manager. - You can also use the built-in alternate views of the processes available with `Format-Table`, such as **StartTime** and **Priority**, and you can design your own views. diff --git a/reference/7.3/Microsoft.PowerShell.Management/Get-Service.md b/reference/7.3/Microsoft.PowerShell.Management/Get-Service.md index cb92696e8aaa..7cde2d19d023 100644 --- a/reference/7.3/Microsoft.PowerShell.Management/Get-Service.md +++ b/reference/7.3/Microsoft.PowerShell.Management/Get-Service.md @@ -2,12 +2,11 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 10/30/2019 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/get-service?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-Service --- - # Get-Service ## SYNOPSIS @@ -61,7 +60,7 @@ Get-Service ### Example 2: Get services that begin with a search string -This example retrieves services with service names that begin with WMI (Windows Management +This example retrieves services with service names that begin with `WMI` (Windows Management Instrumentation). ```powershell @@ -70,8 +69,8 @@ Get-Service "wmi*" ### Example 3: Display services that include a search string -This example displays services with a display name that includes the word network. Searching the -display name finds network-related services even when the service name doesn't include Net, such as +This example displays services with a display name that includes the word `network`. Searching the +display name finds network-related services even when the service name doesn't include `Net`, such as xmlprov, the Network Provisioning Service. ```powershell @@ -80,7 +79,7 @@ Get-Service -Displayname "*network*" ### Example 4: Get services that begin with a search string and an exclusion -This example only gets the services with service names that begin with **win**, except for the WinRM +This example only gets the services with service names that begin with `win`, except for the WinRM service. ```powershell @@ -89,14 +88,14 @@ Get-Service -Name "win*" -Exclude "WinRM" ### Example 5: Display services that are currently active -This example displays only the services with a status of Running. +This example displays only the services with a status of `Running`. ```powershell Get-Service | Where-Object {$_.Status -eq "Running"} ``` `Get-Service` gets all the services on the computer and sends the objects down the pipeline. The -`Where-Object` cmdlet, selects only the services with a **Status** property that equals Running. +`Where-Object` cmdlet, selects only the services with a **Status** property that equals `Running`. Status is only one property of service objects. To see all of the properties, type `Get-Service | Get-Member`. @@ -135,9 +134,9 @@ displays the number of dependent services for each service. ### Example 7: Sort services by property value This example shows that when you sort services in ascending order by the value of their **Status** -property, stopped services appear before running services. The reason is because the value of -**Status** is an enumeration, in which Stopped has a value of 1, and Running has a value of 4. For -more information, see +property, stopped services appear before running services. This happens because the value of +**Status** is an enumeration, in which `Stopped` has a value of `1`, and `Running` has a value of +`4`. For more information, see [ServiceControllerStatus](/dotnet/api/system.serviceprocess.servicecontrollerstatus). To list running services first, use the **Descending** parameter of the `Sort-Object` cmdlet. @@ -338,12 +337,13 @@ This cmdlet can display services only when the current user has permission to se cmdlet does not display services, you might not have permission to see them. To find the service name and display name of each service on your system, type `Get-Service`. The -service names appear in the Name column, and the display names appear in the **DisplayName** column. +service names appear in the **Name** column, and the display names appear in the **DisplayName** +column. -When you sort in ascending order by the **Status** property's value, Stopped services appear before -Running services. The service's **Status** property is an enumerated value and the status names -represent integer values. The sort order is based on the integer value, not the name. Stopped -appears before because Running because Stopped has a value of 1, and Running has a value of 4. For +When you sort in ascending order by status value, `Stopped` services appear before `Running` +services. The **Status** property of a service is an enumerated value in which the names of the +statuses represent integer values. The sort is based on the integer value, not the name. `Running` +appears before `Stopped` because `Stopped` has a value of `1`, and `Running` has a value of `4`. For more information, see [ServiceControllerStatus](/dotnet/api/system.serviceprocess.servicecontrollerstatus). diff --git a/reference/7.3/Microsoft.PowerShell.Management/New-ItemProperty.md b/reference/7.3/Microsoft.PowerShell.Management/New-ItemProperty.md index 6c455734cdba..71190404fb40 100644 --- a/reference/7.3/Microsoft.PowerShell.Management/New-ItemProperty.md +++ b/reference/7.3/Microsoft.PowerShell.Management/New-ItemProperty.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 04/28/2022 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/new-itemproperty?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 title: New-ItemProperty @@ -45,10 +45,10 @@ This cmdlet does not add properties to an object. ### Example 1: Add a registry entry -This command adds a new registry entry, "NoOfEmployees", to the "MyCompany" key of the -"HKLM:\Software hive". +This command adds a new registry entry, `NoOfEmployees`, to the `MyCompany` key of the +`HKLM:\Software hive`. -The first command uses the **Path** parameter to specify the path of the "MyCompany" registry key. +The first command uses the **Path** parameter to specify the path of the `MyCompany` registry key. It uses the **Name** parameter to specify a name for the entry and the **Value** parameter to specify its value. @@ -71,25 +71,25 @@ NoOfEmployees : 822 ### Example 2: Add a registry entry to a key -This command adds a new registry entry to a registry key. -To specify the key, it uses a pipeline operator (`|`) to send an object that represents the key to -`New-ItemProperty`. +This command adds a new registry entry to a registry key. To specify the key, it uses a pipeline +operator (`|`) to send an object that represents the key to `New-ItemProperty`. -The first part of the command uses the `Get-Item` cmdlet to get the "MyCompany" registry key. -The pipeline operator sends the results of the command to `New-ItemProperty`, which adds the new -registry entry ("NoOfLocations"), and its value (3), to the "MyCompany" key. +The first part of the command uses the `Get-Item` cmdlet to get the `MyCompany` registry key. The +pipeline operator sends the results of the command to `New-ItemProperty`, which adds the new +registry entry (`NoOfLocations`), and its value (`3`), to the `MyCompany` key. ```powershell Get-Item -Path "HKLM:\Software\MyCompany" | New-ItemProperty -Name NoOfLocations -Value 3 ``` This command works because the parameter-binding feature of PowerShell associates the path of the -`RegistryKey` object that `Get-Item` returns with the **LiteralPath** parameter of -`New-ItemProperty`. For more information, see [about_Pipelines](../Microsoft.PowerShell.Core/About/about_pipelines.md). +**RegistryKey** object that `Get-Item` returns with the **LiteralPath** parameter of +`New-ItemProperty`. For more information, see +[about_Pipelines](../Microsoft.PowerShell.Core/About/about_pipelines.md). ### Example 3: Create a MultiString value in the registry using a Here-String -This example creates a MultiString value using a Here-String. +This example creates a `MultiString` value using a Here-String. ```powershell $newValue = New-ItemProperty -Path "HKLM:\SOFTWARE\ContosoCompany\" -Name 'HereString' -PropertyType MultiString -Value @" @@ -121,6 +121,13 @@ a ### -Credential +Specifies a user account that has permission to perform this action. +The default is the current user. + +Type a user name, such as `User01` or `Domain01\User01`, or enter a **PSCredential** object, such as +one generated by the `Get-Credential` cmdlet. If you type a user name, you are prompted for a +password. + > [!NOTE] > This parameter is not supported by any providers installed with PowerShell. > To impersonate another user, or elevate your credentials when running this cmdlet, @@ -160,11 +167,13 @@ Accept wildcard characters: True ### -Filter -Specifies a filter to qualify the **Path** parameter. The [FileSystem](../Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md) -provider is the only installed PowerShell provider that supports the use of filters. You can find -the syntax for the **FileSystem** filter language in [about_Wildcards](../Microsoft.PowerShell.Core/About/about_Wildcards.md). -Filters are more efficient than other parameters, because the provider applies them when the cmdlet -gets the objects rather than having PowerShell filter the objects after they are retrieved. +Specifies a filter to qualify the **Path** parameter. The +[FileSystem](../Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md) provider is the only +installed PowerShell provider that supports the use of filters. You can find the syntax for the +**FileSystem** filter language in +[about_Wildcards](../Microsoft.PowerShell.Core/About/about_Wildcards.md). Filters are more efficient +than other parameters, because the provider applies them when the cmdlet gets the objects rather +than having PowerShell filter the objects after they are retrieved. ```yaml Type: System.String @@ -200,7 +209,7 @@ Accept wildcard characters: False Specifies, as a string array, an item or items that this cmdlet includes in the operation. The value of this parameter qualifies the **Path** parameter. Enter a path element or pattern, such as -`"*.txt"`. Wildcard characters are permitted. The **Include** parameter is effective only when the +`*.txt`. Wildcard characters are permitted. The **Include** parameter is effective only when the command includes the contents of an item, such as `C:\Windows\*`, where the wildcard character specifies the contents of the `C:\Windows` directory. @@ -220,10 +229,11 @@ Accept wildcard characters: True Specifies a path to one or more locations. The value of **LiteralPath** is used exactly as it is typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose -it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters -as escape sequences. +it in single quotation marks (`'`). Single quotation marks tell PowerShell not to interpret any +characters as escape sequences. -For more information, see [about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). +For more information, see +[about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). ```yaml Type: System.String[] @@ -372,7 +382,8 @@ You cannot pipe input to this cmdlet. ## NOTES `New-ItemProperty` is designed to work with the data exposed by any provider. To list the providers -available in your session, type `Get-PSProvider`. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). +available in your session, type `Get-PSProvider`. For more information, see +[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). ## RELATED LINKS @@ -391,4 +402,3 @@ available in your session, type `Get-PSProvider`. For more information, see [abo [Set-ItemProperty](Set-ItemProperty.md) [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md) - diff --git a/reference/7.3/Microsoft.PowerShell.Management/Remove-PSDrive.md b/reference/7.3/Microsoft.PowerShell.Management/Remove-PSDrive.md index a783b71e370c..ffdc47118756 100644 --- a/reference/7.3/Microsoft.PowerShell.Management/Remove-PSDrive.md +++ b/reference/7.3/Microsoft.PowerShell.Management/Remove-PSDrive.md @@ -30,21 +30,24 @@ Remove-PSDrive [-LiteralName] <String[]> [-PSProvider <String[]>] [-Scope <Strin ## DESCRIPTION -The `Remove-PSDrive` cmdlet deletes temporary PowerShell drives that were created by using the `New-PSDrive` cmdlet. +The `Remove-PSDrive` cmdlet deletes temporary PowerShell drives that were created by using the +`New-PSDrive` cmdlet. -Beginning in Windows PowerShell 3.0, `Remove-PSDrive` also disconnects mapped network drives, including, but not limited to, drives created by using the `Persist` parameter of `New-PSDrive`. +Beginning in Windows PowerShell 3.0, `Remove-PSDrive` also disconnects mapped network drives, +including, but not limited to, drives created by using the **Persist** parameter of `New-PSDrive`. `Remove-PSDrive` cannot delete Windows physical or logical drives. -Beginning in Windows PowerShell 3.0, when an external drive is connected to the computer, PowerShell automatically adds a PSDrive to the file system that represents the new drive. -You do not need to restart PowerShell. -Similarly, when an external drive is disconnected from the computer, PowerShell automatically deletes the PSDrive that represents the removed drive. +Beginning in Windows PowerShell 3.0, when an external drive is connected to the computer, PowerShell +automatically adds a PSDrive to the file system that represents the new drive. You do not need to +restart PowerShell. Similarly, when an external drive is disconnected from the computer, PowerShell +automatically deletes the PSDrive that represents the removed drive. ## EXAMPLES ### Example 1: Remove a file system drive -This command removes a temporary file system drive named "smp". +This command removes a temporary file system drive named `smp`. ```powershell Remove-PSDrive -Name smp @@ -52,7 +55,7 @@ Remove-PSDrive -Name smp ### Example 2: Remove mapped network drives -This command uses `Remove-PSDrive` to disconnect the X: and S: mapped network drives. +This command uses `Remove-PSDrive` to disconnect the `X:` and `S:` mapped network drives. ```powershell Get-PSDrive X, S | Remove-PSDrive @@ -80,10 +83,9 @@ Accept wildcard characters: False Specifies the name of the drive. -The value of **LiteralName** is used exactly as typed. -No characters are interpreted as wildcards. -If the name includes escape characters, enclose it in single quotation marks ('). -Single quotation marks instruct PowerShell not to interpret any characters as escape sequences. +The value of **LiteralName** is used exactly as typed. No characters are interpreted as wildcards. +If the name includes escape characters, enclose it in single quotation marks (`'`). Single quotation +marks instruct PowerShell not to interpret any characters as escape sequences. ```yaml Type: System.String[] @@ -99,8 +101,7 @@ Accept wildcard characters: False ### -Name -Specifies the names of the drives to remove. -Do not type a colon (:) after the drive name. +Specifies the names of the drives to remove. Do not type a colon (`:`) after the drive name. ```yaml Type: System.String[] @@ -116,8 +117,8 @@ Accept wildcard characters: True ### -PSProvider -Specifies an array of **PSProvider** objects. -This cmdlet removes and disconnects all of the drives associated with the specified PowerShell provider. +Specifies an array of **PSProvider** objects. This cmdlet removes and disconnects all of the drives +associated with the specified PowerShell provider. ```yaml Type: System.String[] @@ -133,9 +134,10 @@ Accept wildcard characters: False ### -Scope -Specifies a scope for the drive. -The acceptable values for this parameter are: Global, Local, and Script, or a number relative to the current scope. Scopes number 0 through the number of scopes. The current scope number is 0 and its parent is 1. -For more information, see [about_Scopes](../Microsoft.PowerShell.Core/About/about_Scopes.md). +Specifies a scope for the drive. The acceptable values for this parameter are: `Global`, `Local`, +and `Script`, or a number relative to the current scope. Scopes number `0` through the number of +scopes. The current scope number is `0` and its parent is `1`. For more information, see +[about_Scopes](../Microsoft.PowerShell.Core/About/about_Scopes.md). ```yaml Type: System.String @@ -167,8 +169,7 @@ Accept wildcard characters: False ### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. +Shows what would happen if the cmdlet runs. The cmdlet is not run. ```yaml Type: System.Management.Automation.SwitchParameter @@ -184,13 +185,17 @@ Accept wildcard characters: False ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). ## INPUTS ### System.Management.Automation.PSDriveInfo -You can pipe a drive object, such as one from the `Get-PSDrive` cmdlet, to the `Remove-PSDrive` cmdlet. +You can pipe a drive object, such as one from the `Get-PSDrive` cmdlet, to the `Remove-PSDrive` +cmdlet. ## OUTPUTS @@ -200,7 +205,9 @@ This cmdlet does not return any output. ## NOTES -- The `Remove-PSDrive` cmdlet is designed to work with the data exposed by any PowerShell provider. To list the providers in your session, use the `Get-PSProvider` cmdlet. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). +- The `Remove-PSDrive` cmdlet is designed to work with the data exposed by any PowerShell provider. + To list the providers in your session, use the `Get-PSProvider` cmdlet. For more information, see + [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). ## RELATED LINKS @@ -209,4 +216,3 @@ This cmdlet does not return any output. [New-PSDrive](New-PSDrive.md) [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md) - diff --git a/reference/7.3/Microsoft.PowerShell.Management/Resolve-Path.md b/reference/7.3/Microsoft.PowerShell.Management/Resolve-Path.md index dc180a71e731..f000919d3204 100644 --- a/reference/7.3/Microsoft.PowerShell.Management/Resolve-Path.md +++ b/reference/7.3/Microsoft.PowerShell.Management/Resolve-Path.md @@ -112,7 +112,7 @@ PS C:\> Resolve-Path -LiteralPath 'test[xml]' Specifies a user account that has permission to perform this action. The default is the current user. -Type a user name, such as User01 or Domain01\User01, or pass a **PSCredential** object. You can +Type a user name, such as `User01` or `Domain01\User01`, or pass a **PSCredential** object. You can create a **PSCredential** object using the `Get-Credential` cmdlet. If you type a user name, this cmdlet prompts you for a password. @@ -134,8 +134,8 @@ Accept wildcard characters: False Specifies the path to be resolved. The value of the **LiteralPath** parameter is used exactly as typed. No characters are interpreted as wildcard characters. If the path includes escape characters, -enclose it in single quotation marks. Single quotation marks tell PowerShell not to interpret any -characters as escape sequences. +enclose it in single quotation marks (`'`). Single quotation marks tell PowerShell not to interpret +any characters as escape sequences. ```yaml Type: System.String[] diff --git a/reference/7.3/Microsoft.PowerShell.Management/Start-Service.md b/reference/7.3/Microsoft.PowerShell.Management/Start-Service.md index 90cd88057ee5..a7bf9a433942 100644 --- a/reference/7.3/Microsoft.PowerShell.Management/Start-Service.md +++ b/reference/7.3/Microsoft.PowerShell.Management/Start-Service.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 06/09/2017 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/start-service?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 title: Start-Service @@ -80,7 +80,7 @@ Start-Service -InputObject $s -PassThru | Format-List >> services.txt First we use `Get-Service` to get an object that represent the WMI service and store it in the `$s` variable. Next, we start the service. Without the **PassThru** parameter, `Start-Service` does not -create any output. The pipeline operator (|) passes the object output by `Start-Service` to the +create any output. The pipeline operator (`|`) passes the object output by `Start-Service` to the `Format-List` cmdlet to format the object as a list of its properties. The append redirection operator (`>>`) redirects the output to the services.txt file. The output is added to the end of the existing file. diff --git a/reference/7.3/Microsoft.PowerShell.Security/About/about_Certificate_Provider.md b/reference/7.3/Microsoft.PowerShell.Security/About/about_Certificate_Provider.md index 3548d74ca28d..e243377d1a63 100644 --- a/reference/7.3/Microsoft.PowerShell.Security/About/about_Certificate_Provider.md +++ b/reference/7.3/Microsoft.PowerShell.Security/About/about_Certificate_Provider.md @@ -1,7 +1,7 @@ --- description: Information about the Certificate provider. Locale: en-US -ms.date: 05/12/2022 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.security/about/about_certificate_provider?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 title: about Certificate Provider @@ -31,8 +31,8 @@ Provides access to X.509 certificate stores and certificates in PowerShell. The PowerShell **Certificate** provider lets you get, add, change, clear, and delete certificates and certificate stores in PowerShell. -The **Certificate** drive is a hierarchical namespace containing the -certificate stores and certificates on your computer. +The **Certificate** drive is a hierarchical namespace containing the certificate +stores and certificates on your computer. The **Certificate** provider supports the following cmdlets, which are covered in this article. @@ -78,9 +78,9 @@ the `Cert:` drive. Set-Location Cert: ``` -You can also work with the certificate provider from any other PowerShell -drive. To reference an alias from another location, use the `Cert:` drive name -in the path. +You can also work with the certificate provider from any other PowerShell drive. +To reference an alias from another location, use the `Cert:` drive name in the +path. ```powershell PS Cert:\> Set-Location -Path LocalMachine\Root @@ -163,8 +163,9 @@ Get-ChildItem -Path cert:\LocalMachine\My, cert:\LocalMachine\WebHosting ` ### Find expired certificates on remote computers This command uses the `Invoke-Command` cmdlet to run a `Get-ChildItem` command -on the Srv01 and Srv02 computers. A value of zero (0) in the **ExpiringInDays** -parameter gets certificates on the Srv01 and Srv02 computers that have expired. +on the Srv01 and Srv02 computers. A value of zero (`0`) in the +**ExpiringInDays** parameter gets certificates on the Srv01 and Srv02 computers +that have expired. ```powershell Invoke-Command -ComputerName Srv01, Srv02 {Get-ChildItem -Path cert:\* ` @@ -194,8 +195,8 @@ Get-ChildItem -Path cert:\* -Recurse -DNSName "*fabrikam*" ` ## Opening the Certificates MMC Snap-in -The `Invoke-Item` cmdlet will use the default application to open a path -you specify. For certificates, the default application is the Certificates MMC +The `Invoke-Item` cmdlet will use the default application to open a path you +specify. For certificates, the default application is the Certificates MMC snap-in. This command opens the Certificates MMC snap-in to manage the specified @@ -207,8 +208,8 @@ Invoke-Item cert:\CurrentUser\my\6B8223358119BB08840DEE50FD8AF9EA776CE66B ## Copying Certificates -Copying certificates is not supported by the **Certificate** provider. When -you attempt to copy a certificate, you see this error. +Copying certificates is not supported by the **Certificate** provider. When you +attempt to copy a certificate, you see this error. ``` $path = "Cert:\LocalMachine\Root\E2C0F6662D3C569705B4B31FE2CBF3434094B254" @@ -240,8 +241,8 @@ This command uses the **SSLServerAuthentication** parameter of the `Get-ChildItem` cmdlet to get SSL server authentication certificates in the `My` certificate store. -The returned certificates are piped to the `Move-Item` cmdlet, which moves -the certificates to the `WebHosting` store. +The returned certificates are piped to the `Move-Item` cmdlet, which moves the +certificates to the `WebHosting` store. ```powershell Get-ChildItem cert:\LocalMachine\My -SSLServerAuthentication | Move-Item ` @@ -251,12 +252,12 @@ Get-ChildItem cert:\LocalMachine\My -SSLServerAuthentication | Move-Item ` ## Deleting Certificates and Private Keys The `Remove-Item` cmdlet will remove certificates that you specify. The -`-DeleteKey` dynamic parameter deletes the private key. +**DeleteKey** dynamic parameter deletes the private key. ### Delete a Certificate from the CA store -This command deletes a certificate from the CA certificate store, but leaves -the associated private key intact. +This command deletes a certificate from the CA certificate store, but leaves the +associated private key intact. In the `Cert:` drive, the `Remove-Item` cmdlet supports only the **DeleteKey**, **Path**, **WhatIf**, and **Confirm** parameters. All other parameters are @@ -329,9 +330,9 @@ This command uses the **ExpiringInDays** parameter of the `Get-ChildItem` cmdlet with a value of `0` to get certificates in the `WebHosting` store that have expired. -The variable containing the returned certificates is piped to the -`Remove-Item` cmdlet, which deletes them. The command uses the **DeleteKey** -parameter to delete the private key along with the certificate. +The variable containing the returned certificates is piped to the `Remove-Item` +cmdlet, which deletes them. The command uses the **DeleteKey** parameter to +delete the private key along with the certificate. ```powershell $expired = Get-ChildItem cert:\LocalMachine\WebHosting -ExpiringInDays 0 @@ -349,8 +350,8 @@ cmdlet to create a certificate for testing purposes. In the `Cert:` drive, the `New-Item` cmdlet creates certificate stores in the `LocalMachine` store location. It supports the **Name**, **Path**, **WhatIf**, and **Confirm** parameters. All other parameters are ignored. The command -returns a **System.Security.Cryptography.X509Certificates.X509Store** -that represents the new certificate store. +returns a **System.Security.Cryptography.X509Certificates.X509Store** that +represents the new certificate store. This command creates a new certificate store named `CustomStore` in the `LocalMachine` store location. @@ -366,8 +367,8 @@ This command creates a new certificate store named `HostingStore` in the The command uses the `Invoke-Command` cmdlet to run a `New-Item` command on the Server01 computer. The command returns a -**System.Security.Cryptography.X509Certificates.X509Store** that represents -the new certificate store. +**System.Security.Cryptography.X509Certificates.X509Store** that represents the +new certificate store. ```powershell Invoke-Command { New-Item -Path cert:\LocalMachine\CustomStore } ` @@ -405,25 +406,25 @@ Invoke-Command { Remove-Item -Path cert:\LocalMachine\TestStore -Recurse } ` ## Dynamic parameters -Dynamic parameters are cmdlet parameters that are added by a PowerShell -provider and are available only when the cmdlet is being used in the -provider-enabled drive. These parameters are valid in all subdirectories of the -**Certificate** provider, but are effective only on certificates. +Dynamic parameters are cmdlet parameters that are added by a PowerShell provider +and are available only when the cmdlet is being used in the provider-enabled +drive. These parameters are valid in all subdirectories of the **Certificate** +provider, but are effective only on certificates. > [!NOTE] > Parameters that perform filtering against the **EnhancedKeyUsageList** -> property also return items with an empty**EnhancedKeyUsageList** property -> value. Certificates that have an empty **EnhancedKeyUsageList** can be used -> for all purposes. +> property also return items with an empty **EnhancedKeyUsageList** +> property value. Certificates that have an empty **EnhancedKeyUsageList** can +> be used for all purposes. The following Certificate provider parameters were reintroduced in PowerShell 7.1. -- DNSName -- DocumentEncryptionCert -- EKU -- ExpiringInDays -- SSLServerAuthentication +- **DNSName** +- **DocumentEncryptionCert** +- **EKU** +- **ExpiringInDays** +- **SSLServerAuthentication** ### CodeSigningCert <System.Management.Automation.SwitchParameter> @@ -441,14 +442,15 @@ This parameter gets certificates that have `Code Signing` in their - [Remove-Item](xref:Microsoft.PowerShell.Management.Remove-Item) -This parameter deletes the associated private key when it deletes the certificate. +This parameter deletes the associated private key when it deletes the +certificate. > [!IMPORTANT] > To delete a private key that is associated with a user certificate in the > `Cert:\CurrentUser` store on a remote computer, you must use delegated -> credentials. The `Invoke-Command` cmdlet supports credential delegation -> using the **CredSSP** parameter. You should consider any security risks -> before using `Remove-Item` with `Invoke-Command` and credential delegation. +> credentials. The `Invoke-Command` cmdlet supports credential delegation using +> the **CredSSP** parameter. You should consider any security risks before using +> `Remove-Item` with `Invoke-Command` and credential delegation. This parameter was reintroduced in PowerShell 7.1 @@ -505,10 +507,10 @@ This parameter allows you to specify the type of item created by `New-Item`. In a `Certificate` drive, the following values are allowed: -- Certificate Provider -- Certificate -- Store -- StoreLocation +- `Certificate Provider` +- `Certificate` +- `Store` +- `StoreLocation` #### Cmdlets Supported diff --git a/reference/7.3/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md b/reference/7.3/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md index 5b303e6b604c..039b2cb50176 100644 --- a/reference/7.3/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md +++ b/reference/7.3/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 10/22/2021 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/convertfrom-csv?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 title: ConvertFrom-Csv @@ -147,11 +147,9 @@ generate objects from the CSV strings. ### -Delimiter -Specifies the delimiter that separates the property values in the CSV strings. -The default is a comma (,). - -Enter a character, such as a colon (:). -To specify a semicolon (;) enclose it in single quotation marks. +Specifies the delimiter that separates the property values in the CSV strings. The default is a +comma (`,`). Enter a character, such as a colon (`:`). To specify a semicolon (`;`) enclose it in +single quotation marks. If you specify a character other than the actual string delimiter in the file, `ConvertFrom-Csv` cannot create the objects from the CSV strings and will return the CSV strings. diff --git a/reference/7.3/Microsoft.PowerShell.Utility/ConvertTo-Html.md b/reference/7.3/Microsoft.PowerShell.Utility/ConvertTo-Html.md index bc6b94525957..a0772ab8f595 100644 --- a/reference/7.3/Microsoft.PowerShell.Utility/ConvertTo-Html.md +++ b/reference/7.3/Microsoft.PowerShell.Utility/ConvertTo-Html.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 08/10/2020 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/convertto-html?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 title: ConvertTo-Html @@ -72,7 +72,7 @@ the `Out-File` cmdlet to send the HTML code to the `aliases.htm` file. ### Example 3: Create a web page to display PowerShell events ```powershell -`Get-EventLog` -LogName "Windows PowerShell" | ConvertTo-Html | Out-File pslog.htm +Get-EventLog -LogName "Windows PowerShell" | ConvertTo-Html | Out-File pslog.htm ``` This command creates an HTML page called `pslog.htm` that displays the events in the Windows @@ -103,7 +103,7 @@ on the computer. The command uses the pipeline operator (`|`) to send the proces The command uses the **Property** parameter to select three properties of the process objects to be included in the table. The command uses the **Title** parameter to specify a title for the HTML page. The command also uses the `Out-File` cmdlet to send the resulting HTML to a file named -Proc.htm. +`Proc.htm`. The second command uses the `Invoke-Item` cmdlet to open the `Proc.htm` in the default browser. @@ -157,7 +157,7 @@ Get-Date | ConvertTo-Html -Fragment ``` This command uses `ConvertTo-Html` to generate an HTML table of the current date. The command uses -the `Get-Date` cmdlet to get the current date. It uses a pipeline operator (|) to send the results +the `Get-Date` cmdlet to get the current date. It uses a pipeline operator (`|`) to send the results to the `ConvertTo-Html` cmdlet. The `ConvertTo-Html` command includes the **Fragment** parameter, which limits the output to an HTML @@ -194,12 +194,13 @@ Invoke-Item Services.htm ``` This command creates and opens a Web page that displays the services on the computer that begin with -A. It uses the **Title**, **Body**, **PreContent**, and **PostContent** parameters of +`A`. It uses the **Title**, **Body**, **PreContent**, and **PostContent** parameters of `ConvertTo-Html` to customize the output. The first part of the command uses the `Get-Service` cmdlet to get the services on the computer that -begin with A. The command uses a pipeline operator (`|`) to send the results to the `ConvertTo-Html` -cmdlet. The command also uses the `Out-File` cmdlet to send the output to the Services.htm file. +begin with `A`. The command uses a pipeline operator (`|`) to send the results to the +`ConvertTo-Html` cmdlet. The command also uses the `Out-File` cmdlet to send the output to the +`Services.htm` file. A semicolon (`;`) ends the first command and starts a second command, which uses the `Invoke-Item` cmdlet to open the `Services.htm` file in the default browser. @@ -223,7 +224,7 @@ The charset for the page is set to UTF-8 Get-Service | ConvertTo-HTML -Transitional ``` -This command sets the DOCTYPE of the returned HTML to XHTML Transitional DTD +This command sets the `DOCTYPE` of the returned HTML to **XHTML Transitional DTD** ## PARAMETERS @@ -307,7 +308,7 @@ Accept wildcard characters: False ### -Fragment -Generates only an HTML table. The HTML, HEAD, TITLE, and BODY tags are omitted. +Generates only an HTML table. The `<HTML>`, `<HEAD>`, `<TITLE>`, and `<BODY>` tags are omitted. ```yaml Type: System.Management.Automation.SwitchParameter @@ -418,11 +419,11 @@ Includes the specified properties of the objects in the HTML. The value of the * parameter can be a new calculated property. The calculated property can be a script block or a hash table. Valid key-value pairs are: -- Name (or label) - `<string>` (added in PowerShell 6.x) -- Expression - `<string>` or `<script block>` -- FormatString - `<string>` -- Width - `<int32>` - must be greater than `0` -- Alignment - value can be `Left`, `Center`, or `Right` +- `Name` (or label) - `<string>` (added in PowerShell 6.x) +- `Expression` - `<string>` or `<script block>` +- `FormatString` - `<string>` +- `Width` - `<int32>` - must be greater than `0` +- `Alignment` - value can be `Left`, `Center`, or `Right` For more information, see [about_Calculated_Properties](../Microsoft.PowerShell.Core/About/about_Calculated_Properties.md). @@ -457,7 +458,7 @@ Accept wildcard characters: False ### -Transitional -Changes the **DOCTYPE** to **XHTML Transitional DTD**, Default **DOCTYPE** is **XHTML Strict DTD**. +Changes the `DOCTYPE` to **XHTML Transitional DTD**, Default `DOCTYPE` is **XHTML Strict DTD**. This parameter was introduced in PowerShell 6.0. @@ -509,7 +510,7 @@ quite different. submit the processes on a computer to `ConvertTo-Html`, the resulting table displays an object array and its properties. - To comply with the XHTML Strict DTD, the DOCTYPE tag is modified accordingly: + To comply with the XHTML Strict DTD, the `DOCTYPE` tag is modified accordingly: `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"\>` diff --git a/reference/7.3/Microsoft.PowerShell.Utility/Format-List.md b/reference/7.3/Microsoft.PowerShell.Utility/Format-List.md index ff9c3569eb52..1aed4e4ab7bd 100644 --- a/reference/7.3/Microsoft.PowerShell.Utility/Format-List.md +++ b/reference/7.3/Microsoft.PowerShell.Utility/Format-List.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 12/19/2018 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/format-list?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 title: Format-List @@ -23,7 +23,7 @@ Format-List [[-Property] <Object[]>] [-GroupBy <Object>] [-View <string>] [-Show The `Format-List` cmdlet formats the output of a command as a list of properties in which each property is displayed on a separate line. You can use `Format-List` to format and display all or -selected properties of an object as a list (format-list *). +selected properties of an object as a list (`Format-List -Property *`). Because more space is available for each item in a list than in a table, PowerShell displays more properties of the object in the list, and the property values are less likely to be truncated. @@ -38,7 +38,7 @@ Get-Service | Format-List This command formats information about services on the computer as a list. By default, the services are formatted as a table. The `Get-Service` cmdlet gets objects representing the services on the -computer. The pipeline operator (|) passes the results through the pipeline to `Format-List`. +computer. The pipeline operator (`|`) passes the results through the pipeline to `Format-List`. Then, the `Format-List` command formats the service information in a list and sends it to the default output cmdlet for display. @@ -62,12 +62,12 @@ the formatted output to the default output cmdlet for display. This command displays the name, base priority, and priority class of each process on the computer. ```powershell -Get-Process | Format-List -Property name, basepriority, priorityclass +Get-Process | Format-List -Property Name, BasePriority, PriorityClass ``` It uses the `Get-Process` cmdlet to get an object representing each process. The pipeline operator -(|) passes the process objects through the pipeline to `Format-List`. `Format-List` formats the -processes as a list of the specified properties. The *Property* parameter name is optional, so you +(`|`) passes the process objects through the pipeline to `Format-List`. `Format-List` formats the +processes as a list of the specified properties. The **Property** parameter name is optional, so you can omit it. ### Example 4: Format all properties for a process @@ -79,9 +79,9 @@ Get-Process winlogon | Format-List -Property * ``` It uses the Get-Process cmdlet to get an object representing the Winlogon process. The pipeline -operator (|) passes the Winlogon process object through the pipeline to `Format-List`. The command -uses the *Property* parameter to specify the properties and the \* to indicate all properties. -Because the name of the *Property* parameter is optional, you can omit it and type the command as +operator (`|`) passes the Winlogon process object through the pipeline to `Format-List`. The command +uses the **Property** parameter to specify the properties and the `*` to indicate all properties. +Because the name of the **Property** parameter is optional, you can omit it and type the command as `Format-List *`. `Format-List` automatically sends the results to the default output cmdlet for display. @@ -129,12 +129,12 @@ Accept wildcard characters: False ### -Expand Specifies the formatted collection object, as well as the objects in the collection. This parameter -is designed to format objects that support the ICollection (System.Collections) interface. The -default value is EnumOnly. The acceptable values for this parameter are: +is designed to format objects that support the **System.Collections.ICollection** interface. The +default value is `EnumOnly`. The acceptable values for this parameter are: -- EnumOnly. Displays the properties of the objects in the collection. -- CoreOnly. Displays the properties of the collection object. -- Both. Displays the properties of the collection object and the properties of objects in the +- `EnumOnly`. Displays the properties of the objects in the collection. +- `CoreOnly`. Displays the properties of the collection object. +- `Both`. Displays the properties of the collection object and the properties of objects in the collection. ```yaml @@ -176,9 +176,9 @@ property of the output. The value of the **GroupBy** parameter can be a new calculated property. The calculated property can be a script block or a hash table. Valid key-value pairs are: -- Name (or Label) - `<string>` -- Expression - `<string>` or `<script block>` -- FormatString - `<string>` +- `Name` (or `Label`) - `<string>` +- `Expression` - `<string>` or `<script block>` +- `FormatString` - `<string>` For more information, see [about_Calculated_Properties](../Microsoft.PowerShell.Core/About/about_Calculated_Properties.md). @@ -218,15 +218,15 @@ Specifies the object properties that appear in the display and the order in whic Wildcards are permitted. If you omit this parameter, the properties that appear in the display depend on the object being -displayed. The parameter name "Property" is optional. You cannot use the **Property** and **View** +displayed. The parameter name **Property** is optional. You cannot use the **Property** and **View** parameters in the same command. The value of the **Property** parameter can be a new calculated property. The calculated property can be a script block or a hash table. Valid key-value pairs are: -- Name (or Label) - `<string>` -- Expression - `<string>` or `<script block>` -- FormatString - `<string>` +- `Name` (or `Label`) - `<string>` +- `Expression` - `<string>` or `<script block>` +- `FormatString` - `<string>` For more information, see [about_Calculated_Properties](../Microsoft.PowerShell.Core/About/about_Calculated_Properties.md). @@ -299,17 +299,17 @@ You can pipe any object to `Format-List`. ## NOTES -You can also refer to Format-List by its built-in alias, FL. For more information, see +You can also refer to `Format-List` by its built-in alias, `fl`. For more information, see [about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). The format cmdlets, such as `Format-List`, arrange the data to be displayed but do not display it. -The data is displayed by the output features of PowerShell and by the cmdlets that contain the Out -verb (the Out cmdlets), such as `Out-Host` or `Out-File`. +The data is displayed by the output features of PowerShell and by the cmdlets that contain the `Out` +verb (the `Out` cmdlets), such as `Out-Host` or `Out-File`. If you do not use a format cmdlet, PowerShell applies that default format for each object that it displays. -The **GroupBy** parameter assumes that the objects are sorted. Use Sort-Object before using +The **GroupBy** parameter assumes that the objects are sorted. Use `Sort-Object` before using `Format-List` to group the objects. The **View** parameter lets you specify an alternate format for the table. You can use the views diff --git a/reference/7.3/Microsoft.PowerShell.Utility/Format-Wide.md b/reference/7.3/Microsoft.PowerShell.Utility/Format-Wide.md index a6a684048bdd..424d7bbc1e46 100644 --- a/reference/7.3/Microsoft.PowerShell.Utility/Format-Wide.md +++ b/reference/7.3/Microsoft.PowerShell.Utility/Format-Wide.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 08/10/2020 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/format-wide?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 title: Format-Wide @@ -36,23 +36,23 @@ screen. Get-ChildItem | Format-Wide -Column 3 ``` -The Get-ChildItem cmdlet gets objects representing each file in the directory. The pipeline -operator (|) passes the file objects through the pipeline to `Format-Wide`, which formats them for +The `Get-ChildItem` cmdlet gets objects representing each file in the directory. The pipeline +operator (`|`) passes the file objects through the pipeline to `Format-Wide`, which formats them for output. The **Column** parameter specifies the number of columns. ### Example 2: Format names of registry keys -This command displays the names of registry keys in the HKEY_CURRENT_USER\Software\Microsoft key. +This command displays the names of registry keys in the `HKEY_CURRENT_USER\Software\Microsoft` key. ```powershell Get-ChildItem HKCU:\software\microsoft | Format-Wide -Property pschildname -AutoSize ``` -The Get-ChildItem cmdlet gets objects representing the keys. The path is specified as HKCU:, one of -the drives exposed by the PowerShell Registry provider, followed by the key path. The pipeline -operator (|) passes the registry key objects through the pipeline to `Format-Wide`, which formats -them for output. The **Property** parameter specifies the name of the property, and the -**AutoSize** parameter adjusts the columns for readability. +The `Get-ChildItem` cmdlet gets objects representing the keys. The path is specified as `HKCU:`, one +of the drives exposed by the PowerShell Registry provider, followed by the key path. The pipeline +operator (`|`) passes the registry key objects through the pipeline to `Format-Wide`, which formats +them for output. The **Property** parameter specifies the name of the property, and the **AutoSize** +parameter adjusts the columns for readability. ### Example 3: Troubleshooting format errors @@ -131,14 +131,14 @@ Accept wildcard characters: False ### -Expand Formats the collection object, as well as the objects in the collection. This parameter is designed -to format objects that support the ICollection (System.Collections) interface. The default value is -**EnumOnly**. +to format objects that support the **System.Collections.ICollection** interface. The default value +is `EnumOnly`. Valid values are: -- EnumOnly: Displays the properties of the objects in the collection. -- CoreOnly: Displays the properties of the collection object. -- Both: Displays the properties of the collection object and the properties of objects in the +- `EnumOnly`: Displays the properties of the objects in the collection. +- `CoreOnly`: Displays the properties of the collection object. +- `Both`: Displays the properties of the collection object and the properties of objects in the collection. ```yaml @@ -181,9 +181,9 @@ of the output. The value of the **GroupBy** parameter can be a new calculated property. The calculated property can be a script block or a hash table. Valid key-value pairs are: -- Name (or Label) - `<string>` -- Expression - `<string>` or `<script block>` -- FormatString - `<string>` +- `Name` (or `Label`) - `<string>` +- `Expression` - `<string>` or `<script block>` +- `FormatString` - `<string>` For more information, see [about_Calculated_Properties](../Microsoft.PowerShell.Core/About/about_Calculated_Properties.md). @@ -219,18 +219,17 @@ Accept wildcard characters: False ### -Property -Specifies the object property that appears in the display. -Wildcards are permitted. +Specifies the object property that appears in the display. Wildcards are permitted. If you omit this parameter, the properties that appear in the display depend on the object being -displayed. The parameter name "Property" is optional. You cannot use the **Property** and **View** +displayed. The parameter name **Property** is optional. You cannot use the **Property** and **View** parameters in the same command. -The value of the **Property** parameter can be a new calculated property. The calculated property can -be a script block or a hash table. Valid key-value pairs are: +The value of the **Property** parameter can be a new calculated property. The calculated property +can be a script block or a hash table. Valid key-value pairs are: -- Expression - `<string>` or `<script block>` -- FormatString - `<string>` +- `Expression` - `<string>` or `<script block>` +- `FormatString` - `<string>` For more information, see [about_Calculated_Properties](../Microsoft.PowerShell.Core/About/about_Calculated_Properties.md). @@ -303,7 +302,8 @@ You can pipe any object to `Format-Wide`. ## NOTES -You can also refer to `Format-Wide` by its built-in alias, `fw`. For more information, see [about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). +You can also refer to `Format-Wide` by its built-in alias, `fw`. For more information, see +[about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). The **GroupBy** parameter assumes that the objects are sorted. Use `Sort-Object` before using `Format-Custom` to group the objects. @@ -314,7 +314,7 @@ in new PS1XML files and use the `Update-FormatData` cmdlet to include them in Po The alternate view for the **View** parameter must use table format; if it does not, the command fails. If the alternate view is a list, use `Format-List`. If the alternate view is neither a list -nor a table, use Format-Custom. +nor a table, use `Format-Custom`. ## RELATED LINKS diff --git a/reference/7.3/Microsoft.PowerShell.Utility/Get-Unique.md b/reference/7.3/Microsoft.PowerShell.Utility/Get-Unique.md index 67a65ed97f06..aa0649663ef4 100644 --- a/reference/7.3/Microsoft.PowerShell.Utility/Get-Unique.md +++ b/reference/7.3/Microsoft.PowerShell.Utility/Get-Unique.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 03/12/2019 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/get-unique?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-Unique @@ -47,10 +47,10 @@ $A = $( foreach ($line in Get-Content C:\Test1\File1.txt) { $A.count ``` -The first command gets the content of the File.txt file. It converts each line of text to lowercase -letters and then splits each word onto a separate line at the space (" "). Then, it sorts the -resulting list alphabetically (the default) and uses the `Get-Unique` cmdlet to eliminate any -duplicate words. The results are stored in the `$A` variable. +The first command gets the content of the `File.txt` file. It converts each line of text to +lowercase letters and then splits each word onto a separate line at the space (`" "`). Then, it +sorts the resulting list alphabetically (the default) and uses the `Get-Unique` cmdlet to eliminate +any duplicate words. The results are stored in the `$A` variable. The second command uses the **Count** property of the collection of strings in `$A` to determine how many items are in `$A`. @@ -86,7 +86,7 @@ includes files and directories. Get-ChildItem | Sort-Object {$_.GetType()} | Get-Unique -OnType ``` -The pipeline operator (|) sends the results to the `Sort-Object` cmdlet. The `$_.GetType()` +The pipeline operator (`|`) sends the results to the `Sort-Object` cmdlet. The `$_.GetType()` statement applies the **GetType** method to each file or directory. Then, `Sort-Object` sorts the items by type. Another pipeline operator sends the results to `Get-Unique`. The **OnType** parameter directs `Get-Unique` to return only one object of each type. @@ -99,11 +99,11 @@ This command gets the names of processes running on the computer with duplicates Get-Process | Sort-Object | Select-Object processname | Get-Unique -AsString ``` -The `Get-Process` command gets all of the processes on the computer. The pipeline operator (|) +The `Get-Process` command gets all of the processes on the computer. The pipeline operator (`|`) passes the result to `Sort-Object`, which, by default, sorts the processes alphabetically by -ProcessName. The results are piped to the `Select-Object` cmdlet, which selects only the values of -the ProcessName property of each object. The results are then piped to `Get-Unique` to eliminate -duplicates. +**ProcessName**. The results are piped to the `Select-Object` cmdlet, which selects only the values +of the **ProcessName** property of each object. The results are then piped to `Get-Unique` to +eliminate duplicates. The **AsString** parameter tells `Get-Unique` to treat the **ProcessName** values as strings. Without this parameter, `Get-Unique` treats the **ProcessName** values as objects and returns only @@ -187,14 +187,14 @@ The type of object that `Get-Unique` returns is determined by the input. ## NOTES -You can also refer to `Get-Unique` by its built-in alias, `gu`. For more information, see [about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). +You can also refer to `Get-Unique` by its built-in alias, `gu`. For more information, see +[about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). -To sort a list, use Sort-Object. You can also use the **Unique** parameter of `Sort-Object` to find -the unique items in a list. +To sort a list, use `Sort-Object`. You can also use the **Unique** parameter of `Sort-Object` to +find the unique items in a list. ## RELATED LINKS [Select-Object](Select-Object.md) [Sort-Object](Sort-Object.md) - diff --git a/reference/7.3/Microsoft.PowerShell.Utility/Out-GridView.md b/reference/7.3/Microsoft.PowerShell.Utility/Out-GridView.md index 7be4a935a039..c29728590f20 100644 --- a/reference/7.3/Microsoft.PowerShell.Utility/Out-GridView.md +++ b/reference/7.3/Microsoft.PowerShell.Utility/Out-GridView.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 10/28/2019 +ms.date: 05/17/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/out-gridview?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 title: Out-GridView @@ -45,10 +45,10 @@ Nano Server. You can use the following features of the table to examine your data: -- Hide, Show, and Reorder Columns +- Hide, show, and reorder columns - Sort rows -- Quick Filter -- Add Criteria Filter +- Quick filter +- Add criteria filter - Copy and paste For full instructions, see the [Notes](#notes) section of this article. @@ -71,7 +71,8 @@ Get-Process | Out-GridView ### Example 2: Use a variable to output processes to a grid view -This example also gets the processes running on the local computer and sends them to a grid view window. +This example also gets the processes running on the local computer and sends them to a grid view +window. ```powershell $P = Get-Process @@ -190,10 +191,10 @@ the pipeline, click to select the items and then click OK. The values of this parameter determine how many items you can send down the pipeline. -- None. No items. This is the default value. -- Single. Zero items or one item. Use this value when the next command can take only one input +- `None`. No items. This is the default value. +- `Single`. Zero items or one item. Use this value when the next command can take only one input object. -- Multiple. Zero, one, or many items. Use this value when the next command can take multiple input +- `Multiple`. Zero, one, or many items. Use this value when the next command can take multiple input objects. This value is equivalent to the **Passthru** parameter. ```yaml @@ -361,7 +362,7 @@ include the typed text appear in the table. - Search for text. To search for text in the table, in the Filter box, type the text to find. - Search for multiple words. To search for multiple words in the table, type the words separated by - spaces. `Out-GridView` displays rows that include all the words (logical AND). + spaces. `Out-GridView` displays rows that include all the words (logical **AND**). - Search for literal phrases. To search for phrases that include spaces or special characters, enclose the phrase in quotation marks. `Out-GridView` displays rows that include an exact match for the phrase. @@ -426,4 +427,3 @@ The criteria only affects the display. It does not delete items from the table. [Out-Printer](Out-Printer.md) [Out-String](Out-String.md) - diff --git a/reference/7.3/Microsoft.PowerShell.Utility/Set-Date.md b/reference/7.3/Microsoft.PowerShell.Utility/Set-Date.md index 3ee2dd28eb78..3417031017bb 100644 --- a/reference/7.3/Microsoft.PowerShell.Utility/Set-Date.md +++ b/reference/7.3/Microsoft.PowerShell.Utility/Set-Date.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 04/30/2019 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/set-date?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 title: Set-Date @@ -30,6 +30,7 @@ Set-Date [-Adjust] <TimeSpan> [-DisplayHint <DisplayHintType>] [-WhatIf] [-Confi The `Set-Date` cmdlet changes the system date and time on the computer to a date and time that you specify. + You can specify a new date and/or time by typing a string or by passing a **DateTime** or **TimeSpan** object to `Set-Date`. To specify a new date or time, use the **Date** parameter. To specify a change interval, use the **Adjust** parameter. @@ -38,12 +39,11 @@ To specify a change interval, use the **Adjust** parameter. ### Example 1: Add three days to the system date -This command adds three days to the current system date. -It does not affect the time. -The command uses the **Date** parameter to specify the date. +This command adds three days to the current system date. It does not affect the time. The command +uses the **Date** parameter to specify the date. The `Get-Date` cmdlet returns the current date as a **DateTime** object. The **DateTime** object's -**AddDays** method adds a specified number of days (3) to the current **DateTime** object. +**AddDays** method adds a specified number of days (`3`) to the current **DateTime** object. ```powershell Set-Date -Date (Get-Date).AddDays(3) @@ -137,9 +137,9 @@ Accept wildcard characters: False Specifies which elements of the date and time are displayed.The acceptable values for this parameter are: -- **Date** - displays only the date. -- **Time** - displays only the time. -- **DateTime** - displays the date and time. +- `Date` - displays only the date. +- `Time` - displays only the time. +- `DateTime` - displays the date and time. This parameter affects only the display. It does not affect the **DateTime** object that `Get-Date` retrieves. @@ -216,7 +216,6 @@ You can pipe a date to `Set-Date`. - You can use standard .NET methods with the **DateTime** and **TimeSpan** objects used with `Set-Date`, such as **AddDays**, **AddMonths**, and **FromFileTime**. For more information, see [DateTime Methods](/dotnet/api/system.datetime) and - [TimeSpan Methods](/dotnet/api/system.timespan) in the .NET SDK. ## RELATED LINKS diff --git a/reference/7.3/Microsoft.PowerShell.Utility/Test-Json.md b/reference/7.3/Microsoft.PowerShell.Utility/Test-Json.md index 9b10e7374933..c5dfb7103ade 100644 --- a/reference/7.3/Microsoft.PowerShell.Utility/Test-Json.md +++ b/reference/7.3/Microsoft.PowerShell.Utility/Test-Json.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 07/21/2021 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/test-json?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 title: Test-Json @@ -118,7 +118,7 @@ For more information, see [JSON Schema](https://json-schema.org/). ### Example 3: Test an object against a schema from file JSON schema can reference definitions using `$ref` keyword. The `$ref` can resolve to a URI that -references another file. The `SchemaFile` parameter accepts literal path to the JSON schema file +references another file. The **SchemaFile** parameter accepts literal path to the JSON schema file and allows JSON files to be validated against such schemas. In this example we have `schema.json` file which references `definitions.json`. @@ -162,7 +162,8 @@ PS> Get-Content definitions.json True ``` -For more information, see [Structuring a complex schema](https://json-schema.org/understanding-json-schema/structuring.html). +For more information, see +[Structuring a complex schema](https://json-schema.org/understanding-json-schema/structuring.html). ## PARAMETERS @@ -187,9 +188,9 @@ Accept wildcard characters: False ### -Schema -Specifies a Schema to validate the JSON input against. If passed `Test-Json` will validate that the -Json input conforms to the spec specified by the **Schema** parameter and return `$True` only if the -input conforms to the provided Schema. +Specifies a schema to validate the JSON input against. If passed, `Test-Json` will validate that the +JSON input conforms to the spec specified by the **Schema** parameter and return `$true` only if the +input conforms to the provided schema. For more information, see [JSON Schema](https://json-schema.org/). @@ -207,8 +208,8 @@ Accept wildcard characters: False ### -SchemaFile -Specifies a schema file used to validate the JSON input. When used, the `Test-Json` returns `$True` -only if the JSON input conforms to the Schema defined in the file specified by the **SchemaFile** +Specifies a schema file used to validate the JSON input. When used, the `Test-Json` returns `$true` +only if the JSON input conforms to the schema defined in the file specified by the **SchemaFile** parameter. For more information, see [JSON Schema](https://json-schema.org/). diff --git a/reference/7.3/Microsoft.PowerShell.Utility/Unblock-File.md b/reference/7.3/Microsoft.PowerShell.Utility/Unblock-File.md index 232a0a2cb061..c329b37e0cc2 100644 --- a/reference/7.3/Microsoft.PowerShell.Utility/Unblock-File.md +++ b/reference/7.3/Microsoft.PowerShell.Utility/Unblock-File.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 06/09/2017 +ms.date: 05/16/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/unblock-file?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 title: Unblock-File @@ -10,7 +10,7 @@ title: Unblock-File # Unblock-File ## SYNOPSIS -Unblocks files that were downloaded from the Internet. +Unblocks files that were downloaded from the internet. ## SYNTAX @@ -30,16 +30,16 @@ Unblock-File -LiteralPath <String[]> [-WhatIf] [-Confirm] [<CommonParameters>] > **This cmdlet only works on the Windows and macOS platforms.** -The `Unblock-File` cmdlet lets you open files that were downloaded from the Internet. It unblocks -PowerShell script files that were downloaded from the Internet so you can run them, even when the +The `Unblock-File` cmdlet lets you open files that were downloaded from the internet. It unblocks +PowerShell script files that were downloaded from the internet so you can run them, even when the PowerShell execution policy is **RemoteSigned**. By default, these files are blocked to protect the computer from untrusted files. Before using the `Unblock-File` cmdlet, review the file and its source and verify that it is safe to open. -Internally, the `Unblock-File` cmdlet removes the Zone.Identifier alternate data stream, which has a -value of "3" to indicate that it was downloaded from the Internet. +Internally, the `Unblock-File` cmdlet removes the **Zone.Identifier** alternate data stream, which +has a value of `3` to indicate that it was downloaded from the internet. For more information about PowerShell execution policies, see [about_Execution_Policies](../Microsoft.PowerShell.Core/about/about_Execution_Policies.md). @@ -50,7 +50,7 @@ This cmdlet was introduced in Windows PowerShell 3.0. ### Example 1: Unblock a file -This command unblocks the PowerShellTips.chm file. +This command unblocks the `PowerShellTips.chm` file. ``` PS C:\> Unblock-File -Path C:\Users\User01\Documents\Downloads\PowerShellTips.chm @@ -70,11 +70,11 @@ PS C:\> dir C:\Downloads\*PowerShell* | Unblock-File This command shows how to find and unblock PowerShell scripts. The first command uses the **Stream** parameter of the *Get-Item* cmdlet get files with the -Zone.Identifier stream. +**Zone.Identifier** stream. The second command shows what happens when you run a blocked script in a PowerShell session in which -the execution policy is **RemoteSigned**. The RemoteSigned policy prevents you from running scripts -that are downloaded from the Internet unless they are digitally signed. +the execution policy is **RemoteSigned**. The **RemoteSigned** policy prevents you from running +scripts that are downloaded from the internet unless they are digitally signed. The third command uses the `Unblock-File` cmdlet to unblock the script so it can run in the session. @@ -106,8 +106,8 @@ PS C:\> Get-Item C:\ps-test\Start-ActivityTracker.ps1 | Unblock-File Specifies the files to unblock. Unlike **Path**, the value of the **LiteralPath** parameter is used exactly as it is typed. No characters are interpreted as wildcards. If the path includes escape -characters, enclose it in single quotation marks. Single quotation marks tell PowerShell not to -interpret any characters as escape sequences. +characters, enclose it in single quotation marks (`'`). Single quotation marks tell PowerShell not +to interpret any characters as escape sequences. ```yaml Type: System.String[] diff --git a/reference/7.3/Microsoft.WSMan.Management/Set-WSManInstance.md b/reference/7.3/Microsoft.WSMan.Management/Set-WSManInstance.md index 20419ea6148d..437fe0595d2c 100644 --- a/reference/7.3/Microsoft.WSMan.Management/Set-WSManInstance.md +++ b/reference/7.3/Microsoft.WSMan.Management/Set-WSManInstance.md @@ -2,8 +2,8 @@ external help file: Microsoft.WSMan.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.WSMan.Management -ms.date: 06/09/2017 -online version: https://docs.microsoft.com/powershell/module/microsoft.wsman.management/set-wsmaninstance?view=powershell-7&WT.mc_id=ps-gethelp +ms.date: 05/16/2022 +online version: https://docs.microsoft.com/powershell/module/microsoft.wsman.management/set-wsmaninstance?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 title: Set-WSManInstance --- @@ -35,7 +35,7 @@ Set-WSManInstance [-ConnectionURI <Uri>] [-Dialect <Uri>] [-FilePath <String>] [ ## DESCRIPTION -The Set-WSManInstance cmdlet modifies the management information that is related to a resource. +The `Set-WSManInstance` cmdlet modifies the management information that is related to a resource. This cmdlet uses the WinRM connection/transport layer to modify the information. @@ -61,9 +61,10 @@ CertificateThumbprint : ListeningOn : {127.0.0.1, 172.30.168.171, ::1, 2001:4898:0:fff:0:5efe:172.30.168.171...} ``` -This command disables the https listener on the local computer. +This command disables the HTTPS listener on the local computer. -Important: The *ValueSet* parameter is case-sensitive when matching the properties specified. +> [!IMPORTANT] +> The **ValueSet** parameter is case-sensitive when matching the properties specified. For example, in this command, @@ -89,15 +90,16 @@ Service : Service Winrs : Winrs ``` -This command sets the MaxEnvelopeSizekb value to 200 on the local computer. +This command sets the **MaxEnvelopeSizekb** value to 200 on the local computer. -Important: The ValueSet parameter is case-sensitive when matching the properties specified. +> [!IMPORTANT] +> The **ValueSet** parameter is case-sensitive when matching the properties specified. For example, using the above command. -This fails: -ValueSet @{MaxEnvelopeSizeKB ="200"} +This fails: `-ValueSet @{MaxEnvelopeSizeKB ="200"}` -This succeeds: -ValueSet @{MaxEnvelopeSizekb ="200"} +This succeeds: `-ValueSet @{MaxEnvelopeSizekb ="200"}` ### Example 3: Disable a listener on a remote computer @@ -119,34 +121,35 @@ CertificateThumbprint : ListeningOn : {127.0.0.1, 172.30.168.172, ::1, 2001:4898:0:fff:0:5efe:172.30.168.172...} ``` -This command disables the https listener on the remote computer SERVER02. +This command disables the HTTPS listener on the remote computer SERVER02. -Important: The ValueSet parameter is case-sensitive when matching the properties specified. +> [!IMPORTANT] +> The **ValueSet** parameter is case-sensitive when matching the properties specified. For example, using the above command. -This fails: -ValueSet @{enabled="False"} +This fails: `-ValueSet @{enabled="False"}` -This succeeds: -ValueSet @{Enabled="False"} +This succeeds: `-ValueSet @{Enabled="False"}` ## PARAMETERS ### -ApplicationName -Specifies the application name in the connection. -The default value of the ApplicationName parameter is "WSMAN". -The complete identifier for the remote endpoint is in the following format: +Specifies the application name in the connection. The default value of the **ApplicationName** +parameter is "WSMAN". The complete identifier for the remote endpoint is in the following format: -\<transport\>://\<server\>:\<port\>/\<ApplicationName\> +`<transport>://<server>:<port>/<ApplicationName>` For example: `http://server01:8080/WSMAN` -Internet Information Services (IIS), which hosts the session, forwards requests with this endpoint to the specified application. -This default setting of "WSMAN" is appropriate for most uses. -This parameter is designed to be used when numerous computers establish remote connections to one computer that is running Windows PowerShell. -In this case, IIS hosts Web Services for Management (WS-Management ) for efficiency. +Internet Information Services (IIS), which hosts the session, forwards requests with this endpoint +to the specified application. This default setting of `WSMAN` is appropriate for most uses. This +parameter is designed to be used when numerous computers establish remote connections to one +computer that is running Windows PowerShell. In this case, IIS hosts Web Services for Management +(WS-Management) for efficiency. ```yaml Type: System.String @@ -165,16 +168,26 @@ Accept wildcard characters: False Specifies the authentication mechanism to be used at the server. Possible values are: -- Basic: Basic is a scheme in which the user name and password are sent in clear text to the server or proxy. -- Default : Use the authentication method implemented by the WS-Management protocol. This is the default. -- Digest: Digest is a challenge-response scheme that uses a server-specified data string for the challenge. -- Kerberos: The client computer and the server mutually authenticate by using Kerberos certificates. -- Negotiate: Negotiate is a challenge-response scheme that negotiates with the server or proxy to determine the scheme to use for authentication. For example, this parameter value allows negotiation to determine whether the Kerberos protocol or NTLM is used. -- CredSSP: Use Credential Security Support Provider (CredSSP) authentication, which allows the user to delegate credentials. This option is designed for commands that run on one remote computer but collect data from or run additional commands on other remote computers. - -Caution: CredSSP delegates the user's credentials from the local computer to a remote computer. -This practice increases the security risk of the remote operation. -If the remote computer is compromised, when credentials are passed to it, the credentials can be used to control the network session. +- `Basic`: Basic is a scheme in which the user name and password are sent in clear text to the + server or proxy. +- `Default` : Use the authentication method implemented by the WS-Management protocol. This is the + default. +- `Digest`: Digest is a challenge-response scheme that uses a server-specified data string for the + challenge. +- `Kerberos`: The client computer and the server mutually authenticate by using Kerberos + certificates. +- `Negotiate`: Negotiate is a challenge-response scheme that negotiates with the server or proxy to + determine the scheme to use for authentication. For example, this parameter value allows + negotiation to determine whether the Kerberos protocol or NTLM is used. +- `CredSSP`: Use Credential Security Support Provider (CredSSP) authentication, which allows the + user to delegate credentials. This option is designed for commands that run on one remote computer + but collect data from or run additional commands on other remote computers. + +> [!CAUTION] +> CredSSP delegates the user's credentials from the local computer to a remote computer. This +> practice increases the security risk of the remote operation. If the remote computer is +> compromised, when credentials are passed to it, the credentials can be used to control the network +> session. ```yaml Type: Microsoft.WSMan.Management.AuthenticationMechanism @@ -190,13 +203,14 @@ Accept wildcard characters: False ### -CertificateThumbprint -Specifies the digital public key certificate (X509) of a user account that has permission to perform this action. -Enter the certificate thumbprint of the certificate. +Specifies the digital public key certificate (X509) of a user account that has permission to perform +this action. Enter the certificate thumbprint of the certificate. -Certificates are used in client certificate-based authentication. -They can be mapped only to local user accounts; they do not work with domain accounts. +Certificates are used in client certificate-based authentication. They can be mapped only to local +user accounts; they do not work with domain accounts. -To get a certificate thumbprint, use the Get-Item or Get-ChildItem command in the PowerShell Cert: drive. +To get a certificate thumbprint, use the `Get-Item` or `Get-ChildItem` command in the PowerShell +`Cert:` drive. ```yaml Type: System.String @@ -212,12 +226,12 @@ Accept wildcard characters: False ### -ComputerName -Specifies the computer against which you want to run the management operation. -The value can be a fully qualified domain name, a NetBIOS name, or an IP address. -Use the local computer name, use localhost, or use a dot (.) to specify the local computer. -The local computer is the default. -When the remote computer is in a different domain from the user, you must use a fully qualified domain name must be used. -You can pipe a value for this parameter to the cmdlet. +Specifies the computer against which you want to run the management operation. The value can be a +fully qualified domain name, a NetBIOS name, or an IP address. Use the local computer name, +`localhost`, or a dot (`.`) to specify the local computer. The local computer is the default. + +When the remote computer is in a different domain from the user, you must use a fully qualified +domain name. You can pipe a value for this parameter to the cmdlet. ```yaml Type: System.String @@ -233,16 +247,15 @@ Accept wildcard characters: False ### -ConnectionURI -Specifies the connection endpoint. -The format of this string is: +Specifies the connection endpoint. The format of this string is: -\<Transport\>://\<Server\>:\<Port\>/\<ApplicationName\> +`<Transport>://<Server>:<Port>/<ApplicationName>` The following string is a properly formatted value for this parameter: `http://Server01:8080/WSMAN` -The URI must be fully qualified . +The URI must be fully qualified. ```yaml Type: System.Uri @@ -258,11 +271,10 @@ Accept wildcard characters: False ### -Credential -Specifies a user account that has permission to perform this action. -The default is the current user. -Type a user name, such as "User01", "Domain01\User01", or "User@Domain.com". -Or, enter a PSCredential object, such as one returned by the Get-Credential cmdlet. -When you type a user name, you will be prompted for a password. +Specifies a user account that has permission to perform this action. The default is the current +user. Type a user name, such as `User01`, `Domain01\User01`, or `User@Domain.com`. Alternatively, +enter a **PSCredential** object, such as one returned by the `Get-Credential` cmdlet. When you type +a user name, you will be prompted for a password. ```yaml Type: System.Management.Automation.PSCredential @@ -278,13 +290,12 @@ Accept wildcard characters: False ### -Dialect -Specifies the dialect to use in the filter predicate. -This can be any dialect that is supported by the remote service. -The following aliases can be used for the dialect URI: +Specifies the dialect to use in the filter predicate. This can be any dialect that is supported by +the remote service. The following aliases can be used for the dialect URI: -- WQL: `http://schemas.microsoft.com/wbem/wsman/1/WQL` -- Selector: `http://schemas.microsoft.com/wbem/wsman/1/wsman/SelectorFilter` -- Association: `http://schemas.dmtf.org/wbem/wsman/1/cimbinding/associationFilter` +- `WQL`: `http://schemas.microsoft.com/wbem/wsman/1/WQL` +- `Selector`: `http://schemas.microsoft.com/wbem/wsman/1/wsman/SelectorFilter` +- `Association`: `http://schemas.dmtf.org/wbem/wsman/1/cimbinding/associationFilter` ```yaml Type: System.Uri @@ -300,14 +311,14 @@ Accept wildcard characters: False ### -FilePath -Specifies the path of a file that is used to update a management resource. -You specify the management resource by using the ResourceURI parameter and the SelectorSet parameter . -For example, the following command uses the FilePath parameter: +Specifies the path of a file that is used to update a management resource. You specify the +management resource by using the **ResourceURI** parameter and the **SelectorSet** parameter. For +example, the following command uses the **FilePath** parameter: -`Invoke-WSManAction -action StopService -resourceuri wmicimv2/Win32_Service -SelectorSet @{Name="spooler"} -FilePath:c:\input.xml -authentication default` +`Invoke-WSManAction -Action StopService -ResourceUri wmicimv2/Win32_Service -SelectorSet @{Name="spooler"} -FilePath:c:\input.xml -authentication default` -This command calls the StopService method on the Spooler service by using input from a file. -The file, Input.xml, contains the following content: +This command calls the **StopService** method on the Spooler service by using input from a file. +The file, `Input.xml`, contains the following content: `<p:StopService_INPUT xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Service" />` @@ -325,8 +336,8 @@ Accept wildcard characters: False ### -Fragment -Specifies a section inside the instance that is to be updated or retrieved for the specified operation. -For example, to get the status of a spooler service, specify "-Fragment Status". +Specifies a section inside the instance that is to be updated or retrieved for the specified +operation. For example, to get the status of a spooler service, specify `-Fragment Status`. ```yaml Type: System.String @@ -346,9 +357,10 @@ Passes a set of switches to a service to modify or refine the nature of the requ These are similar to switches used in command-line shells because they are service specific. Any number of options can be specified. -The following example demonstrates the syntax that passes the values 1, 2, and 3 for the a, b, and c parameters: +The following example demonstrates the syntax that passes the values `1`, `2`, and `3` for the `a`, +`b`, and `c` parameters: --OptionSet @{a=1;b=2;c=3} +`-OptionSet @{a=1;b=2;c=3}` ```yaml Type: System.Collections.Hashtable @@ -364,12 +376,14 @@ Accept wildcard characters: False ### -Port -Specifies the port to use when the client connects to the WinRM service. -When the transport is HTTP, the default port is 80. -When the transport is HTTPS, the default port is 443. -When you use HTTPS as the transport, the value of the ComputerName parameter must match the server's certificate common name (CN). -However, if the SkipCNCheck parameter is specified as part of the SessionOption parameter, then the certificate common name of the server does not have to match the host name of the server. -The SkipCNCheck parameter should be used only for trusted machines. +Specifies the port to use when the client connects to the WinRM service. When the transport is HTTP, +the default port is 80. When the transport is HTTPS, the default port is 443. + +When you use HTTPS as the transport, the value of the **ComputerName** parameter must match the +server's certificate common name (CN). However, if the **SkipCNCheck** parameter is specified as +part of the **SessionOption** parameter, then the certificate common name of the server does not +have to match the host name of the server. The **SkipCNCheck** parameter should be used only for +trusted machines. ```yaml Type: System.Int32 @@ -410,11 +424,11 @@ Accept wildcard characters: False ### -SelectorSet Specifies a set of value pairs that are used to select particular management resource instances. -The SelectorSet parameter is used when more than one instance of the resource exists. -The value of the SelectorSet parameter must be a hash table. +The **SelectorSet** parameter is used when more than one instance of the resource exists. +The value of the **SelectorSet** parameter must be a hash table. The following example shows how to enter a value for this parameter: --SelectorSet @{Name="WinRM";ID="yyy"} +`-SelectorSet @{Name="WinRM";ID="yyy"}` ```yaml Type: System.Collections.Hashtable @@ -430,9 +444,9 @@ Accept wildcard characters: False ### -SessionOption -Defines a set of extended options for the WS-Management session. -Enter a SessionOption object that you create by using the New-WSManSessionOption cmdlet. -For more information about the options that are available, see New-WSManSessionOption. +Defines a set of extended options for the WS-Management session. Enter a **SessionOption** object +that you create with the `New-WSManSessionOption` cmdlet. For more information about the options +that are available, see [New-WSManSessionOption](New-WSManSessionOption.md). ```yaml Type: Microsoft.WSMan.Management.SessionOption @@ -448,12 +462,13 @@ Accept wildcard characters: False ### -UseSSL -Specifies that the Secure Sockets Layer (SSL) protocol should be used to establish a connection to the remote computer. -By default, SSL is not used. +Specifies that the Secure Sockets Layer (SSL) protocol should be used to establish a connection to +the remote computer. By default, SSL is not used. -WS-Management encrypts all the Windows PowerShell content that is transmitted over the network. -The UseSSL parameter lets you specify the additional protection of HTTPS instead of HTTP. -If SSL is not available on the port that is used for the connection and you specify this parameter, the command fails. +WS-Management encrypts all the Windows PowerShell content that is transmitted over the network. The +**UseSSL** parameter lets you specify the additional protection of HTTPS instead of HTTP. If SSL is +not available on the port that is used for the connection and you specify this parameter, the +command fails. ```yaml Type: System.Management.Automation.SwitchParameter @@ -469,9 +484,9 @@ Accept wildcard characters: False ### -ValueSet -Specifies a hash table that helps modify a management resource. -You specify the management resource by using the ResourceURI parameter and the SelectorSet parameter. -The value of the ValueSet parameter must be a hash table. +Specifies a hash table that helps modify a management resource. You specify the management resource +by using the **ResourceURI** parameter and the **SelectorSet** parameter. The value of the +**ValueSet** parameter must be a hash table. ```yaml Type: System.Collections.Hashtable @@ -487,7 +502,10 @@ Accept wildcard characters: False ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). ## INPUTS @@ -528,4 +546,3 @@ This cmdlet does not generate any output. [Set-WSManQuickConfig](Set-WSManQuickConfig.md) [Test-WSMan](Test-WSMan.md) - From 217e6a43284c81684173070a95a2e77cbefe51f4 Mon Sep 17 00:00:00 2001 From: Sean Wheeler <sean.wheeler@microsoft.com> Date: Tue, 17 May 2022 15:54:16 -0500 Subject: [PATCH 3/3] Add link to videos (#8826) --- reference/docs-conceptual/overview.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reference/docs-conceptual/overview.md b/reference/docs-conceptual/overview.md index 1c43c3d80a54..a98b11d99813 100644 --- a/reference/docs-conceptual/overview.md +++ b/reference/docs-conceptual/overview.md @@ -1,6 +1,6 @@ --- description: This article is an introduction to the PowerShell scripting environment and its features. -ms.date: 02/15/2022 +ms.date: 05/17/2022 title: What is PowerShell? --- @@ -69,8 +69,9 @@ enables you to manage your enterprise infrastructure with configuration as code. Are you new to PowerShell and don't know where to start? Take a look at these resources. - [Installing PowerShell][install] -- [PowerShell 101][PS101] - [PowerShell Bits tutorials][tutorials] +- [PowerShell 101][PS101] +- [Microsoft Virtual Academy videos][ch9vids] - [PowerShell Learn modules][learn] ### PowerShell in action @@ -109,3 +110,4 @@ Take a look at how PowerShell is being used in different scenarios and on differ [devops]: /azure/devops/pipelines/release/dsc-cicd [exchange]: /powershell/exchange/exchange-management-shell [remoting]: /powershell/scripting/learn/remoting/ssh-remoting-in-powershell-core +[ch9vids]: /shows/browse?terms=powershell