diff --git a/reference/5.1/Microsoft.PowerShell.Management/Start-Process.md b/reference/5.1/Microsoft.PowerShell.Management/Start-Process.md index c94b9c6cfaa7..5b46f46f87ac 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Start-Process.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Start-Process.md @@ -109,7 +109,7 @@ verbs are determined by the filename extension of the file that runs in the proc ```powershell $startExe = New-Object System.Diagnostics.ProcessStartInfo -Args powershell.exe -$startExe.verbs +$startExe.Verbs ``` ```Output @@ -131,8 +131,8 @@ Note that the first command specifies a string as **ArgumentList**. The second c array. ```powershell -Start-Process -FilePath "$env:comspec" -ArgumentList "/c dir `"%SystemDrive%\Program Files`"" -Start-Process -FilePath "$env:comspec" -ArgumentList "/c","dir","`"%SystemDrive%\Program Files`"" +Start-Process -FilePath "$Env:ComSpec" -ArgumentList "/c dir `"%SystemDrive%\Program Files`"" +Start-Process -FilePath "$Env:ComSpec" -ArgumentList "/c","dir","`"%SystemDrive%\Program Files`"" ``` ## PARAMETERS diff --git a/reference/5.1/Microsoft.PowerShell.Management/Start-Service.md b/reference/5.1/Microsoft.PowerShell.Management/Start-Service.md index 94b89ba66182..4a58e8704230 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Start-Service.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Start-Service.md @@ -94,7 +94,7 @@ Start-Service : Service 'Telnet (TlntSvr)' cannot be started due to the followin At line:1 char:14 + Start-Service <<<< tlntsvr -PS> Get-CimInstance win32_service | Where-Object Name -eq "tlntsvr" +PS> Get-CimInstance Win32_Service | Where-Object Name -EQ "tlntsvr" ExitCode : 0 Name : TlntSvr ProcessId : 0 diff --git a/reference/5.1/Microsoft.PowerShell.Management/Stop-Computer.md b/reference/5.1/Microsoft.PowerShell.Management/Stop-Computer.md index 64a3ffc89b83..637e176320d5 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Stop-Computer.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Stop-Computer.md @@ -398,8 +398,8 @@ When you use the **AsJob** parameter, this cmdlet returns a **RemotingJob** obje ## NOTES This cmdlet uses the -[`Win32Shutdown`](/windows/desktop/CIMWin32Prov/win32shutdown-method-in-class-win32-operatingsystem) -method of the [`Win32_OperatingSystem`](/windows/desktop/CIMWin32Prov/win32-operatingsystem) WMI +[Win32Shutdown](/windows/desktop/CIMWin32Prov/win32shutdown-method-in-class-win32-operatingsystem) +method of the [Win32_OperatingSystem](/windows/desktop/CIMWin32Prov/win32-operatingsystem) WMI class. This method requires the `SeShutdownPrivilege` privilege be enabled for the user account used to shutdown the machine. diff --git a/reference/5.1/Microsoft.PowerShell.Management/Test-Path.md b/reference/5.1/Microsoft.PowerShell.Management/Test-Path.md index 773fd85506a9..5152e7704eee 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Test-Path.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Test-Path.md @@ -123,7 +123,7 @@ In this case, because the directory contains only .dwg files, the result is `$fa ### Example 4: Check for a file ```powershell -Test-Path -Path $PROFILE -PathType leaf +Test-Path -Path $PROFILE -PathType Leaf ``` ```Output @@ -135,7 +135,7 @@ case, because the PowerShell profile is a `.ps1` file, the cmdlet returns `$true ### Example 5: Check paths in the Registry -These commands use `Test-Path` with the PowerShell registry provider. +These commands use `Test-Path` with the PowerShell Registry provider. The first command tests whether the registry path of the **Microsoft.PowerShell** registry key is correct on the system. If PowerShell is installed correctly, the cmdlet returns `$true`. @@ -163,13 +163,13 @@ False ### Example 6: Test if a file is newer than a specified date -This command uses the **NewerThan** dynamic parameter to determine whether the `PowerShell.exe` +This command uses the **NewerThan** dynamic parameter to determine whether the `powershell.exe` file on the computer is newer than `July 13, 2009`. The NewerThan parameter works only in file system drives. ```powershell -Test-Path $PSHOME\PowerShell.exe -NewerThan "July 13, 2009" +Test-Path $PSHOME\powershell.exe -NewerThan "July 13, 2009" ``` ```Output diff --git a/reference/5.1/Microsoft.PowerShell.Management/Wait-Process.md b/reference/5.1/Microsoft.PowerShell.Management/Wait-Process.md index 8a09ac73bf9b..010f3a56451f 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Wait-Process.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Wait-Process.md @@ -47,7 +47,7 @@ stopped. You can specify a process by process name or process ID (PID), or pipe ### Example 1: Stop a process and wait ``` -PS C:\> $nid = (Get-Process notepad).id +PS C:\> $nid = (Get-Process notepad).Id PS C:\> Stop-Process -Id $nid PS C:\> Wait-Process -Id $nid ``` @@ -67,7 +67,7 @@ The third command uses `Wait-Process` to wait until the Notepad process is stopp ``` PS C:\> $p = Get-Process notepad -PS C:\> Wait-Process -Id $p.id +PS C:\> Wait-Process -Id $p.Id PS C:\> Wait-Process -Name "notepad" PS C:\> Wait-Process -InputObject $p ``` 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 83a7bf989720..8039551e9edd 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 @@ -74,7 +74,7 @@ the `Cert:` drive. Set-Location Cert: ``` -You can also work with the certificate provider from any other PowerShell +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. @@ -112,7 +112,7 @@ The example shows the new certificate script properties (**DnsNameList**, **EnhancedKeyUsageList**, **SendAsTrustedIssuer**) using `Select-Object`. ```powershell -$c = Get-Item cert:\LocalMachine\My\52A149D0393CE8A8D4AF0B172ED667A9E3A1F44E +$c = Get-Item Cert:\LocalMachine\My\52A149D0393CE8A8D4AF0B172ED667A9E3A1F44E $c | Format-List DnsNameList, EnhancedKeyUsageList, SendAsTrustedIssuer ``` @@ -130,7 +130,7 @@ This command uses the **CodeSigningCert** and **Recurse** parameters of the code-signing authority. ```powershell -Get-ChildItem -Path cert: -CodeSigningCert -Recurse +Get-ChildItem -Path Cert: -CodeSigningCert -Recurse ``` ### Find expired certificates @@ -139,7 +139,7 @@ This command uses the **ExpiringInDays** parameter of the `Get-ChildItem` cmdlet to get certificates that expire within the next 30 days. ```powershell -Get-ChildItem -Path cert:\LocalMachine\WebHosting -ExpiringInDays 30 +Get-ChildItem -Path Cert:\LocalMachine\WebHosting -ExpiringInDays 30 ``` ### Find Server SSL Certificates @@ -150,7 +150,7 @@ This command uses the **SSLServerAuthentication** parameter of the ```powershell $getChildItemSplat = @{ - Path = 'cert:\LocalMachine\My', 'cert:\LocalMachine\WebHosting' + Path = 'Cert:\LocalMachine\My', 'Cert:\LocalMachine\WebHosting' SSLServerAuthentication = $true } Get-ChildItem @getChildItemSplat @@ -167,7 +167,7 @@ that have expired. $invokeCommandSplat = @{ ComputerName = 'Srv01', 'Srv02' ScriptBlock = { - Get-ChildItem -Path cert:\* -Recurse -ExpiringInDays 0 + Get-ChildItem -Path Cert:\* -Recurse -ExpiringInDays 0 } } Invoke-Command @invokeCommandSplat @@ -186,9 +186,9 @@ have the following attributes: The **NotAfter** property stores the certificate expiration date. ```powershell -[DateTime] $ValidThrough = (Get-Date) + (New-TimeSpan -Days 30) +[datetime] $ValidThrough = (Get-Date) + (New-TimeSpan -Days 30) $getChildItemSplat = @{ - Path = 'cert:\*' + Path = 'Cert:\*' Recurse = $true DnsName = "*fabrikam*" Eku = "*Client Authentication*" @@ -207,7 +207,7 @@ This command opens the Certificates MMC snap-in to manage the specified certificate. ```powershell -Invoke-Item cert:\CurrentUser\my\6B8223358119BB08840DEE50FD8AF9EA776CE66B +Invoke-Item Cert:\CurrentUser\my\6B8223358119BB08840DEE50FD8AF9EA776CE66B ``` ## Copying Certificates @@ -252,8 +252,8 @@ 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 -Destination cert:\LocalMachine\WebHosting +Get-ChildItem Cert:\LocalMachine\My -SSLServerAuthentication | + Move-Item -Destination Cert:\LocalMachine\WebHosting ``` ## Deleting Certificates and Private Keys @@ -271,7 +271,7 @@ In the `Cert:` drive, the `Remove-Item` cmdlet supports only the **DeleteKey**, ignored. ```powershell -Remove-Item cert:\LocalMachine\CA\5DDC44652E62BF9AA1116DC41DE44AB47C87BDD0 +Remove-Item Cert:\LocalMachine\CA\5DDC44652E62BF9AA1116DC41DE44AB47C87BDD0 ``` ### Delete a Certificate using a wildcards in the DNS name @@ -281,7 +281,7 @@ This command deletes all certificates that have a DNS name that contains get the certificates and the `Remove-Item` cmdlet to delete them. ```powershell -Get-ChildItem -Path cert:\LocalMachine -DnsName *Fabrikam* | Remove-Item +Get-ChildItem -Path Cert:\LocalMachine -DnsName *Fabrikam* | Remove-Item ``` ### Delete private keys from a remote computer @@ -327,7 +327,7 @@ parameter to remove the private key along with the specified certificate. ```powershell Invoke-Command -Session $s { $removeItemSplat = @{ - Path = 'cert:\LocalMachine\My\D2D38EBA60CAA1C12055A2E1C83B15AD450110C2' + Path = 'Cert:\LocalMachine\My\D2D38EBA60CAA1C12055A2E1C83B15AD450110C2' DeleteKey = $true } Remove-Item @removeItemSplat @@ -345,7 +345,7 @@ 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 +$expired = Get-ChildItem Cert:\LocalMachine\WebHosting -ExpiringInDays 0 $expired | Remove-Item -DeleteKey ``` @@ -367,7 +367,7 @@ This command creates a new certificate store named `CustomStore` in the `LocalMachine` store location. ```powershell -New-Item -Path cert:\LocalMachine\CustomStore +New-Item -Path Cert:\LocalMachine\CustomStore ``` ### Create a new certificate store on a remote computer @@ -382,7 +382,7 @@ new certificate store. ```powershell Invoke-Command -ComputerName Server01 -ScriptBlock { - New-Item -Path cert:\LocalMachine\CustomStore + New-Item -Path Cert:\LocalMachine\CustomStore } ``` @@ -415,7 +415,7 @@ store. ```powershell Invoke-Command -ComputerName S1, S2 -ScriptBlock { - Remove-Item -Path cert:\LocalMachine\TestStore -Recurse + Remove-Item -Path Cert:\LocalMachine\TestStore -Recurse } ``` @@ -540,7 +540,7 @@ This parameter was introduced in PowerShell 3.0. ## Script properties -New script properties have been added to the **x509Certificate2** object that +New script properties have been added to the **X509Certificate2** object that represents the certificates to make it easy to search and manage the certificates. @@ -581,7 +581,7 @@ Get-Help Get-ChildItem ``` ```powershell -Get-Help Get-ChildItem -Path cert: +Get-Help Get-ChildItem -Path Cert: ``` ## See also diff --git a/reference/5.1/Microsoft.PowerShell.Security/Get-Acl.md b/reference/5.1/Microsoft.PowerShell.Security/Get-Acl.md index b0eb4ca41d77..362dd0a9e385 100644 --- a/reference/5.1/Microsoft.PowerShell.Security/Get-Acl.md +++ b/reference/5.1/Microsoft.PowerShell.Security/Get-Acl.md @@ -66,7 +66,7 @@ Get-Acl C:\Windows\s*.log | Format-List -Property PSPath, Sddl The command uses the `Get-Acl` cmdlet to get objects representing the security descriptors of each log file. It uses a pipeline operator (`|`) to send the results to the `Format-List` cmdlet. The -command uses the **Property** parameter of `Format-List` to display only the **PsPath** and **SDDL** +command uses the **Property** parameter of `Format-List` to display only the **PSPath** and **SDDL** properties of each security descriptor object. Lists are often used in PowerShell, because long values appear truncated in tables. @@ -325,7 +325,7 @@ and access list, PowerShell displays the following properties and property value Descriptor Definition Language format. PowerShell uses the **GetSddlForm** method of security descriptors to get this data. -Because `Get-Acl` is supported by the file system and registry providers, you can use `Get-Acl` to +Because `Get-Acl` is supported by the FileSystem and Registry providers, you can use `Get-Acl` to view the ACL of file system objects, such as files and directories, and registry objects, such as registry keys and entries. diff --git a/reference/5.1/Microsoft.PowerShell.Security/Get-Credential.md b/reference/5.1/Microsoft.PowerShell.Security/Get-Credential.md index 633a4449f1d8..f4645ef133e7 100644 --- a/reference/5.1/Microsoft.PowerShell.Security/Get-Credential.md +++ b/reference/5.1/Microsoft.PowerShell.Security/Get-Credential.md @@ -61,7 +61,7 @@ the **Credential** parameter. ### Example 2 ```powershell -$c = Get-Credential -credential User01 +$c = Get-Credential -Credential User01 $c.Username User01 ``` @@ -75,7 +75,7 @@ object. ### Example 3 ```powershell -$Credential = $Host.ui.PromptForCredential("Need credentials", "Please enter your user name and password.", "", "NetBiosUserName") +$Credential = $Host.UI.PromptForCredential("Need credentials", "Please enter your user name and password.", "", "NetBiosUserName") ``` This command uses the **PromptForCredential** method to prompt the user for their user name and diff --git a/reference/5.1/Microsoft.PowerShell.Security/Protect-CmsMessage.md b/reference/5.1/Microsoft.PowerShell.Security/Protect-CmsMessage.md index 42589851c5c6..301b101234fa 100644 --- a/reference/5.1/Microsoft.PowerShell.Security/Protect-CmsMessage.md +++ b/reference/5.1/Microsoft.PowerShell.Security/Protect-CmsMessage.md @@ -110,10 +110,10 @@ PS C:\> cd Cert:\CurrentUser\My PS Cert:\CurrentUser\My> Get-ChildItem -DocumentEncryptionCert ``` -To view document encryption certificates in the certificate provider, you can add the +To view document encryption certificates in the Certificate provider, you can add the **DocumentEncryptionCert** dynamic parameter of [Get-ChildItem](../Microsoft.PowerShell.Management/Get-ChildItem.md), available only when the -certificate provider is loaded. +Certificate provider is loaded. ## PARAMETERS @@ -193,7 +193,7 @@ Accept wildcard characters: False Specifies one or more CMS message recipients, identified in any of the following formats: -- An actual certificate (as retrieved from the certificate provider). +- An actual certificate (as retrieved from the Certificate provider). - Path to the file containing the certificate. - Path to a directory containing the certificate. - Thumbprint of the certificate (used to look in the certificate store). diff --git a/reference/5.1/Microsoft.PowerShell.Security/Set-Acl.md b/reference/5.1/Microsoft.PowerShell.Security/Set-Acl.md index 445f31b977f8..9a45ea7c4586 100644 --- a/reference/5.1/Microsoft.PowerShell.Security/Set-Acl.md +++ b/reference/5.1/Microsoft.PowerShell.Security/Set-Acl.md @@ -105,7 +105,7 @@ The first command in the pipeline uses the Get-ChildItem cmdlet to get all of th `C:\Temp` directory. The **Recurse** parameter extends the command to all subdirectories of `C:\temp`. The **Include** parameter limits the files retrieved to those with the `.txt` file name extension. The **Force** parameter gets hidden files, which would otherwise be excluded. (You cannot -use `c:\temp\*.txt`, because the **Recurse** parameter works on directories, not on files.) +use `C:\temp\*.txt`, because the **Recurse** parameter works on directories, not on files.) The pipeline operator (`|`) sends the objects representing the retrieved files to the `Set-Acl` cmdlet, which applies the security descriptor in the **AclObject** parameter to all of the files in @@ -460,7 +460,7 @@ security object depends on the type of the item. ## NOTES -The `Set-Acl` cmdlet is supported by the PowerShell file system and registry providers. As such, you +The `Set-Acl` cmdlet is supported by the PowerShell FileSystem and Registry providers. As such, you can use it to change the security descriptors of files, directories, and registry keys. ## RELATED LINKS diff --git a/reference/7.4/Microsoft.PowerShell.Management/Start-Process.md b/reference/7.4/Microsoft.PowerShell.Management/Start-Process.md index ff6c31e21408..620ea4a23234 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Start-Process.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Start-Process.md @@ -108,7 +108,7 @@ verbs are determined by the filename extension of the file that runs in the proc ```powershell $startExe = New-Object System.Diagnostics.ProcessStartInfo -Args powershell.exe -$startExe.verbs +$startExe.Verbs ``` ```Output @@ -130,8 +130,8 @@ Note that the first command specifies a string as **ArgumentList**. The second c array. ```powershell -Start-Process -FilePath "$env:comspec" -ArgumentList "/c dir `"%SystemDrive%\Program Files`"" -Start-Process -FilePath "$env:comspec" -ArgumentList "/c","dir","`"%SystemDrive%\Program Files`"" +Start-Process -FilePath "$Env:ComSpec" -ArgumentList "/c dir `"%SystemDrive%\Program Files`"" +Start-Process -FilePath "$Env:ComSpec" -ArgumentList "/c","dir","`"%SystemDrive%\Program Files`"" ``` ### Example 8: Create a detached process on Linux @@ -147,7 +147,7 @@ alive even after you close the launching session. The `nohup` command collects o ```powershell # Runs for 2 minutes and appends output to ./nohup.out -Start-Process nohup 'pwsh -noprofile -c "1..120 | % { Write-Host . -NoNewline; sleep 1 }"' +Start-Process nohup 'pwsh -NoProfile -c "1..120 | % { Write-Host . -NoNewline; sleep 1 }"' ``` In this example, `Start-Process` is running the Linux `nohup` command, which launches `pwsh` as a @@ -167,12 +167,12 @@ command doesn't override the environment variable. In the second command, `FOO` the third command, `FOO` is set to `$null`, which removes it. ```powershell -$env:FOO = 'foo' -Start-Process pwsh -NoNewWindow -ArgumentList '-c', '$env:FOO' -Start-Process pwsh -NoNewWindow -ArgumentList '-c', '$env:FOO' -Environment @{ +$Env:FOO = 'foo' +Start-Process pwsh -NoNewWindow -ArgumentList '-c', '$Env:FOO' +Start-Process pwsh -NoNewWindow -ArgumentList '-c', '$Env:FOO' -Environment @{ FOO = 'bar' } -Start-Process pwsh -NoNewWindow -ArgumentList '-c', '$env:FOO' -Environment @{ +Start-Process pwsh -NoNewWindow -ArgumentList '-c', '$Env:FOO' -Environment @{ FOO = $null } ``` @@ -402,7 +402,7 @@ started process runs with the environment variables inherited from the parent pr On Windows, when you use **UseNewEnvironment**, the new process starts only containing the default environment variables defined for the **Machine** scope. This has the side effect that the -`$env:USERNAME` is set to **SYSTEM**. None of the variables from the **User** scope are included. +`$Env:USERNAME` is set to **SYSTEM**. None of the variables from the **User** scope are included. ```yaml Type: System.Management.Automation.SwitchParameter diff --git a/reference/7.4/Microsoft.PowerShell.Management/Start-Service.md b/reference/7.4/Microsoft.PowerShell.Management/Start-Service.md index 26207223353d..86c8329b1c41 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Start-Service.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Start-Service.md @@ -96,7 +96,7 @@ Start-Service : Service 'Telnet (TlntSvr)' cannot be started due to the followin At line:1 char:14 + Start-Service <<<< tlntsvr -PS> Get-CimInstance win32_service | Where-Object Name -eq "tlntsvr" +PS> Get-CimInstance Win32_Service | Where-Object Name -EQ "tlntsvr" ExitCode : 0 Name : TlntSvr ProcessId : 0 diff --git a/reference/7.4/Microsoft.PowerShell.Management/Stop-Computer.md b/reference/7.4/Microsoft.PowerShell.Management/Stop-Computer.md index 725bc0beb0f2..642440d6344e 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Stop-Computer.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Stop-Computer.md @@ -266,8 +266,8 @@ This cmdlet returns no output. ## NOTES This cmdlet uses the -[`Win32Shutdown`](/windows/desktop/CIMWin32Prov/win32shutdown-method-in-class-win32-operatingsystem) -method of the [`Win32_OperatingSystem`](/windows/desktop/CIMWin32Prov/win32-operatingsystem) WMI +[Win32Shutdown](/windows/desktop/CIMWin32Prov/win32shutdown-method-in-class-win32-operatingsystem) +method of the [Win32_OperatingSystem](/windows/desktop/CIMWin32Prov/win32-operatingsystem) WMI class. This method requires the `SeShutdownPrivilege` privilege be enabled for the user account used to shutdown the machine. diff --git a/reference/7.4/Microsoft.PowerShell.Management/Test-Path.md b/reference/7.4/Microsoft.PowerShell.Management/Test-Path.md index 5c24f55b78a0..3960b4057ee0 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Test-Path.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Test-Path.md @@ -121,7 +121,7 @@ In this case, because the directory contains only .dwg files, the result is `$fa ### Example 4: Check for a file ```powershell -Test-Path -Path $PROFILE -PathType leaf +Test-Path -Path $PROFILE -PathType Leaf ``` ```Output @@ -133,7 +133,7 @@ case, because the PowerShell profile is a `.ps1` file, the cmdlet returns `$true ### Example 5: Check paths in the Registry -These commands use `Test-Path` with the PowerShell registry provider. +These commands use `Test-Path` with the PowerShell Registry provider. The first command tests whether the registry path of the **Microsoft.PowerShell** registry key is correct on the system. If PowerShell is installed correctly, the cmdlet returns `$true`. diff --git a/reference/7.4/Microsoft.PowerShell.Management/Wait-Process.md b/reference/7.4/Microsoft.PowerShell.Management/Wait-Process.md index d08abe252fc0..3aaca178417d 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Wait-Process.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Wait-Process.md @@ -55,7 +55,7 @@ This example stops the **Notepad** process and then waits for the process to be continues with the next command. ```powershell -$nid = (Get-Process notepad).id +$nid = (Get-Process notepad).Id Stop-Process -Id $nid Wait-Process -Id $nid ``` @@ -73,7 +73,7 @@ command gets the Notepad process and stores it in the `$p` variable. The second ```powershell $p = Get-Process notepad -Wait-Process -Id $p.id +Wait-Process -Id $p.Id Wait-Process -Name "notepad" Wait-Process -InputObject $p ``` diff --git a/reference/7.4/Microsoft.PowerShell.Security/About/about_Certificate_Provider.md b/reference/7.4/Microsoft.PowerShell.Security/About/about_Certificate_Provider.md index 0faa5091e051..4e71a2e45ff6 100644 --- a/reference/7.4/Microsoft.PowerShell.Security/About/about_Certificate_Provider.md +++ b/reference/7.4/Microsoft.PowerShell.Security/About/about_Certificate_Provider.md @@ -76,7 +76,7 @@ the `Cert:` drive. Set-Location Cert: ``` -You can also work with the certificate provider from any other PowerShell +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. @@ -114,7 +114,7 @@ The example shows the new certificate script properties (**DnsNameList**, **EnhancedKeyUsageList**, **SendAsTrustedIssuer**) using `Select-Object`. ```powershell -$c = Get-Item cert:\LocalMachine\My\52A149D0393CE8A8D4AF0B172ED667A9E3A1F44E +$c = Get-Item Cert:\LocalMachine\My\52A149D0393CE8A8D4AF0B172ED667A9E3A1F44E $c | Format-List DnsNameList, EnhancedKeyUsageList, SendAsTrustedIssuer ``` @@ -132,7 +132,7 @@ This command uses the **CodeSigningCert** and **Recurse** parameters of the code-signing authority. ```powershell -Get-ChildItem -Path cert: -CodeSigningCert -Recurse +Get-ChildItem -Path Cert: -CodeSigningCert -Recurse ``` ### Find expired certificates @@ -141,7 +141,7 @@ This command uses the **ExpiringInDays** parameter of the `Get-ChildItem` cmdlet to get certificates that expire within the next 30 days. ```powershell -Get-ChildItem -Path cert:\LocalMachine\WebHosting -ExpiringInDays 30 +Get-ChildItem -Path Cert:\LocalMachine\WebHosting -ExpiringInDays 30 ``` ### Find Server SSL Certificates @@ -152,7 +152,7 @@ This command uses the **SSLServerAuthentication** parameter of the ```powershell $getChildItemSplat = @{ - Path = 'cert:\LocalMachine\My', 'cert:\LocalMachine\WebHosting' + Path = 'Cert:\LocalMachine\My', 'Cert:\LocalMachine\WebHosting' SSLServerAuthentication = $true } Get-ChildItem @getChildItemSplat @@ -169,7 +169,7 @@ that have expired. $invokeCommandSplat = @{ ComputerName = 'Srv01', 'Srv02' ScriptBlock = { - Get-ChildItem -Path cert:\* -Recurse -ExpiringInDays 0 + Get-ChildItem -Path Cert:\* -Recurse -ExpiringInDays 0 } } Invoke-Command @invokeCommandSplat @@ -188,9 +188,9 @@ have the following attributes: The **NotAfter** property stores the certificate expiration date. ```powershell -[DateTime] $ValidThrough = (Get-Date) + (New-TimeSpan -Days 30) +[datetime] $ValidThrough = (Get-Date) + (New-TimeSpan -Days 30) $getChildItemSplat = @{ - Path = 'cert:\*' + Path = 'Cert:\*' Recurse = $true DnsName = "*fabrikam*" Eku = "*Client Authentication*" @@ -209,7 +209,7 @@ This command opens the Certificates MMC snap-in to manage the specified certificate. ```powershell -Invoke-Item cert:\CurrentUser\my\6B8223358119BB08840DEE50FD8AF9EA776CE66B +Invoke-Item Cert:\CurrentUser\my\6B8223358119BB08840DEE50FD8AF9EA776CE66B ``` ## Copying Certificates @@ -254,8 +254,8 @@ 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 -Destination cert:\LocalMachine\WebHosting +Get-ChildItem Cert:\LocalMachine\My -SSLServerAuthentication | + Move-Item -Destination Cert:\LocalMachine\WebHosting ``` ## Deleting Certificates and Private Keys @@ -273,7 +273,7 @@ In the `Cert:` drive, the `Remove-Item` cmdlet supports only the **DeleteKey**, ignored. ```powershell -Remove-Item cert:\LocalMachine\CA\5DDC44652E62BF9AA1116DC41DE44AB47C87BDD0 +Remove-Item Cert:\LocalMachine\CA\5DDC44652E62BF9AA1116DC41DE44AB47C87BDD0 ``` ### Delete a Certificate using a wildcards in the DNS name @@ -283,7 +283,7 @@ This command deletes all certificates that have a DNS name that contains get the certificates and the `Remove-Item` cmdlet to delete them. ```powershell -Get-ChildItem -Path cert:\LocalMachine -DnsName *Fabrikam* | Remove-Item +Get-ChildItem -Path Cert:\LocalMachine -DnsName *Fabrikam* | Remove-Item ``` ### Delete private keys from a remote computer @@ -329,7 +329,7 @@ parameter to remove the private key along with the specified certificate. ```powershell Invoke-Command -Session $s { $removeItemSplat = @{ - Path = 'cert:\LocalMachine\My\D2D38EBA60CAA1C12055A2E1C83B15AD450110C2' + Path = 'Cert:\LocalMachine\My\D2D38EBA60CAA1C12055A2E1C83B15AD450110C2' DeleteKey = $true } Remove-Item @removeItemSplat @@ -347,7 +347,7 @@ 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 +$expired = Get-ChildItem Cert:\LocalMachine\WebHosting -ExpiringInDays 0 $expired | Remove-Item -DeleteKey ``` @@ -369,7 +369,7 @@ This command creates a new certificate store named `CustomStore` in the `LocalMachine` store location. ```powershell -New-Item -Path cert:\LocalMachine\CustomStore +New-Item -Path Cert:\LocalMachine\CustomStore ``` ### Create a new certificate store on a remote computer @@ -384,7 +384,7 @@ new certificate store. ```powershell Invoke-Command -ComputerName Server01 -ScriptBlock { - New-Item -Path cert:\LocalMachine\CustomStore + New-Item -Path Cert:\LocalMachine\CustomStore } ``` @@ -417,7 +417,7 @@ store. ```powershell Invoke-Command -ComputerName S1, S2 -ScriptBlock { - Remove-Item -Path cert:\LocalMachine\TestStore -Recurse + Remove-Item -Path Cert:\LocalMachine\TestStore -Recurse } ``` @@ -542,7 +542,7 @@ This parameter was reintroduced in PowerShell 7.1 ## Script properties -New script properties have been added to the **x509Certificate2** object that +New script properties have been added to the **X509Certificate2** object that represents the certificates to make it easy to search and manage the certificates. @@ -583,7 +583,7 @@ Get-Help Get-ChildItem ``` ```powershell -Get-Help Get-ChildItem -Path cert: +Get-Help Get-ChildItem -Path Cert: ``` ## See also diff --git a/reference/7.4/Microsoft.PowerShell.Security/Get-Acl.md b/reference/7.4/Microsoft.PowerShell.Security/Get-Acl.md index 20c1b8d77b61..6e17658842dc 100644 --- a/reference/7.4/Microsoft.PowerShell.Security/Get-Acl.md +++ b/reference/7.4/Microsoft.PowerShell.Security/Get-Acl.md @@ -68,7 +68,7 @@ Get-Acl C:\Windows\s*.log | Format-List -Property PSPath, Sddl The command uses the `Get-Acl` cmdlet to get objects representing the security descriptors of each log file. It uses a pipeline operator (`|`) to send the results to the `Format-List` cmdlet. The -command uses the **Property** parameter of `Format-List` to display only the **PsPath** and **SDDL** +command uses the **Property** parameter of `Format-List` to display only the **PSPath** and **SDDL** properties of each security descriptor object. Lists are often used in PowerShell, because long values appear truncated in tables. @@ -289,7 +289,7 @@ and access list, PowerShell displays the following properties and property value Descriptor Definition Language format. PowerShell uses the **GetSddlForm** method of security descriptors to get this data. -Because `Get-Acl` is supported by the file system and registry providers, you can use `Get-Acl` to +Because `Get-Acl` is supported by the FileSystem and Registry providers, you can use `Get-Acl` to view the ACL of file system objects, such as files and directories, and registry objects, such as registry keys and entries. diff --git a/reference/7.4/Microsoft.PowerShell.Security/Get-Credential.md b/reference/7.4/Microsoft.PowerShell.Security/Get-Credential.md index 6e897be8074d..5c33da504db4 100644 --- a/reference/7.4/Microsoft.PowerShell.Security/Get-Credential.md +++ b/reference/7.4/Microsoft.PowerShell.Security/Get-Credential.md @@ -59,7 +59,7 @@ the **Credential** parameter. ### Example 2 ```powershell -$c = Get-Credential -credential User01 +$c = Get-Credential -Credential User01 $c.Username User01 ``` @@ -73,7 +73,7 @@ object. ### Example 3 ```powershell -$Credential = $Host.ui.PromptForCredential("Need credentials", "Please enter your user name and password.", "", "NetBiosUserName") +$Credential = $Host.UI.PromptForCredential("Need credentials", "Please enter your user name and password.", "", "NetBiosUserName") ``` This command uses the **PromptForCredential** method to prompt the user for their user name and diff --git a/reference/7.4/Microsoft.PowerShell.Security/Protect-CmsMessage.md b/reference/7.4/Microsoft.PowerShell.Security/Protect-CmsMessage.md index d89ee36ca940..afe9398310f8 100644 --- a/reference/7.4/Microsoft.PowerShell.Security/Protect-CmsMessage.md +++ b/reference/7.4/Microsoft.PowerShell.Security/Protect-CmsMessage.md @@ -112,10 +112,10 @@ PS C:\> cd Cert:\CurrentUser\My PS Cert:\CurrentUser\My> Get-ChildItem -DocumentEncryptionCert ``` -To view document encryption certificates in the certificate provider, you can add the +To view document encryption certificates in the Certificate provider, you can add the **DocumentEncryptionCert** dynamic parameter of [Get-ChildItem](../Microsoft.PowerShell.Management/Get-ChildItem.md), available only when the -certificate provider is loaded. +Certificate provider is loaded. ## PARAMETERS @@ -195,7 +195,7 @@ Accept wildcard characters: False Specifies one or more CMS message recipients, identified in any of the following formats: -- An actual certificate (as retrieved from the certificate provider). +- An actual certificate (as retrieved from the Certificate provider). - Path to the file containing the certificate. - Path to a directory containing the certificate. - Thumbprint of the certificate (used to look in the certificate store). diff --git a/reference/7.4/Microsoft.PowerShell.Security/Set-Acl.md b/reference/7.4/Microsoft.PowerShell.Security/Set-Acl.md index 1f67bace631d..e40a99d123a1 100644 --- a/reference/7.4/Microsoft.PowerShell.Security/Set-Acl.md +++ b/reference/7.4/Microsoft.PowerShell.Security/Set-Acl.md @@ -105,7 +105,7 @@ The first command in the pipeline uses the Get-ChildItem cmdlet to get all of th `C:\Temp` directory. The **Recurse** parameter extends the command to all subdirectories of `C:\temp`. The **Include** parameter limits the files retrieved to those with the `.txt` file name extension. The **Force** parameter gets hidden files, which would otherwise be excluded. (You cannot -use `c:\temp\*.txt`, because the **Recurse** parameter works on directories, not on files.) +use `C:\temp\*.txt`, because the **Recurse** parameter works on directories, not on files.) The pipeline operator (`|`) sends the objects representing the retrieved files to the `Set-Acl` cmdlet, which applies the security descriptor in the **AclObject** parameter to all of the files in @@ -421,7 +421,7 @@ security object depends on the type of the item. This cmdlet is only available on Windows platforms. -The `Set-Acl` cmdlet is supported by the PowerShell file system and registry providers. As such, you +The `Set-Acl` cmdlet is supported by the PowerShell FileSystem and Registry providers. As such, you can use it to change the security descriptors of files, directories, and registry keys. ## RELATED LINKS diff --git a/reference/7.5/Microsoft.PowerShell.Management/Start-Process.md b/reference/7.5/Microsoft.PowerShell.Management/Start-Process.md index e72ccc313c40..a5b98c2ab9c0 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Start-Process.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Start-Process.md @@ -108,7 +108,7 @@ verbs are determined by the filename extension of the file that runs in the proc ```powershell $startExe = New-Object System.Diagnostics.ProcessStartInfo -Args powershell.exe -$startExe.verbs +$startExe.Verbs ``` ```Output @@ -130,8 +130,8 @@ Note that the first command specifies a string as **ArgumentList**. The second c array. ```powershell -Start-Process -FilePath "$env:comspec" -ArgumentList "/c dir `"%SystemDrive%\Program Files`"" -Start-Process -FilePath "$env:comspec" -ArgumentList "/c","dir","`"%SystemDrive%\Program Files`"" +Start-Process -FilePath "$Env:ComSpec" -ArgumentList "/c dir `"%SystemDrive%\Program Files`"" +Start-Process -FilePath "$Env:ComSpec" -ArgumentList "/c","dir","`"%SystemDrive%\Program Files`"" ``` ### Example 8: Create a detached process on Linux @@ -147,7 +147,7 @@ alive even after you close the launching session. The `nohup` command collects o ```powershell # Runs for 2 minutes and appends output to ./nohup.out -Start-Process nohup 'pwsh -noprofile -c "1..120 | % { Write-Host . -NoNewline; sleep 1 }"' +Start-Process nohup 'pwsh -NoProfile -c "1..120 | % { Write-Host . -NoNewline; sleep 1 }"' ``` In this example, `Start-Process` is running the Linux `nohup` command, which launches `pwsh` as a @@ -167,12 +167,12 @@ command doesn't override the environment variable. In the second command, `FOO` the third command, `FOO` is set to `$null`, which removes it. ```powershell -$env:FOO = 'foo' -Start-Process pwsh -NoNewWindow -ArgumentList '-c', '$env:FOO' -Start-Process pwsh -NoNewWindow -ArgumentList '-c', '$env:FOO' -Environment @{ +$Env:FOO = 'foo' +Start-Process pwsh -NoNewWindow -ArgumentList '-c', '$Env:FOO' +Start-Process pwsh -NoNewWindow -ArgumentList '-c', '$Env:FOO' -Environment @{ FOO = 'bar' } -Start-Process pwsh -NoNewWindow -ArgumentList '-c', '$env:FOO' -Environment @{ +Start-Process pwsh -NoNewWindow -ArgumentList '-c', '$Env:FOO' -Environment @{ FOO = $null } ``` @@ -402,7 +402,7 @@ started process runs with the environment variables inherited from the parent pr On Windows, when you use **UseNewEnvironment**, the new process starts only containing the default environment variables defined for the **Machine** scope. This has the side effect that the -`$env:USERNAME` is set to **SYSTEM**. None of the variables from the **User** scope are included. +`$Env:USERNAME` is set to **SYSTEM**. None of the variables from the **User** scope are included. ```yaml Type: System.Management.Automation.SwitchParameter diff --git a/reference/7.5/Microsoft.PowerShell.Management/Start-Service.md b/reference/7.5/Microsoft.PowerShell.Management/Start-Service.md index badc9cf140c6..288323a9dd69 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Start-Service.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Start-Service.md @@ -97,7 +97,7 @@ start service TlntSvr on computer '.'. At line:1 char:14 + Start-Service <<<< tlntsvr -PS> Get-CimInstance win32_service | Where-Object Name -eq "tlntsvr" +PS> Get-CimInstance Win32_Service | Where-Object Name -EQ "tlntsvr" ExitCode : 0 Name : TlntSvr ProcessId : 0 diff --git a/reference/7.5/Microsoft.PowerShell.Management/Stop-Computer.md b/reference/7.5/Microsoft.PowerShell.Management/Stop-Computer.md index 8183922d8353..bdb019216761 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Stop-Computer.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Stop-Computer.md @@ -266,8 +266,8 @@ This cmdlet returns no output. ## NOTES This cmdlet uses the -[`Win32Shutdown`](/windows/desktop/CIMWin32Prov/win32shutdown-method-in-class-win32-operatingsystem) -method of the [`Win32_OperatingSystem`](/windows/desktop/CIMWin32Prov/win32-operatingsystem) WMI +[Win32Shutdown](/windows/desktop/CIMWin32Prov/win32shutdown-method-in-class-win32-operatingsystem) +method of the [Win32_OperatingSystem](/windows/desktop/CIMWin32Prov/win32-operatingsystem) WMI class. This method requires the `SeShutdownPrivilege` privilege be enabled for the user account used to shutdown the machine. diff --git a/reference/7.5/Microsoft.PowerShell.Management/Test-Path.md b/reference/7.5/Microsoft.PowerShell.Management/Test-Path.md index f07d83c962a5..517dc9ee1c52 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Test-Path.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Test-Path.md @@ -121,7 +121,7 @@ In this case, because the directory contains only .dwg files, the result is `$fa ### Example 4: Check for a file ```powershell -Test-Path -Path $PROFILE -PathType leaf +Test-Path -Path $PROFILE -PathType Leaf ``` ```Output @@ -133,7 +133,7 @@ case, because the PowerShell profile is a `.ps1` file, the cmdlet returns `$true ### Example 5: Check paths in the Registry -These commands use `Test-Path` with the PowerShell registry provider. +These commands use `Test-Path` with the PowerShell Registry provider. The first command tests whether the registry path of the **Microsoft.PowerShell** registry key is correct on the system. If PowerShell is installed correctly, the cmdlet returns `$true`. diff --git a/reference/7.5/Microsoft.PowerShell.Management/Wait-Process.md b/reference/7.5/Microsoft.PowerShell.Management/Wait-Process.md index 8409d0f93180..d3db46a21a31 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Wait-Process.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Wait-Process.md @@ -73,7 +73,7 @@ command gets the Notepad process and stores it in the `$p` variable. The second ```powershell $p = Get-Process notepad -Wait-Process -Id $p.id +Wait-Process -Id $p.Id Wait-Process -Name "notepad" Wait-Process -InputObject $p ``` diff --git a/reference/7.5/Microsoft.PowerShell.Security/About/about_Certificate_Provider.md b/reference/7.5/Microsoft.PowerShell.Security/About/about_Certificate_Provider.md index b746b3a221a4..590090b876da 100644 --- a/reference/7.5/Microsoft.PowerShell.Security/About/about_Certificate_Provider.md +++ b/reference/7.5/Microsoft.PowerShell.Security/About/about_Certificate_Provider.md @@ -76,7 +76,7 @@ the `Cert:` drive. Set-Location Cert: ``` -You can also work with the certificate provider from any other PowerShell +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. @@ -114,7 +114,7 @@ The example shows the new certificate script properties (**DnsNameList**, **EnhancedKeyUsageList**, **SendAsTrustedIssuer**) using `Select-Object`. ```powershell -$c = Get-Item cert:\LocalMachine\My\52A149D0393CE8A8D4AF0B172ED667A9E3A1F44E +$c = Get-Item Cert:\LocalMachine\My\52A149D0393CE8A8D4AF0B172ED667A9E3A1F44E $c | Format-List DnsNameList, EnhancedKeyUsageList, SendAsTrustedIssuer ``` @@ -132,7 +132,7 @@ This command uses the **CodeSigningCert** and **Recurse** parameters of the code-signing authority. ```powershell -Get-ChildItem -Path cert: -CodeSigningCert -Recurse +Get-ChildItem -Path Cert: -CodeSigningCert -Recurse ``` ### Find expired certificates @@ -141,7 +141,7 @@ This command uses the **ExpiringInDays** parameter of the `Get-ChildItem` cmdlet to get certificates that expire within the next 30 days. ```powershell -Get-ChildItem -Path cert:\LocalMachine\WebHosting -ExpiringInDays 30 +Get-ChildItem -Path Cert:\LocalMachine\WebHosting -ExpiringInDays 30 ``` ### Find Server SSL Certificates @@ -152,7 +152,7 @@ This command uses the **SSLServerAuthentication** parameter of the ```powershell $getChildItemSplat = @{ - Path = 'cert:\LocalMachine\My', 'cert:\LocalMachine\WebHosting' + Path = 'Cert:\LocalMachine\My', 'Cert:\LocalMachine\WebHosting' SSLServerAuthentication = $true } Get-ChildItem @getChildItemSplat @@ -169,7 +169,7 @@ that have expired. $invokeCommandSplat = @{ ComputerName = 'Srv01', 'Srv02' ScriptBlock = { - Get-ChildItem -Path cert:\* -Recurse -ExpiringInDays 0 + Get-ChildItem -Path Cert:\* -Recurse -ExpiringInDays 0 } } Invoke-Command @invokeCommandSplat @@ -188,9 +188,9 @@ have the following attributes: The **NotAfter** property stores the certificate expiration date. ```powershell -[DateTime] $ValidThrough = (Get-Date) + (New-TimeSpan -Days 30) +[datetime] $ValidThrough = (Get-Date) + (New-TimeSpan -Days 30) $getChildItemSplat = @{ - Path = 'cert:\*' + Path = 'Cert:\*' Recurse = $true DnsName = "*fabrikam*" Eku = "*Client Authentication*" @@ -211,7 +211,7 @@ This command opens the Certificates MMC snap-in to manage the specified certificate. ```powershell -Invoke-Item cert:\CurrentUser\my\6B8223358119BB08840DEE50FD8AF9EA776CE66B +Invoke-Item Cert:\CurrentUser\my\6B8223358119BB08840DEE50FD8AF9EA776CE66B ``` ## Copying Certificates @@ -256,8 +256,8 @@ 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 -Destination cert:\LocalMachine\WebHosting +Get-ChildItem Cert:\LocalMachine\My -SSLServerAuthentication | + Move-Item -Destination Cert:\LocalMachine\WebHosting ``` ## Deleting Certificates and Private Keys @@ -275,7 +275,7 @@ In the `Cert:` drive, the `Remove-Item` cmdlet supports only the **DeleteKey**, ignored. ```powershell -Remove-Item cert:\LocalMachine\CA\5DDC44652E62BF9AA1116DC41DE44AB47C87BDD0 +Remove-Item Cert:\LocalMachine\CA\5DDC44652E62BF9AA1116DC41DE44AB47C87BDD0 ``` ### Delete a Certificate using a wildcards in the DNS name @@ -285,7 +285,7 @@ This command deletes all certificates that have a DNS name that contains get the certificates and the `Remove-Item` cmdlet to delete them. ```powershell -Get-ChildItem -Path cert:\LocalMachine -DnsName *Fabrikam* | Remove-Item +Get-ChildItem -Path Cert:\LocalMachine -DnsName *Fabrikam* | Remove-Item ``` ### Delete private keys from a remote computer @@ -331,7 +331,7 @@ parameter to remove the private key along with the specified certificate. ```powershell Invoke-Command -Session $s { $removeItemSplat = @{ - Path = 'cert:\LocalMachine\My\D2D38EBA60CAA1C12055A2E1C83B15AD450110C2' + Path = 'Cert:\LocalMachine\My\D2D38EBA60CAA1C12055A2E1C83B15AD450110C2' DeleteKey = $true } Remove-Item @removeItemSplat @@ -349,7 +349,7 @@ 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 +$expired = Get-ChildItem Cert:\LocalMachine\WebHosting -ExpiringInDays 0 $expired | Remove-Item -DeleteKey ``` @@ -371,7 +371,7 @@ This command creates a new certificate store named `CustomStore` in the `LocalMachine` store location. ```powershell -New-Item -Path cert:\LocalMachine\CustomStore +New-Item -Path Cert:\LocalMachine\CustomStore ``` ### Create a new certificate store on a remote computer @@ -386,7 +386,7 @@ new certificate store. ```powershell Invoke-Command -ComputerName Server01 -ScriptBlock { - New-Item -Path cert:\LocalMachine\CustomStore + New-Item -Path Cert:\LocalMachine\CustomStore } ``` @@ -419,7 +419,7 @@ store. ```powershell Invoke-Command -ComputerName S1, S2 -ScriptBlock { - Remove-Item -Path cert:\LocalMachine\TestStore -Recurse + Remove-Item -Path Cert:\LocalMachine\TestStore -Recurse } ``` @@ -544,7 +544,7 @@ This parameter was reintroduced in PowerShell 7.1 ## Script properties -New script properties have been added to the **x509Certificate2** object that +New script properties have been added to the **X509Certificate2** object that represents the certificates to make it easy to search and manage the certificates. @@ -585,7 +585,7 @@ Get-Help Get-ChildItem ``` ```powershell -Get-Help Get-ChildItem -Path cert: +Get-Help Get-ChildItem -Path Cert: ``` ## See also diff --git a/reference/7.5/Microsoft.PowerShell.Security/Get-Acl.md b/reference/7.5/Microsoft.PowerShell.Security/Get-Acl.md index 0a148b30f9d1..a12070bad259 100644 --- a/reference/7.5/Microsoft.PowerShell.Security/Get-Acl.md +++ b/reference/7.5/Microsoft.PowerShell.Security/Get-Acl.md @@ -68,7 +68,7 @@ Get-Acl C:\Windows\s*.log | Format-List -Property PSPath, Sddl The command uses the `Get-Acl` cmdlet to get objects representing the security descriptors of each log file. It uses a pipeline operator (`|`) to send the results to the `Format-List` cmdlet. The -command uses the **Property** parameter of `Format-List` to display only the **PsPath** and **SDDL** +command uses the **Property** parameter of `Format-List` to display only the **PSPath** and **SDDL** properties of each security descriptor object. Lists are often used in PowerShell, because long values appear truncated in tables. @@ -289,7 +289,7 @@ and access list, PowerShell displays the following properties and property value Descriptor Definition Language format. PowerShell uses the **GetSddlForm** method of security descriptors to get this data. -Because `Get-Acl` is supported by the file system and registry providers, you can use `Get-Acl` to +Because `Get-Acl` is supported by the FileSystem and Registry providers, you can use `Get-Acl` to view the ACL of file system objects, such as files and directories, and registry objects, such as registry keys and entries. diff --git a/reference/7.5/Microsoft.PowerShell.Security/Get-Credential.md b/reference/7.5/Microsoft.PowerShell.Security/Get-Credential.md index 1b3d8d961272..04caa90b6a11 100644 --- a/reference/7.5/Microsoft.PowerShell.Security/Get-Credential.md +++ b/reference/7.5/Microsoft.PowerShell.Security/Get-Credential.md @@ -73,7 +73,7 @@ object. ### Example 3 ```powershell -$Credential = $Host.ui.PromptForCredential( +$Credential = $Host.UI.PromptForCredential( "Need credentials", "Please enter your user name and password.", "", "NetBiosUserName") ``` diff --git a/reference/7.5/Microsoft.PowerShell.Security/Protect-CmsMessage.md b/reference/7.5/Microsoft.PowerShell.Security/Protect-CmsMessage.md index 5214e1a59987..1258d512fdef 100644 --- a/reference/7.5/Microsoft.PowerShell.Security/Protect-CmsMessage.md +++ b/reference/7.5/Microsoft.PowerShell.Security/Protect-CmsMessage.md @@ -112,10 +112,10 @@ PS C:\> cd Cert:\CurrentUser\My PS Cert:\CurrentUser\My> Get-ChildItem -DocumentEncryptionCert ``` -To view document encryption certificates in the certificate provider, you can add the +To view document encryption certificates in the Certificate provider, you can add the **DocumentEncryptionCert** dynamic parameter of [Get-ChildItem](../Microsoft.PowerShell.Management/Get-ChildItem.md), available only when the -certificate provider is loaded. +Certificate provider is loaded. ## PARAMETERS @@ -195,7 +195,7 @@ Accept wildcard characters: False Specifies one or more CMS message recipients, identified in any of the following formats: -- An actual certificate (as retrieved from the certificate provider). +- An actual certificate (as retrieved from the Certificate provider). - Path to the file containing the certificate. - Path to a directory containing the certificate. - Thumbprint of the certificate (used to look in the certificate store). diff --git a/reference/7.5/Microsoft.PowerShell.Security/Set-Acl.md b/reference/7.5/Microsoft.PowerShell.Security/Set-Acl.md index b7a0f82f74ba..0711203c981a 100644 --- a/reference/7.5/Microsoft.PowerShell.Security/Set-Acl.md +++ b/reference/7.5/Microsoft.PowerShell.Security/Set-Acl.md @@ -107,7 +107,7 @@ The first command in the pipeline uses the Get-ChildItem cmdlet to get all of th `C:\Temp` directory. The **Recurse** parameter extends the command to all subdirectories of `C:\temp`. The **Include** parameter limits the files retrieved to those with the `.txt` file name extension. The **Force** parameter gets hidden files, which would otherwise be excluded. (You cannot -use `c:\temp\*.txt`, because the **Recurse** parameter works on directories, not on files.) +use `C:\temp\*.txt`, because the **Recurse** parameter works on directories, not on files.) The pipeline operator (`|`) sends the objects representing the retrieved files to the `Set-Acl` cmdlet, which applies the security descriptor in the **AclObject** parameter to all of the files in @@ -427,7 +427,7 @@ security object depends on the type of the item. This cmdlet is only available on Windows platforms. -The `Set-Acl` cmdlet is supported by the PowerShell file system and registry providers. As such, you +The `Set-Acl` cmdlet is supported by the PowerShell FileSystem and Registry providers. As such, you can use it to change the security descriptors of files, directories, and registry keys. ## RELATED LINKS diff --git a/reference/7.6/Microsoft.PowerShell.Management/Start-Process.md b/reference/7.6/Microsoft.PowerShell.Management/Start-Process.md index c9865828eb44..7c1f254dda9d 100644 --- a/reference/7.6/Microsoft.PowerShell.Management/Start-Process.md +++ b/reference/7.6/Microsoft.PowerShell.Management/Start-Process.md @@ -108,7 +108,7 @@ verbs are determined by the filename extension of the file that runs in the proc ```powershell $startExe = New-Object System.Diagnostics.ProcessStartInfo -Args powershell.exe -$startExe.verbs +$startExe.Verbs ``` ```Output @@ -130,8 +130,8 @@ Note that the first command specifies a string as **ArgumentList**. The second c array. ```powershell -Start-Process -FilePath "$env:comspec" -ArgumentList "/c dir `"%SystemDrive%\Program Files`"" -Start-Process -FilePath "$env:comspec" -ArgumentList "/c","dir","`"%SystemDrive%\Program Files`"" +Start-Process -FilePath "$Env:ComSpec" -ArgumentList "/c dir `"%SystemDrive%\Program Files`"" +Start-Process -FilePath "$Env:ComSpec" -ArgumentList "/c","dir","`"%SystemDrive%\Program Files`"" ``` ### Example 8: Create a detached process on Linux @@ -147,7 +147,7 @@ alive even after you close the launching session. The `nohup` command collects o ```powershell # Runs for 2 minutes and appends output to ./nohup.out -Start-Process nohup 'pwsh -noprofile -c "1..120 | % { Write-Host . -NoNewline; sleep 1 }"' +Start-Process nohup 'pwsh -NoProfile -c "1..120 | % { Write-Host . -NoNewline; sleep 1 }"' ``` In this example, `Start-Process` is running the Linux `nohup` command, which launches `pwsh` as a @@ -167,12 +167,12 @@ command doesn't override the environment variable. In the second command, `FOO` the third command, `FOO` is set to `$null`, which removes it. ```powershell -$env:FOO = 'foo' -Start-Process pwsh -NoNewWindow -ArgumentList '-c', '$env:FOO' -Start-Process pwsh -NoNewWindow -ArgumentList '-c', '$env:FOO' -Environment @{ +$Env:FOO = 'foo' +Start-Process pwsh -NoNewWindow -ArgumentList '-c', '$Env:FOO' +Start-Process pwsh -NoNewWindow -ArgumentList '-c', '$Env:FOO' -Environment @{ FOO = 'bar' } -Start-Process pwsh -NoNewWindow -ArgumentList '-c', '$env:FOO' -Environment @{ +Start-Process pwsh -NoNewWindow -ArgumentList '-c', '$Env:FOO' -Environment @{ FOO = $null } ``` @@ -402,7 +402,7 @@ started process runs with the environment variables inherited from the parent pr On Windows, when you use **UseNewEnvironment**, the new process starts only containing the default environment variables defined for the **Machine** scope. This has the side effect that the -`$env:USERNAME` is set to **SYSTEM**. None of the variables from the **User** scope are included. +`$Env:USERNAME` is set to **SYSTEM**. None of the variables from the **User** scope are included. ```yaml Type: System.Management.Automation.SwitchParameter diff --git a/reference/7.6/Microsoft.PowerShell.Management/Start-Service.md b/reference/7.6/Microsoft.PowerShell.Management/Start-Service.md index 04b4dc210854..9b021afec79f 100644 --- a/reference/7.6/Microsoft.PowerShell.Management/Start-Service.md +++ b/reference/7.6/Microsoft.PowerShell.Management/Start-Service.md @@ -96,7 +96,7 @@ Start-Service : Service 'Telnet (TlntSvr)' cannot be started due to the followin At line:1 char:14 + Start-Service <<<< tlntsvr -PS> Get-CimInstance win32_service | Where-Object Name -eq "tlntsvr" +PS> Get-CimInstance Win32_Service | Where-Object Name -EQ "tlntsvr" ExitCode : 0 Name : TlntSvr ProcessId : 0 diff --git a/reference/7.6/Microsoft.PowerShell.Management/Stop-Computer.md b/reference/7.6/Microsoft.PowerShell.Management/Stop-Computer.md index cf0f313849cb..e6643ac6de07 100644 --- a/reference/7.6/Microsoft.PowerShell.Management/Stop-Computer.md +++ b/reference/7.6/Microsoft.PowerShell.Management/Stop-Computer.md @@ -266,8 +266,8 @@ This cmdlet returns no output. ## NOTES This cmdlet uses the -[`Win32Shutdown`](/windows/desktop/CIMWin32Prov/win32shutdown-method-in-class-win32-operatingsystem) -method of the [`Win32_OperatingSystem`](/windows/desktop/CIMWin32Prov/win32-operatingsystem) WMI +[Win32Shutdown](/windows/desktop/CIMWin32Prov/win32shutdown-method-in-class-win32-operatingsystem) +method of the [Win32_OperatingSystem](/windows/desktop/CIMWin32Prov/win32-operatingsystem) WMI class. This method requires the `SeShutdownPrivilege` privilege be enabled for the user account used to shutdown the machine. diff --git a/reference/7.6/Microsoft.PowerShell.Management/Test-Path.md b/reference/7.6/Microsoft.PowerShell.Management/Test-Path.md index 5c9ae8583082..b7ecb7c92068 100644 --- a/reference/7.6/Microsoft.PowerShell.Management/Test-Path.md +++ b/reference/7.6/Microsoft.PowerShell.Management/Test-Path.md @@ -121,7 +121,7 @@ In this case, because the directory contains only .dwg files, the result is `$fa ### Example 4: Check for a file ```powershell -Test-Path -Path $PROFILE -PathType leaf +Test-Path -Path $PROFILE -PathType Leaf ``` ```Output @@ -133,7 +133,7 @@ case, because the PowerShell profile is a `.ps1` file, the cmdlet returns `$true ### Example 5: Check paths in the Registry -These commands use `Test-Path` with the PowerShell registry provider. +These commands use `Test-Path` with the PowerShell Registry provider. The first command tests whether the registry path of the **Microsoft.PowerShell** registry key is correct on the system. If PowerShell is installed correctly, the cmdlet returns `$true`. diff --git a/reference/7.6/Microsoft.PowerShell.Management/Wait-Process.md b/reference/7.6/Microsoft.PowerShell.Management/Wait-Process.md index 03da5fda9153..ffb240d0b27a 100644 --- a/reference/7.6/Microsoft.PowerShell.Management/Wait-Process.md +++ b/reference/7.6/Microsoft.PowerShell.Management/Wait-Process.md @@ -55,7 +55,7 @@ This example stops the **Notepad** process and then waits for the process to be continues with the next command. ```powershell -$nid = (Get-Process notepad).id +$nid = (Get-Process notepad).Id Stop-Process -Id $nid Wait-Process -Id $nid ``` @@ -73,7 +73,7 @@ command gets the Notepad process and stores it in the `$p` variable. The second ```powershell $p = Get-Process notepad -Wait-Process -Id $p.id +Wait-Process -Id $p.Id Wait-Process -Name "notepad" Wait-Process -InputObject $p ``` diff --git a/reference/7.6/Microsoft.PowerShell.Security/About/about_Certificate_Provider.md b/reference/7.6/Microsoft.PowerShell.Security/About/about_Certificate_Provider.md index 118b570c0867..61f253fa1b56 100644 --- a/reference/7.6/Microsoft.PowerShell.Security/About/about_Certificate_Provider.md +++ b/reference/7.6/Microsoft.PowerShell.Security/About/about_Certificate_Provider.md @@ -76,7 +76,7 @@ the `Cert:` drive. Set-Location Cert: ``` -You can also work with the certificate provider from any other PowerShell +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. @@ -114,7 +114,7 @@ The example shows the new certificate script properties (**DnsNameList**, **EnhancedKeyUsageList**, **SendAsTrustedIssuer**) using `Select-Object`. ```powershell -$c = Get-Item cert:\LocalMachine\My\52A149D0393CE8A8D4AF0B172ED667A9E3A1F44E +$c = Get-Item Cert:\LocalMachine\My\52A149D0393CE8A8D4AF0B172ED667A9E3A1F44E $c | Format-List DnsNameList, EnhancedKeyUsageList, SendAsTrustedIssuer ``` @@ -132,7 +132,7 @@ This command uses the **CodeSigningCert** and **Recurse** parameters of the code-signing authority. ```powershell -Get-ChildItem -Path cert: -CodeSigningCert -Recurse +Get-ChildItem -Path Cert: -CodeSigningCert -Recurse ``` ### Find expired certificates @@ -141,7 +141,7 @@ This command uses the **ExpiringInDays** parameter of the `Get-ChildItem` cmdlet to get certificates that expire within the next 30 days. ```powershell -Get-ChildItem -Path cert:\LocalMachine\WebHosting -ExpiringInDays 30 +Get-ChildItem -Path Cert:\LocalMachine\WebHosting -ExpiringInDays 30 ``` ### Find Server SSL Certificates @@ -152,7 +152,7 @@ This command uses the **SSLServerAuthentication** parameter of the ```powershell $getChildItemSplat = @{ - Path = 'cert:\LocalMachine\My', 'cert:\LocalMachine\WebHosting' + Path = 'Cert:\LocalMachine\My', 'Cert:\LocalMachine\WebHosting' SSLServerAuthentication = $true } Get-ChildItem @getChildItemSplat @@ -169,7 +169,7 @@ that have expired. $invokeCommandSplat = @{ ComputerName = 'Srv01', 'Srv02' ScriptBlock = { - Get-ChildItem -Path cert:\* -Recurse -ExpiringInDays 0 + Get-ChildItem -Path Cert:\* -Recurse -ExpiringInDays 0 } } Invoke-Command @invokeCommandSplat @@ -188,9 +188,9 @@ have the following attributes: The **NotAfter** property stores the certificate expiration date. ```powershell -[DateTime] $ValidThrough = (Get-Date) + (New-TimeSpan -Days 30) +[datetime] $ValidThrough = (Get-Date) + (New-TimeSpan -Days 30) $getChildItemSplat = @{ - Path = 'cert:\*' + Path = 'Cert:\*' Recurse = $true DnsName = "*fabrikam*" Eku = "*Client Authentication*" @@ -209,7 +209,7 @@ This command opens the Certificates MMC snap-in to manage the specified certificate. ```powershell -Invoke-Item cert:\CurrentUser\my\6B8223358119BB08840DEE50FD8AF9EA776CE66B +Invoke-Item Cert:\CurrentUser\my\6B8223358119BB08840DEE50FD8AF9EA776CE66B ``` ## Copying Certificates @@ -254,8 +254,8 @@ 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 -Destination cert:\LocalMachine\WebHosting +Get-ChildItem Cert:\LocalMachine\My -SSLServerAuthentication | + Move-Item -Destination Cert:\LocalMachine\WebHosting ``` ## Deleting Certificates and Private Keys @@ -273,7 +273,7 @@ In the `Cert:` drive, the `Remove-Item` cmdlet supports only the **DeleteKey**, ignored. ```powershell -Remove-Item cert:\LocalMachine\CA\5DDC44652E62BF9AA1116DC41DE44AB47C87BDD0 +Remove-Item Cert:\LocalMachine\CA\5DDC44652E62BF9AA1116DC41DE44AB47C87BDD0 ``` ### Delete a Certificate using a wildcards in the DNS name @@ -283,7 +283,7 @@ This command deletes all certificates that have a DNS name that contains get the certificates and the `Remove-Item` cmdlet to delete them. ```powershell -Get-ChildItem -Path cert:\LocalMachine -DnsName *Fabrikam* | Remove-Item +Get-ChildItem -Path Cert:\LocalMachine -DnsName *Fabrikam* | Remove-Item ``` ### Delete private keys from a remote computer @@ -329,7 +329,7 @@ parameter to remove the private key along with the specified certificate. ```powershell Invoke-Command -Session $s { $removeItemSplat = @{ - Path = 'cert:\LocalMachine\My\D2D38EBA60CAA1C12055A2E1C83B15AD450110C2' + Path = 'Cert:\LocalMachine\My\D2D38EBA60CAA1C12055A2E1C83B15AD450110C2' DeleteKey = $true } Remove-Item @removeItemSplat @@ -347,7 +347,7 @@ 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 +$expired = Get-ChildItem Cert:\LocalMachine\WebHosting -ExpiringInDays 0 $expired | Remove-Item -DeleteKey ``` @@ -369,7 +369,7 @@ This command creates a new certificate store named `CustomStore` in the `LocalMachine` store location. ```powershell -New-Item -Path cert:\LocalMachine\CustomStore +New-Item -Path Cert:\LocalMachine\CustomStore ``` ### Create a new certificate store on a remote computer @@ -384,7 +384,7 @@ new certificate store. ```powershell Invoke-Command -ComputerName Server01 -ScriptBlock { - New-Item -Path cert:\LocalMachine\CustomStore + New-Item -Path Cert:\LocalMachine\CustomStore } ``` @@ -417,7 +417,7 @@ store. ```powershell Invoke-Command -ComputerName S1, S2 -ScriptBlock { - Remove-Item -Path cert:\LocalMachine\TestStore -Recurse + Remove-Item -Path Cert:\LocalMachine\TestStore -Recurse } ``` @@ -542,7 +542,7 @@ This parameter was reintroduced in PowerShell 7.1 ## Script properties -New script properties have been added to the **x509Certificate2** object that +New script properties have been added to the **X509Certificate2** object that represents the certificates to make it easy to search and manage the certificates. @@ -583,7 +583,7 @@ Get-Help Get-ChildItem ``` ```powershell -Get-Help Get-ChildItem -Path cert: +Get-Help Get-ChildItem -Path Cert: ``` ## See also diff --git a/reference/7.6/Microsoft.PowerShell.Security/Get-Acl.md b/reference/7.6/Microsoft.PowerShell.Security/Get-Acl.md index 4515d4d3fecd..3fa60c906255 100644 --- a/reference/7.6/Microsoft.PowerShell.Security/Get-Acl.md +++ b/reference/7.6/Microsoft.PowerShell.Security/Get-Acl.md @@ -68,7 +68,7 @@ Get-Acl C:\Windows\s*.log | Format-List -Property PSPath, Sddl The command uses the `Get-Acl` cmdlet to get objects representing the security descriptors of each log file. It uses a pipeline operator (`|`) to send the results to the `Format-List` cmdlet. The -command uses the **Property** parameter of `Format-List` to display only the **PsPath** and **SDDL** +command uses the **Property** parameter of `Format-List` to display only the **PSPath** and **SDDL** properties of each security descriptor object. Lists are often used in PowerShell, because long values appear truncated in tables. @@ -289,7 +289,7 @@ and access list, PowerShell displays the following properties and property value Descriptor Definition Language format. PowerShell uses the **GetSddlForm** method of security descriptors to get this data. -Because `Get-Acl` is supported by the file system and registry providers, you can use `Get-Acl` to +Because `Get-Acl` is supported by the FileSystem and Registry providers, you can use `Get-Acl` to view the ACL of file system objects, such as files and directories, and registry objects, such as registry keys and entries. diff --git a/reference/7.6/Microsoft.PowerShell.Security/Get-Credential.md b/reference/7.6/Microsoft.PowerShell.Security/Get-Credential.md index 0744b35b114e..dadba7257929 100644 --- a/reference/7.6/Microsoft.PowerShell.Security/Get-Credential.md +++ b/reference/7.6/Microsoft.PowerShell.Security/Get-Credential.md @@ -59,7 +59,7 @@ the **Credential** parameter. ### Example 2 ```powershell -$c = Get-Credential -credential User01 +$c = Get-Credential -Credential User01 $c.Username User01 ``` @@ -73,7 +73,7 @@ object. ### Example 3 ```powershell -$Credential = $Host.ui.PromptForCredential("Need credentials", "Please enter your user name and password.", "", "NetBiosUserName") +$Credential = $Host.UI.PromptForCredential("Need credentials", "Please enter your user name and password.", "", "NetBiosUserName") ``` This command uses the **PromptForCredential** method to prompt the user for their user name and diff --git a/reference/7.6/Microsoft.PowerShell.Security/Protect-CmsMessage.md b/reference/7.6/Microsoft.PowerShell.Security/Protect-CmsMessage.md index 23807e511d70..3ad2abecaee5 100644 --- a/reference/7.6/Microsoft.PowerShell.Security/Protect-CmsMessage.md +++ b/reference/7.6/Microsoft.PowerShell.Security/Protect-CmsMessage.md @@ -112,10 +112,10 @@ PS C:\> cd Cert:\CurrentUser\My PS Cert:\CurrentUser\My> Get-ChildItem -DocumentEncryptionCert ``` -To view document encryption certificates in the certificate provider, you can add the +To view document encryption certificates in the Certificate provider, you can add the **DocumentEncryptionCert** dynamic parameter of [Get-ChildItem](../Microsoft.PowerShell.Management/Get-ChildItem.md), available only when the -certificate provider is loaded. +Certificate provider is loaded. ## PARAMETERS @@ -195,7 +195,7 @@ Accept wildcard characters: False Specifies one or more CMS message recipients, identified in any of the following formats: -- An actual certificate (as retrieved from the certificate provider). +- An actual certificate (as retrieved from the Certificate provider). - Path to the file containing the certificate. - Path to a directory containing the certificate. - Thumbprint of the certificate (used to look in the certificate store). diff --git a/reference/7.6/Microsoft.PowerShell.Security/Set-Acl.md b/reference/7.6/Microsoft.PowerShell.Security/Set-Acl.md index 14ace62acabf..1e772507df5f 100644 --- a/reference/7.6/Microsoft.PowerShell.Security/Set-Acl.md +++ b/reference/7.6/Microsoft.PowerShell.Security/Set-Acl.md @@ -105,7 +105,7 @@ The first command in the pipeline uses the Get-ChildItem cmdlet to get all of th `C:\Temp` directory. The **Recurse** parameter extends the command to all subdirectories of `C:\temp`. The **Include** parameter limits the files retrieved to those with the `.txt` file name extension. The **Force** parameter gets hidden files, which would otherwise be excluded. (You cannot -use `c:\temp\*.txt`, because the **Recurse** parameter works on directories, not on files.) +use `C:\temp\*.txt`, because the **Recurse** parameter works on directories, not on files.) The pipeline operator (`|`) sends the objects representing the retrieved files to the `Set-Acl` cmdlet, which applies the security descriptor in the **AclObject** parameter to all of the files in @@ -421,7 +421,7 @@ security object depends on the type of the item. This cmdlet is only available on Windows platforms. -The `Set-Acl` cmdlet is supported by the PowerShell file system and registry providers. As such, you +The `Set-Acl` cmdlet is supported by the PowerShell FileSystem and Registry providers. As such, you can use it to change the security descriptors of files, directories, and registry keys. ## RELATED LINKS