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 @@ -99,7 +99,7 @@ WSMan:\localhost
--------- InitializationParameters
--------- Resources
------------ Security
------ Microsoft.Powershell
------ Microsoft.PowerShell
--------- InitializationParameters
--------- Resources
------------ Security
Expand Down Expand Up @@ -151,57 +151,57 @@ Set-Location -Path WSMan:\SERVER01

## Displaying the Contents of the WSMan: Drive

This command uses the `Get-Childitem` cmdlet to display the WS-Management stores
This command uses the `Get-ChildItem` cmdlet to display the WS-Management stores
in the Localhost store location.

```powershell
Get-ChildItem -path WSMan:\Localhost
Get-ChildItem -Path WSMan:\Localhost
```

If you are in the `WSMan:` drive, you can omit the drive name.

This command uses the `Get-Childitem` cmdlet to display the WS-Management
This command uses the `Get-ChildItem` cmdlet to display the WS-Management
stores in the remote computer "SERVER01" store location.

```powershell
Get-ChildItem -path WSMan:\SERVER01
Get-ChildItem -Path WSMan:\SERVER01
```

> [!NOTE]
> The above command assume that a connection to the remote system already
> exists.

## Setting the value of items in the WSMAN: drive
## Setting the value of items in the WSMan: drive

You can use the `Set-Item` cmdlet to change configuration settings in the
`WSMAN` drive. The following example sets the **TrustedHosts** value to
`WSMan:` drive. The following example sets the **TrustedHosts** value to
accept all hosts with the suffix "contoso.com".

```powershell
# You do not need to specify the -Path parameter name when using Set-Item.
PS WSMAN:\localhost\Client> Set-Item .\TrustedHosts -Value "*.contoso.com"
PS WSMan:\localhost\Client> Set-Item .\TrustedHosts -Value "*.contoso.com"
```

The `Set-Item` cmdlet supports an additional parameter `-Concatenate` that
appends a value instead of changing it. The following example will append a
new value "*.domain2.com" to the old value stored in `TrustedHost:`

```powershell
Set-Item WSMAN:\localhost\Client\TrustedHosts *.domain2.com -Concatenate
Set-Item WSMan:\localhost\Client\TrustedHosts *.domain2.com -Concatenate
```

## Creating items in the WSMAN: drive
## Creating items in the WSMan: drive

### Creating a new listener

The `New-Item` cmdlet creates items within a provider drive. Each provider
has different item types that you can create. In the `WSMAN:` drive, you can
has different item types that you can create. In the `WSMan:` drive, you can
create *Listeners* which you configure to receive and respond to remote
requests. The following command creates a new HTTP listener using the `New-Item`
cmdlet.

```powershell
New-Item -Path WSMan:\localhost\Listener -Address * -Transport HTTP -force
New-Item -Path WSMan:\localhost\Listener -Address * -Transport http -Force
```

