Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
8 changes: 4 additions & 4 deletions reference/5.1/Microsoft.PowerShell.Management/Test-Path.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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`.
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand All @@ -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
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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
```

Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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*"
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
```

Expand All @@ -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
Expand All @@ -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
}
```

Expand Down Expand Up @@ -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
}
```

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -581,7 +581,7 @@ Get-Help Get-ChildItem
```

```powershell
Get-Help Get-ChildItem -Path cert:
Get-Help Get-ChildItem -Path Cert:
```

## See also
Expand Down
4 changes: 2 additions & 2 deletions reference/5.1/Microsoft.PowerShell.Security/Get-Acl.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ the **Credential** parameter.
### Example 2

```powershell
$c = Get-Credential -credential User01
$c = Get-Credential -Credential User01
$c.Username
User01
```
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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).
Expand Down
4 changes: 2 additions & 2 deletions reference/5.1/Microsoft.PowerShell.Security/Set-Acl.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
18 changes: 9 additions & 9 deletions reference/7.4/Microsoft.PowerShell.Management/Start-Process.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
}
```
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading