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
53 changes: 37 additions & 16 deletions reference/5.1/CimCmdlets/New-CimInstance.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,46 +19,48 @@ Creates a CIM instance.

```
New-CimInstance [-ClassName] <String> [-Key <String[]>] [[-Property] <IDictionary>]
[-Namespace <String>] [-OperationTimeoutSec <UInt32>] [-ComputerName <String[]>] [-ClientOnly]
[-WhatIf] [-Confirm] [<CommonParameters>]
[-Namespace <String>] [-OperationTimeoutSec <UInt32>] [-ComputerName <String[]>]
[-ClientOnly] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### ClassNameSessionSet

```
New-CimInstance [-ClassName] <String> [-Key <String[]>] [[-Property] <IDictionary>]
[-Namespace <String>] [-OperationTimeoutSec <UInt32>] -CimSession <CimSession[]> [-ClientOnly]
[-WhatIf] [-Confirm] [<CommonParameters>]
[-Namespace <String>] [-OperationTimeoutSec <UInt32>] -CimSession <CimSession[]>
[-ClientOnly] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### ResourceUriSessionSet

```
New-CimInstance -ResourceUri <Uri> [-Key <String[]>] [[-Property] <IDictionary>]
[-Namespace <String>] [-OperationTimeoutSec <UInt32>] -CimSession <CimSession[]> [-WhatIf]
[-Confirm] [<CommonParameters>]
[-Namespace <String>] [-OperationTimeoutSec <UInt32>] -CimSession <CimSession[]>
[-WhatIf] [-Confirm] [<CommonParameters>]
```

### ResourceUriComputerSet

```
New-CimInstance -ResourceUri <Uri> [-Key <String[]>] [[-Property] <IDictionary>]
[-Namespace <String>] [-OperationTimeoutSec <UInt32>] [-ComputerName <String[]>] [-WhatIf]
[-Confirm] [<CommonParameters>]
[-Namespace <String>] [-OperationTimeoutSec <UInt32>] [-ComputerName <String[]>]
[-WhatIf] [-Confirm] [<CommonParameters>]
```

### CimClassSessionSet

```
New-CimInstance [-CimClass] <CimClass> [[-Property] <IDictionary>] [-OperationTimeoutSec <UInt32>]
-CimSession <CimSession[]> [-ClientOnly] [-WhatIf] [-Confirm] [<CommonParameters>]
New-CimInstance [-CimClass] <CimClass> [[-Property] <IDictionary>]
[-OperationTimeoutSec <UInt32>] -CimSession <CimSession[]> [-ClientOnly] [-WhatIf]
[-Confirm] [<CommonParameters>]
```

### CimClassComputerSet

```
New-CimInstance [-CimClass] <CimClass> [[-Property] <IDictionary>] [-OperationTimeoutSec <UInt32>]
[-ComputerName <String[]>] [-ClientOnly] [-WhatIf] [-Confirm] [<CommonParameters>]
New-CimInstance [-CimClass] <CimClass> [[-Property] <IDictionary>]
[-OperationTimeoutSec <UInt32>] [-ComputerName <String[]>] [-ClientOnly] [-WhatIf]
[-Confirm] [<CommonParameters>]
```

## DESCRIPTION
Expand All @@ -75,7 +77,12 @@ This example creates an instance of a CIM Class named win32_environment in the r
on the computer.

```powershell
New-CimInstance -ClassName Win32_Environment -Property @{Name="testvar";VariableValue="testvalue";UserName="domain\user"}
$prop = @{
Name = "testvar"
VariableValue = "testvalue"
UserName = "domain\user"
}
New-CimInstance -ClassName Win32_Environment -Property $prop
```

No client side validation is performed if the class does not exist, the properties are wrong, or if
Expand All @@ -89,7 +96,12 @@ of the variable are then passed to the `New-CimInstance` cmdlet.

```powershell
$class = Get-CimClass -ClassName Win32_Environment
New-CimInstance -CimClass $class -Property @{Name="testvar";VariableValue="testvalue";UserName="Contoso\User1"}
$prop = @{
Name = "testvar"
VariableValue = "testvalue"
UserName = "Contoso\User1"
}
New-CimInstance -CimClass $class -Property $prop
```