### Creating a new plug-in
Expand All @@ -211,7 +211,7 @@ This command creates (registers) a plug-in for the WS-Management service.
```powershell
New-Item -Path WSMan:\localhost\Plugin `
-Plugin TestPlugin `
-FileName %systemroot%\system32\WsmWmiPl.dll `
-FileName $Env:SystemRoot\system32\WsmWmiPl.dll `
-Resource http://schemas.dmtf.org/wbem/wscim/2/cim-schema `
-SDKVersion 1 `
-Capability "Get","Put","Invoke","Enumerate" `
Expand Down Expand Up @@ -255,7 +255,7 @@ certificate.
$cred = Get-Credential
New-Item -Path WSMan:\localhost\ClientCertificate `
-Issuer 1b3fd224d66c6413fe20d21e38b304226d192dfe `
-URI wmicimv2/* `
-Uri wmicimv2/* `
-Credential $cred;
```

Expand Down Expand Up @@ -513,7 +513,7 @@ Specifies the entity that is identified by the certificate.
### Transport \<String\>

Specifies the transport to use to send and receive WS-Management protocol
requests and responses. The value must be either HTTP or HTTPS.
requests and responses. The value must be either **http** or **https**.

Note: The Transport value is set when creating a Listener.

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

```powershell
Get-Help Get-ChildItem -Path wsman:
Get-Help Get-ChildItem -Path WSMan:
```

## See also
Expand Down
8 changes: 4 additions & 4 deletions reference/5.1/Microsoft.WSMan.Management/Connect-WSMan.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ For information about how to disconnect from the WinRM service on a remote compu

```powershell
PS C:\> Connect-WSMan -ComputerName "server01"
PS C:\> cd wsman:
PS C:\> cd WSMan:
PS WSMan:\>
PS WSMan:\> dir
```
Expand All @@ -77,7 +77,7 @@ the **ComputerName** list.
```powershell
PS C:\> $cred = Get-Credential Administrator
PS C:\> Connect-WSMan -ComputerName "server01" -Credential $cred
PS C:\> cd wsman:
PS C:\> cd WSMan:
PS WSMan:\>
PS WSMan:\> dir
```
Expand Down Expand Up @@ -106,7 +106,7 @@ Administrator credentials.

```powershell
PS C:\> Connect-WSMan -ComputerName "server01" -Port 80
PS C:\> cd wsman:
PS C:\> cd WSMan:
PS WSMan:\>
PS WSMan:\> dir
```
Expand All @@ -126,7 +126,7 @@ This command creates a connection to the remote server01 computer over port 80.
```powershell
PS C:\> $a = New-WSManSessionOption -OperationTimeout 30000
PS C:\> Connect-WSMan -ComputerName "server01" -SessionOption $a
PS C:\> cd wsman:
PS C:\> cd WSMan:
PS WSMan:\> dir
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ For more information about how to connect to the WinRM service on a remote compu
### Example 1: Delete a connection to a remote computer

```powershell
PS C:\> Disconnect-WSMan -computer server01
PS C:\> Disconnect-WSMan -Computer server01
PS C:\> cd WSMan:
PS WSMan:\> dir
```
Expand Down
12 changes: 6 additions & 6 deletions reference/5.1/Microsoft.WSMan.Management/Get-WSManInstance.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ This cmdlet uses the WS-Management connection/transport layer to retrieve inform
### Example 1: Get all information from WMI

```powershell
Get-WSManInstance -ResourceURI wmicimv2/win32_service -SelectorSet @{name="winrm"} -ComputerName "Server01"
Get-WSManInstance -ResourceURI wmicimv2/Win32_Service -SelectorSet @{name="winrm"} -ComputerName "Server01"
```

This command returns all of the information that Windows Management Instrumentation (WMI) exposes
Expand All @@ -57,23 +57,23 @@ about the **WinRM** service on the remote server01 computer.
### Example 2: Get the status of the Spooler service

```powershell
Get-WSManInstance -ResourceURI wmicimv2/win32_service -SelectorSet @{name="spooler"} -Fragment Status -ComputerName "Server01"
Get-WSManInstance -ResourceURI wmicimv2/Win32_Service -SelectorSet @{name="spooler"} -Fragment Status -ComputerName "Server01"
```

This command returns only the status of the **Spooler** service on the remote server01 computer.

### Example 3: Get endpoint references for all services

```powershell
Get-WSManInstance -Enumerate -ResourceURI wmicimv2/win32_service -ReturnType EPR
Get-WSManInstance -Enumerate -ResourceURI wmicimv2/Win32_Service -ReturnType EPR
```

This command returns endpoint references that correspond to all the services on the local computer.

### Example 4: Get services that meet specified criteria

```powershell
Get-WSManInstance -Enumerate -ResourceURI wmicimv2/* -Filter "select * from win32_service where StartMode = 'Auto' and State = 'Stopped'" -ComputerName "Server01"
Get-WSManInstance -Enumerate -ResourceURI wmicimv2/* -Filter "select * from Win32_Service where StartMode = 'Auto' and State = 'Stopped'" -ComputerName "Server01"
```

This command lists all of the services that meet the following criteria on the remote Server01
Expand Down Expand Up @@ -103,7 +103,7 @@ listener that matches the criteria in the selector set.
### Example 7: Get associated instances related to a specified instance

```powershell
Get-WSManInstance -Enumerate -Dialect Association -Filter "{Object=win32_service?name=winrm}" -ResourceURI wmicimv2/*
Get-WSManInstance -Enumerate -Dialect Association -Filter "{Object=Win32_Service?name=winrm}" -ResourceURI wmicimv2/*
```

This command gets the associated instances that are related to the specified instance (winrm).
Expand All @@ -113,7 +113,7 @@ You must enclose the filter in quotation marks, as shown in the example.
### Example 8: Get association instances related to a specified instance

```powershell
Get-WSManInstance -Enumerate -Dialect Association -Associations -Filter "{Object=win32_service?name=winrm}" -ResourceURI wmicimv2/*
Get-WSManInstance -Enumerate -Dialect Association -Associations -Filter "{Object=Win32_Service?name=winrm}" -ResourceURI wmicimv2/*
```

This command gets association instances that are related to the specified instance (winrm). Because
Expand Down
22 changes: 11 additions & 11 deletions reference/5.1/Microsoft.WSMan.Management/Invoke-WSManAction.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ This cmdlet uses the WSMan connection/transport layer to run the action.
### Example 1: Invoke a method

```powershell
Invoke-WSManAction -Action startservice -ResourceURI wmicimv2/win32_service -SelectorSet @{name="spooler"} -Authentication default
Invoke-WSManAction -Action StartService -ResourceURI wmicimv2/Win32_Service -SelectorSet @{name="spooler"} -Authentication Default
```

```Output
Expand All @@ -56,16 +56,16 @@ lang : en-US
ReturnValue : 0
```

This command calls the StartService method of the Win32_Service WMI class instance that corresponds
to the Spooler service.
This command calls the StartService method of the **Win32_Service** WMI class instance that
corresponds to the Spooler service.

The return value indicates whether the action was successful. In this case, a return value of 0
indicates success. A return value of 5 indicates that the service is already started.

### Example 2: Invoke a method

```powershell
Invoke-WSManAction -Action stopservice -ResourceURI wmicimv2/Win32_Service -SelectorSet @{Name="spooler"} -FilePath:input.xml -Authentication default
Invoke-WSManAction -Action StopService -ResourceURI wmicimv2/Win32_Service -SelectorSet @{Name="spooler"} -FilePath:input.xml -Authentication Default
```

```Output
Expand All @@ -86,7 +86,7 @@ indicates success. A return value of 5 indicates that the service is already sta
### Example 3: Invoke a method with specified parameter values

```powershell
Invoke-WSManAction -Action create -ResourceURI wmicimv2/win32_process -ValueSet @{commandline="notepad.exe";currentdirectory="C:\"}
Invoke-WSManAction -Action Create -ResourceURI wmicimv2/Win32_Process -ValueSet @{commandline="notepad.exe";currentdirectory="C:\"}
```

```Output
Expand All @@ -98,14 +98,14 @@ ProcessId : 6356
ReturnValue : 0
```

This command calls the **Create** method of the Win32_Process class. It passes the method two
This command calls the **Create** method of the **Win32_Process** class. It passes the method two
parameter values, `Notepad.exe` and `C:\`. As a result, a new process is created to run Notepad, and
the current directory of the new process is set to `C:\`.

### Example 4: Invoke a method on a remote computer

```powershell
Invoke-WSManAction -Action startservice -ResourceURI wmicimv2/win32_service -SelectorSet @{name="spooler"} -ComputerName server01 -Authentication default
Invoke-WSManAction -Action StartService -ResourceURI wmicimv2/Win32_Service -SelectorSet @{name="spooler"} -ComputerName server01 -Authentication Default
```

```Output
Expand All @@ -116,9 +116,9 @@ lang : en-US
ReturnValue : 0
```

This command calls the StartService method of the Win32_Service WMI class instance that corresponds
to the Spooler service. Because the ComputerName parameter is specified, the command runs against
the remote server01 computer.
This command calls the StartService method of the **Win32_Service** WMI class instance that
corresponds to the Spooler service. Because the ComputerName parameter is specified, the command
runs against the remote server01 computer.

The return value indicates whether the action was successful. In this case, a return value of 0
indicates success. A return value of 5 indicates that the service is already started.
Expand Down Expand Up @@ -299,7 +299,7 @@ Specifies the path of a file that is used to update a management resource. You s
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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ Specifies the path of a file that is used to create a management resource. You s
management resource using the **ResourceURI** parameter and the **SelectorSet** parameter . For
example, the following command uses the **File** parameter:

`Invoke-WSManAction -Action stopservice -ResourceUri wmi/cimv2/Win32_Service -SelectorSet @{Name="spooler"} -File c:\input.xml -Authentication Default`
`Invoke-WSManAction -Action StopService -ResourceUri wmi/cimv2/Win32_Service -SelectorSet @{Name="spooler"} -File C:\input.xml -Authentication Default`

This command calls the **StopService** method on the Spooler service using input from a file. The
file, `Input.xml`, contains the following content:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ WSMan cmdlets:
```powershell
PS C:\> $a = New-WSManSessionOption -OperationTimeout 30000
PS C:\> Connect-WSMan -ComputerName "server01" -SessionOption $a
PS C:\> cd wsman:
PS C:\> cd WSMan:
PS WSMan:\> dir
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ Specifies the path of a file that is used to update a management resource. You s
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:
Expand Down
12 changes: 6 additions & 6 deletions reference/5.1/Microsoft.WSMan.Management/Test-WSMan.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,24 @@ This command determines whether the WinRM service is running on the server01 com
### Example 3: Determine the status of the WinRM service and the operating system version

```powershell
Test-WSMan -Authentication default
Test-WSMan -Authentication Default
```

This command tests to see whether the WS-Management (WinRM) service is running on the local computer
by using the authentication parameter.
by using the **Authentication** parameter.

Using the authentication parameter enables `Test-WSMan` to return the operating system version.
Using the **Authentication** parameter enables `Test-WSMan` to return the operating system version.

### Example 4: Determine the status of the WinRM service and the OS version on a remote computer

```powershell
Test-WSMan -ComputerName "server01" -Authentication default
Test-WSMan -ComputerName "server01" -Authentication Default
```

This command tests to see whether the WS-Management (WinRM) service is running on the computer named
server01 using the authentication parameter.
server01 using the **Authentication** parameter.

Using the authentication parameter enables `Test-WSMan` to return the operating system version.
Using the **Authentication** parameter enables `Test-WSMan` to return the operating system version.

## PARAMETERS

Expand Down
8 changes: 4 additions & 4 deletions reference/5.1/PSDiagnostics/Start-Trace.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ You must run this cmdlet from an elevated PowerShell session.
$parameters = @{
SessionName = 'wsmlog'
ETS = $true
OutputFilePath = "$env:windir\system32\wsmtraces.log"
OutputFilePath = "$Env:windir\system32\wsmtraces.log"
Format = 'bincirc'
MinBuffers = 16
MaxBuffers = 256
BufferSizeInKb = 64
MaxLogFileSizeInMB = 256
ProviderFilePath = "$env:windir\system32\wsmtraceproviders.txt"
ProviderFilePath = "$Env:windir\system32\wsmtraceproviders.txt"
}
Start-Trace @parameters
```
Expand Down Expand Up @@ -160,7 +160,7 @@ Accept wildcard characters: False
### -OutputFilePath

Path of the output log file or the DSN and log set name in a SQL database. The default path is
`$env:systemdrive\PerfLogs\Admin`.
`$Env:SystemDrive\PerfLogs\Admin`.

```yaml
Type: System.String
Expand All @@ -169,7 +169,7 @@ Aliases:

Required: False
Position: 1
Default value: $env:systemdrive\PerfLogs\Admin
Default value: $Env:SystemDrive\PerfLogs\Admin
Accept pipeline input: False
Accept wildcard characters: False
```
Expand Down
Loading