### Example 3: Create a dynamic instance on the client
Expand All @@ -100,7 +112,16 @@ computer without getting the instance from the server. The new instance is store
on the server.

```powershell
$a = New-CimInstance -ClassName Win32_Process -Property @{Handle=0} -Key Handle -ClientOnly
$instance = @{
ClassName = 'Win32_Process'
Property = @{
Handle = 0
}
Key = 'Handle'
ClientOnly = $true
}
$a = New-CimInstance @instance

Get-CimInstance -CimInstance $a
Invoke-CimMethod -CimInstance $a -MethodName GetOwner
```
Expand Down Expand Up @@ -385,7 +406,7 @@ Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
-WarningAction, and -WarningVariable. For more information, see
[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md).
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

Expand Down
21 changes: 11 additions & 10 deletions reference/5.1/CimCmdlets/New-CimSession.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@ Creates a CIM session.
### CredentialParameterSet (Default)

```
New-CimSession [-Authentication <PasswordAuthenticationMechanism>] [[-Credential] <PSCredential>]
[[-ComputerName] <String[]>] [-Name <String>] [-OperationTimeoutSec <UInt32>] [-SkipTestConnection]
[-Port <UInt32>] [-SessionOption <CimSessionOptions>] [<CommonParameters>]
New-CimSession [-Authentication <PasswordAuthenticationMechanism>]
[[-Credential] <PSCredential>] [[-ComputerName] <String[]>] [-Name <String>]
[-OperationTimeoutSec <UInt32>] [-SkipTestConnection] [-Port <UInt32>]
[-SessionOption <CimSessionOptions>] [<CommonParameters>]
```

### CertificateParameterSet

```
New-CimSession [-CertificateThumbprint <String>] [[-ComputerName] <String[]>] [-Name <String>]
[-OperationTimeoutSec <UInt32>] [-SkipTestConnection] [-Port <UInt32>]
New-CimSession [-CertificateThumbprint <String>] [[-ComputerName] <String[]>]
[-Name <String>] [-OperationTimeoutSec <UInt32>] [-SkipTestConnection] [-Port <UInt32>]
[-SessionOption <CimSessionOptions>] [<CommonParameters>]
```

Expand Down Expand Up @@ -65,7 +66,7 @@ This example creates a CIM session to each of the computers specified by **Compu
comma separated list.

```powershell
New-CimSession -ComputerName Server01,Server02,Server03
New-CimSession -ComputerName Server01, Server02, Server03
```

### Example 4: Create a CIM session with a friendly name
Expand All @@ -74,7 +75,7 @@ This example creates a remote CIM session to each of the computers specified by
the comma separated list, and assigns a friendly name to the new sessions, by specifying **Name**.

```powershell
New-CimSession -ComputerName Server01,Server02 -Name FileServers
New-CimSession -ComputerName Server01, Server02 -Name FileServers
Get-CimSession -Name File*
```

Expand Down Expand Up @@ -237,8 +238,8 @@ Accept wildcard characters: False
Specifies a friendly name for the CIM session.

You can use the name to refer to the CIM session when using other cmdlets, such as the
[`Get-CimSession`](Get-CimSession.md) cmdlet.
The name is not required to be unique to the computer or the current session.
[Get-CimSession](Get-CimSession.md) cmdlet. The name is not required to be unique to the computer
or the current session.

```yaml
Type: System.String
Expand Down Expand Up @@ -348,7 +349,7 @@ Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
-WarningAction, and -WarningVariable. For more information, see
[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md).
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

Expand Down
22 changes: 15 additions & 7 deletions reference/5.1/CimCmdlets/New-CimSessionOption.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ Specifies advanced options for the New-CimSession cmdlet.
### ProtocolTypeSet (Default)

```
New-CimSessionOption [-Protocol] <ProtocolType> [-UICulture <CultureInfo>] [-Culture <CultureInfo>]
[<CommonParameters>]
New-CimSessionOption [-Protocol] <ProtocolType> [-UICulture <CultureInfo>]
[-Culture <CultureInfo>] [<CommonParameters>]
```

### WSManParameterSet
Expand All @@ -28,15 +28,16 @@ New-CimSessionOption [-Protocol] <ProtocolType> [-UICulture <CultureInfo>] [-Cul
New-CimSessionOption [-NoEncryption] [-SkipCACheck] [-SkipCNCheck] [-SkipRevocationCheck]
[-EncodePortInServicePrincipalName] [-Encoding <PacketEncoding>] [-HttpPrefix <Uri>]
[-MaxEnvelopeSizeKB <UInt32>] [-ProxyAuthentication <PasswordAuthenticationMechanism>]
[-ProxyCertificateThumbprint <String>] [-ProxyCredential <PSCredential>] [-ProxyType <ProxyType>]
[-UseSsl] [-UICulture <CultureInfo>] [-Culture <CultureInfo>] [<CommonParameters>]
[-ProxyCertificateThumbprint <String>] [-ProxyCredential <PSCredential>]
[-ProxyType <ProxyType>] [-UseSsl] [-UICulture <CultureInfo>] [-Culture <CultureInfo>]
[<CommonParameters>]
```

### DcomParameterSet

```
New-CimSessionOption [-Impersonation <ImpersonationType>] [-PacketIntegrity] [-PacketPrivacy]
[-UICulture <CultureInfo>] [-Culture <CultureInfo>] [<CommonParameters>]
New-CimSessionOption [-Impersonation <ImpersonationType>] [-PacketIntegrity]
[-PacketPrivacy] [-UICulture <CultureInfo>] [-Culture <CultureInfo>] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -71,7 +72,14 @@ parameter, the credentials specified by the **ProxyCredential** parameter, and s
command is to skip the CA check, skip the CN check, and use SSL.

```powershell
New-CimSessionOption -ProxyAuthentication Kerberos -ProxyCredential $cred -SkipCACheck -SkipCNCheck -UseSsl
$option = @{
ProxyAuthentication = 'Kerberos'
ProxyCredential = $cred
SkipCACheck = $true
SkipCNCheck = $true
UseSsl = $true
}
New-CimSessionOption @option
```

### Example 3: Create a CIM session options object with the culture specified
Expand Down
39 changes: 26 additions & 13 deletions reference/5.1/CimCmdlets/Register-CimIndicationEvent.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ Register-CimIndicationEvent [-Namespace <String>] [-ClassName] <String>
### QueryExpressionSessionSet

```
Register-CimIndicationEvent [-Namespace <String>] [-Query] <String> [-QueryDialect <String>]
[-OperationTimeoutSec <UInt32>] -CimSession <CimSession> [[-SourceIdentifier] <String>]
[[-Action] <ScriptBlock>] [-MessageData <PSObject>] [-SupportEvent] [-Forward]
[-MaxTriggerCount <Int32>] [<CommonParameters>]
Register-CimIndicationEvent [-Namespace <String>] [-Query] <String>
[-QueryDialect <String>] [-OperationTimeoutSec <UInt32>] -CimSession <CimSession>
[[-SourceIdentifier] <String>] [[-Action] <ScriptBlock>] [-MessageData <PSObject>]
[-SupportEvent] [-Forward] [-MaxTriggerCount <Int32>] [<CommonParameters>]
```

### QueryExpressionComputerSet

```
Register-CimIndicationEvent [-Namespace <String>] [-Query] <String> [-QueryDialect <String>]
[-OperationTimeoutSec <UInt32>] [-ComputerName <String>] [[-SourceIdentifier] <String>]
[[-Action] <ScriptBlock>] [-MessageData <PSObject>] [-SupportEvent] [-Forward]
[-MaxTriggerCount <Int32>] [<CommonParameters>]
Register-CimIndicationEvent [-Namespace <String>] [-Query] <String>
[-QueryDialect <String>] [-OperationTimeoutSec <UInt32>] [-ComputerName <String>]
[[-SourceIdentifier] <String>] [[-Action] <ScriptBlock>] [-MessageData <PSObject>]
[-SupportEvent] [-Forward] [-MaxTriggerCount <Int32>] [<CommonParameters>]
```

## DESCRIPTION
Expand All @@ -67,7 +67,11 @@ This example subscribes to the events generated by the class named **Win32_Proce
class raises an event whenever a process starts.

```powershell
Register-CimIndicationEvent -ClassName 'Win32_ProcessStartTrace' -SourceIdentifier "ProcessStarted"
$event = @{
ClassName = 'Win32_ProcessStartTrace'
SourceIdentifier = 'ProcessStarted'
}
Register-CimIndicationEvent @event
Get-Event -SourceIdentifier "ProcessStarted"
```

Expand Down Expand Up @@ -98,7 +102,12 @@ $action = {
$id = $event.SourceEventArgs.NewEvent.ProcessId
Write-Host -Object "New Process Started : Name = $name ID = $id"
}
Register-CimIndicationEvent -ClassName 'Win32_ProcessStartTrace' -SourceIdentifier "ProcessStarted" -Action $action
$event = @{
ClassName = 'Win32_ProcessStartTrace'
SourceIdentifier = 'ProcessStarted'
Action = $action
}
Register-CimIndicationEvent @event
```

For more information, see
Expand All @@ -111,7 +120,12 @@ CIM server are stored in the event queue in the current PowerShell session and t
`Get-Event` to retrieve the events.

```powershell
Register-CimIndicationEvent -ClassName 'Win32_ProcessStartTrace' -SourceIdentifier "ProcessStarted" -ComputerName Server01
$event = @{
ClassName = 'Win32_ProcessStartTrace'
SourceIdentifier = 'ProcessStarted'
ComputerName = 'Server01'
}
Register-CimIndicationEvent @event
Get-Event -SourceIdentifier "ProcessStarted"
```

Expand All @@ -126,7 +140,7 @@ event is raised, instead of sending the event to the event queue. Enclose the co
The script block specified with **Action** can include the `$Event`, `$EventSubscriber`, `$Sender`,
`$SourceEventArgs`, and `$SourceArgs` automatic variables, which provide information about the event
to the **Action** script block. For more information, see
[About Automatic Variables](../microsoft.powershell.core/about/about_automatic_variables.md).
[About Automatic Variables](../Microsoft.PowerShell.Core/About/about_Automatic_Variables.md).

```yaml
Type: System.Management.Automation.ScriptBlock
Expand Down Expand Up @@ -401,4 +415,3 @@ This cmdlet returns an **EventSubscription** object.
[Get-CimSession](Get-CimSession.md)

[New-CimSession](New-CimSession.md)

18 changes: 10 additions & 8 deletions reference/5.1/CimCmdlets/Remove-CimInstance.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,33 @@ Removes a CIM instance from a computer.
### CimInstanceComputerSet (Default)

```
Remove-CimInstance [-ResourceUri <Uri>] [-ComputerName <String[]>] [-OperationTimeoutSec <UInt32>]
[-InputObject] <CimInstance> [-WhatIf] [-Confirm] [<CommonParameters>]
Remove-CimInstance [-ResourceUri <Uri>] [-ComputerName <String[]>]
[-OperationTimeoutSec <UInt32>] [-InputObject] <CimInstance> [-WhatIf] [-Confirm]
[<CommonParameters>]
```

### CimInstanceSessionSet

```
Remove-CimInstance -CimSession <CimSession[]> [-ResourceUri <Uri>] [-OperationTimeoutSec <UInt32>]
[-InputObject] <CimInstance> [-WhatIf] [-Confirm] [<CommonParameters>]
Remove-CimInstance -CimSession <CimSession[]> [-ResourceUri <Uri>]
[-OperationTimeoutSec <UInt32>] [-InputObject] <CimInstance> [-WhatIf] [-Confirm]
[<CommonParameters>]
```

### QuerySessionSet

```
Remove-CimInstance -CimSession <CimSession[]> [[-Namespace] <String>]
[-OperationTimeoutSec <UInt32>] [-Query] <String> [-QueryDialect <String>] [-WhatIf] [-Confirm]
[<CommonParameters>]
[-OperationTimeoutSec <UInt32>] [-Query] <String> [-QueryDialect <String>] [-WhatIf]
[-Confirm] [<CommonParameters>]
```

### QueryComputerSet

```
Remove-CimInstance [-ComputerName <String[]>] [[-Namespace] <String>]
[-OperationTimeoutSec <UInt32>] [-Query] <String> [-QueryDialect <String>] [-WhatIf] [-Confirm]
[<CommonParameters>]
[-OperationTimeoutSec <UInt32>] [-Query] <String> [-QueryDialect <String>] [-WhatIf]
[-Confirm] [<CommonParameters>]
```

## DESCRIPTION
Expand Down
Loading