diff --git a/reference/5.1/CimCmdlets/CimCmdlets.md b/reference/5.1/CimCmdlets/CimCmdlets.md index d11c37a35cc6..0859d5bc37b0 100644 --- a/reference/5.1/CimCmdlets/CimCmdlets.md +++ b/reference/5.1/CimCmdlets/CimCmdlets.md @@ -18,43 +18,57 @@ Management Instrumentation (WMI) service. ## CimCmdlets Cmdlets ### [Export-BinaryMiLog](Export-BinaryMiLog.md) + Creates a binary encoded representation of an object or objects and stores it in a file. ### [Get-CimAssociatedInstance](Get-CimAssociatedInstance.md) + Retrieves the CIM instances that are connected to a specific CIM instance by an association. ### [Get-CimClass](Get-CimClass.md) + Gets a list of CIM classes in a specific namespace. ### [Get-CimInstance](Get-CimInstance.md) + Gets the CIM instances of a class from a CIM server. ### [Get-CimSession](Get-CimSession.md) + Gets the CIM session objects from the current session. ### [Import-BinaryMiLog](Import-BinaryMiLog.md) + Used to re-create the saved objects based on the contents of an export file. ### [Invoke-CimMethod](Invoke-CimMethod.md) + Invokes a method of a CIM class. ### [New-CimInstance](New-CimInstance.md) + Creates a CIM instance. ### [New-CimSession](New-CimSession.md) + Creates a CIM session. ### [New-CimSessionOption](New-CimSessionOption.md) + Specifies advanced options for the `New-CimSession` cmdlet. ### [Register-CimIndicationEvent](Register-CimIndicationEvent.md) + Subscribes to indications using a filter expression or a query expression. ### [Remove-CimInstance](Remove-CimInstance.md) + Removes a CIM instance from a computer. ### [Remove-CimSession](Remove-CimSession.md) + Removes one or more CIM sessions. ### [Set-CimInstance](Set-CimInstance.md) + Modifies a CIM instance on a CIM server by calling the **ModifyInstance** method of the CIM class. diff --git a/reference/5.1/CimCmdlets/Export-BinaryMiLog.md b/reference/5.1/CimCmdlets/Export-BinaryMiLog.md index ab86183b20af..16544dc795ba 100644 --- a/reference/5.1/CimCmdlets/Export-BinaryMiLog.md +++ b/reference/5.1/CimCmdlets/Export-BinaryMiLog.md @@ -96,8 +96,8 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## RELATED LINKS -[Get-CimInstance](get-ciminstance.md) +[Get-CimInstance](Get-CimInstance.md) -[Import-BinaryMiLog](import-binarymilog.md) +[Import-BinaryMiLog](Import-BinaryMiLog.md) -[Import-Clixml](../microsoft.powershell.utility/import-clixml.md) +[Import-Clixml](../Microsoft.Powershell.Utility/Import-Clixml.md) diff --git a/reference/5.1/CimCmdlets/Get-CimAssociatedInstance.md b/reference/5.1/CimCmdlets/Get-CimAssociatedInstance.md index eafde29501d6..c48998f2ecc2 100644 --- a/reference/5.1/CimCmdlets/Get-CimAssociatedInstance.md +++ b/reference/5.1/CimCmdlets/Get-CimAssociatedInstance.md @@ -327,6 +327,6 @@ Windows PowerShell includes the following aliases for `Get-CimAssociatedInstance ## RELATED LINKS -[Get-CimClass](get-cimclass.md) +[Get-CimClass](Get-CimClass.md) -[Get-CimInstance](get-ciminstance.md) +[Get-CimInstance](Get-CimInstance.md) diff --git a/reference/5.1/CimCmdlets/Get-CimInstance.md b/reference/5.1/CimCmdlets/Get-CimInstance.md index e6b3efc707e4..c778f6606009 100644 --- a/reference/5.1/CimCmdlets/Get-CimInstance.md +++ b/reference/5.1/CimCmdlets/Get-CimInstance.md @@ -142,7 +142,7 @@ the key property `@{ "Handle"=0 }` and stores it in a variable named `$x`. The v a CIM instance to the `Get-CimInstance` cmdlet to get a particular instance. ```powershell -$x = New-CimInstance -ClassName Win32_Process -Namespace root\cimv2 -Property @{ "Handle"=0 } -Key Handle -ClientOnly +$x = New-CimInstance -ClassName Win32_Process -Namespace root\cimv2 -Property @{"Handle"=0} -Key Handle -ClientOnly Get-CimInstance -CimInstance $x ``` @@ -154,7 +154,7 @@ the variables `$x` and `$y`. The variable `$x` is then formatted in a table cont ```powershell $x,$y = Get-CimInstance -ClassName Win32_Process -$x | Format-Table -Property Name,KernelModeTime -AutoSize +$x | Format-Table -Property Name, KernelModeTime -AutoSize ``` ```Output @@ -169,7 +169,7 @@ This example retrieves the CIM instances of a class named **Win32_ComputerSystem computers named **Server01** and **Server02**. ```powershell -Get-CimInstance -ClassName Win32_ComputerSystem -ComputerName Server01,Server02 +Get-CimInstance -ClassName Win32_ComputerSystem -ComputerName Server01, Server02 ``` ### Example 8: Getting only the key properties, instead of all properties @@ -188,8 +188,8 @@ This example retrieves only a subset of properties, which reduces the size of th traffic. ```powershell -Get-CimInstance -Class Win32_Process -Property Name,KernelModeTime -$x = Get-CimInstance -Class Win32_Process -Property Name,KernelModeTime +Get-CimInstance -Class Win32_Process -Property Name, KernelModeTime +$x = Get-CimInstance -Class Win32_Process -Property Name, KernelModeTime $x | Invoke-CimMethod -MethodName GetOwner ``` @@ -204,7 +204,7 @@ the variable are then passed to `Get-CimInstance` by using the **CimSession** pa CIM instances of the class named **Win32_ComputerSystem**. ```powershell -$s = New-CimSession -ComputerName Server01,Server02 +$s = New-CimSession -ComputerName Server01, Server02 Get-CimInstance -ClassName Win32_ComputerSystem -CimSession $s ``` @@ -214,7 +214,8 @@ Get-CimInstance -ClassName Win32_ComputerSystem -CimSession $s Specifies the CIM session to use for this cmdlet. Enter a variable that contains the CIM session or a command that creates or gets the CIM session, such as the `New-CimSession` or `Get-CimSession` -cmdlets. For more information, see [about_CimSession](../Microsoft.PowerShell.Core/About/about_CimSession.md). +cmdlets. For more information, see +[about_CimSession](../Microsoft.PowerShell.Core/About/about_CimSession.md). ```yaml Type: Microsoft.Management.Infrastructure.CimSession[] @@ -320,8 +321,8 @@ Accept wildcard characters: False Indicates that only objects with key properties populated are returned. Specifying the **KeyOnly** parameter reduces the amount of data transferred over the network. -Use the **KeyOnly** parameter to return only a small portion of the object, which can be used for other -operations, such as the `Set-CimInstance` or `Get-CimAssociatedInstance` cmdlets. +Use the **KeyOnly** parameter to return only a small portion of the object, which can be used for +other operations, such as the `Set-CimInstance` or `Get-CimAssociatedInstance` cmdlets. ```yaml Type: System.Management.Automation.SwitchParameter @@ -495,7 +496,8 @@ Accept wildcard characters: False This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, --WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS @@ -514,18 +516,18 @@ the CIM server. ## RELATED LINKS -[Format-Table](../microsoft.powershell.utility/format-table.md) +[Format-Table](../Microsoft.Powershell.Utility/Format-Table.md) [Get-CimAssociatedInstance](Get-CimAssociatedInstance.md) [Get-CimClass](Get-CimClass.md) -[Invoke-CimMethod](invoke-cimmethod.md) +[Invoke-CimMethod](Invoke-CimMethod.md) [New-CimInstance](New-CimInstance.md) [Register-CimIndicationEvent](Register-CimIndicationEvent.md) -[Remove-CimInstance](remove-ciminstance.md) +[Remove-CimInstance](Remove-CimInstance.md) [Set-CimInstance](Set-CimInstance.md) diff --git a/reference/5.1/CimCmdlets/Get-CimSession.md b/reference/5.1/CimCmdlets/Get-CimSession.md index 6e35e7edcbb3..b1a7ea06c221 100644 --- a/reference/5.1/CimCmdlets/Get-CimSession.md +++ b/reference/5.1/CimCmdlets/Get-CimSession.md @@ -46,7 +46,8 @@ can use the parameters of `Get-CimSession` to get the sessions that are for part you can identify sessions by their names or other identifiers. `Get-CimSession` does not get CIM sessions that were created in other PowerShell sessions or that were created on other computers. -For more information about CIM sessions, see [about_CimSession](../Microsoft.PowerShell.Core/About/about_CimSession.md). +For more information about CIM sessions, see +[about_CimSession](../Microsoft.PowerShell.Core/About/about_CimSession.md). ## EXAMPLES @@ -56,7 +57,7 @@ This example creates CIM sessions using [New-CimSession](New-CimSession.md), and sessions using `Get-CimSession`. ```powershell -New-CimSession -ComputerName Server01,Server02 +New-CimSession -ComputerName Server01, Server02 Get-CimSession ``` @@ -96,7 +97,7 @@ This example gets all CIM sessions in the current PowerShell session and display only the **ComputerName** and **InstanceID** properties. ```powershell -Get-CimSession | Format-Table -Property ComputerName,InstanceId +Get-CimSession | Format-Table -Property ComputerName, InstanceId ``` ```Output @@ -169,7 +170,8 @@ Specifies the identifier of the CIM session to get. For multiple IDs, use commas or use the range operator (`..`) to specify a range of IDs. An **Id** is an integer that uniquely identifies the CIM session within the current PowerShell session. -For more information about the range operator, see [about_Operators](../Microsoft.PowerShell.Core/About/about_Operators.md). +For more information about the range operator, see +[about_Operators](../Microsoft.PowerShell.Core/About/about_Operators.md). ```yaml Type: System.UInt32[] @@ -223,6 +225,7 @@ Accept wildcard characters: True ``` ### CommonParameters + This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see @@ -244,10 +247,10 @@ This cmdlet returns a CIM session object. ## RELATED LINKS -[Format-Table](../microsoft.powershell.utility/format-table.md) +[Format-Table](../Microsoft.Powershell.Utility/Format-Table.md) [New-CimSession](New-CimSession.md) -[Remove-CimSession](remove-cimsession.md) +[Remove-CimSession](Remove-CimSession.md) [about_CimSession](../Microsoft.PowerShell.Core/About/about_CimSession.md) diff --git a/reference/5.1/CimCmdlets/Import-BinaryMiLog.md b/reference/5.1/CimCmdlets/Import-BinaryMiLog.md index 5afa38258b00..8a82dd33e35e 100644 --- a/reference/5.1/CimCmdlets/Import-BinaryMiLog.md +++ b/reference/5.1/CimCmdlets/Import-BinaryMiLog.md @@ -54,6 +54,7 @@ Accept wildcard characters: True ``` ### CommonParameters + This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see diff --git a/reference/5.1/CimCmdlets/Invoke-CimMethod.md b/reference/5.1/CimCmdlets/Invoke-CimMethod.md index f50ce39034f9..da17bffd9036 100644 --- a/reference/5.1/CimCmdlets/Invoke-CimMethod.md +++ b/reference/5.1/CimCmdlets/Invoke-CimMethod.md @@ -153,7 +153,7 @@ to `Invoke-CimMethod`. ```powershell $c = Get-CimClass -ClassName Win32_Process -Invoke-CimMethod -CimClass $c -MethodName "xyz" -Arguments @{ CommandLine = 'notepad.exe' } +Invoke-CimMethod -CimClass $c -MethodName "xyz" -Arguments @{CommandLine='notepad.exe'} ``` ## PARAMETERS @@ -467,9 +467,9 @@ This cmdlet returns an object. ## RELATED LINKS -[Get-CimClass](get-cimclass.md) +[Get-CimClass](Get-CimClass.md) -[Get-CimInstance](get-ciminstance.md) +[Get-CimInstance](Get-CimInstance.md) [Get-CimSession](Get-CimSession.md) diff --git a/reference/5.1/CimCmdlets/New-CimInstance.md b/reference/5.1/CimCmdlets/New-CimInstance.md index caed3198ac53..6602b51d5dd4 100644 --- a/reference/5.1/CimCmdlets/New-CimInstance.md +++ b/reference/5.1/CimCmdlets/New-CimInstance.md @@ -275,10 +275,10 @@ Accept wildcard characters: False Specifies the amount of time that the cmdlet waits for a response from the CIM server. By default, the value of this parameter is 0, which means that the cmdlet uses the default timeout value for the -server. If the **OperationTimeoutSec** parameter is set to a value less than the robust connection retry -timeout of 3 minutes, network failures that last more than the value of the **OperationTimeoutSec** -parameter are not recoverable, because the operation on the server times out before the client can -reconnect. +server. If the **OperationTimeoutSec** parameter is set to a value less than the robust connection +retry timeout of 3 minutes, network failures that last more than the value of the +**OperationTimeoutSec** parameter are not recoverable, because the operation on the server times +out before the client can reconnect. ```yaml Type: System.UInt32 @@ -403,10 +403,10 @@ This cmdlet returns an object that contains the CIM instance information. ## RELATED LINKS -[Get-CimClass](get-cimclass.md) +[Get-CimClass](Get-CimClass.md) -[Get-CimInstance](get-ciminstance.md) +[Get-CimInstance](Get-CimInstance.md) -[Remove-CimInstance](remove-ciminstance.md) +[Remove-CimInstance](Remove-CimInstance.md) [Set-CimInstance](Set-CimInstance.md) diff --git a/reference/5.1/CimCmdlets/New-CimSession.md b/reference/5.1/CimCmdlets/New-CimSession.md index 99374e26e9bf..f5a69cd816fe 100644 --- a/reference/5.1/CimCmdlets/New-CimSession.md +++ b/reference/5.1/CimCmdlets/New-CimSession.md @@ -10,7 +10,6 @@ title: New-CimSession # New-CimSession ## SYNOPSIS - Creates a CIM session. ## SYNTAX @@ -23,7 +22,7 @@ New-CimSession [-Authentication ] [[-Credential [-Port ] [-SessionOption ] [] ``` -### CertificatePrameterSet +### CertificateParameterSet ``` New-CimSession [-CertificateThumbprint ] [[-ComputerName] ] [-Name ] @@ -128,9 +127,9 @@ parameter are: - NtlmDomain - CredSsp -You cannot use the **NtlmDomain** authentication type for connection to the local computer. **CredSSP** -authentication is available only in Windows Vista, Windows Server 2008, and later versions of -Windows. +You cannot use the **NtlmDomain** authentication type for connection to the local computer. +**CredSSP** authentication is available only in Windows Vista, Windows Server 2008, and later +versions of Windows. > [!CAUTION] > Credential Security Service Provider (CredSSP) authentication is designed for commands that @@ -164,11 +163,12 @@ To get a certificate thumbprint, use the [`Get-ChildItem`](../Microsoft.Powershell.Management/Get-ChildItem.md) cmdlets in the PowerShell Certificate Provider. -For more information, see [about_Certificate_Provider](../Microsoft.PowerShell.Security/About/about_Certificate_Provider.md). +For more information, see +[about_Certificate_Provider](../Microsoft.PowerShell.Security/About/about_Certificate_Provider.md). ```yaml Type: System.String -Parameter Sets: CertificatePrameterSet +Parameter Sets: CertificateParameterSet Aliases: Required: False @@ -215,7 +215,8 @@ Specify the value for **Credential** using one of the following formats: - A user name: "User01" - A domain name and a user name: "Domain01\User01" - A user principal name: "User@Domain.com" -- A PSCredential object, such as one returned by the [`Get-Credential`](../Microsoft.PowerShell.Security/Get-Credential.md) cmdlet. +- A PSCredential object, such as one returned by the + [`Get-Credential`](../Microsoft.PowerShell.Security/Get-Credential.md) cmdlet. When you type a user name, you are prompted for a password. @@ -235,7 +236,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. +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. ```yaml @@ -254,9 +256,13 @@ Accept wildcard characters: False Duration for which the cmdlet waits for a response from the server. -By default, the value of this parameter is 0, which means that the cmdlet uses the default timeout value for the server. +By default, the value of this parameter is 0, which means that the cmdlet uses the default timeout +value for the server. -If the **OperationTimeoutSec** parameter is set to a value less than the robust connection retry timeout of 3 minutes, network failures that last more than the value of the **OperationTimeoutSec** parameter are not recoverable, because the operation on the server times out before the client can reconnect. +If the **OperationTimeoutSec** parameter is set to a value less than the robust connection retry +timeout of 3 minutes, network failures that last more than the value of the **OperationTimeoutSec** +parameter are not recoverable, because the operation on the server times out before the client can +reconnect. ```yaml Type: System.UInt32 @@ -272,12 +278,12 @@ Accept wildcard characters: False ### -Port -Specifies the network port on the remote computer that is used for this connection. -To connect to a remote computer, the remote computer must be listening on the port that the connection uses. -The default ports are 5985 (the WinRM port for HTTP) and 5986 (the WinRM port for HTTPS). +Specifies the network port on the remote computer that is used for this connection. To connect to a +remote computer, the remote computer must be listening on the port that the connection uses. The +default ports are 5985 (the WinRM port for HTTP) and 5986 (the WinRM port for HTTPS). -Before using an alternate port, you must configure the WinRM listener on the remote computer to listen at that port. -Use the following commands to configure the listener: +Before using an alternate port, you must configure the WinRM listener on the remote computer to +listen at that port. Use the following commands to configure the listener: `winrm delete winrm/config/listener?Address=*+Transport=HTTP` diff --git a/reference/5.1/CimCmdlets/New-CimSessionOption.md b/reference/5.1/CimCmdlets/New-CimSessionOption.md index 96325eda7bf4..bba0cadfd195 100644 --- a/reference/5.1/CimCmdlets/New-CimSessionOption.md +++ b/reference/5.1/CimCmdlets/New-CimSessionOption.md @@ -93,7 +93,8 @@ parameter using one of the following formats: - A culture name in `-` format such as "EN-US". - A variable that contains a **CultureInfo** object. -- A command that gets a **CultureInfo** object, such as [Get-Culture](../Microsoft.PowerShell.Utility/Get-Culture.md) +- A command that gets a **CultureInfo** object, such as + [Get-Culture](../Microsoft.PowerShell.Utility/Get-Culture.md) ```yaml Type: System.Globalization.CultureInfo @@ -479,12 +480,12 @@ This cmdlet returns an object that contains CIM session options information. ## RELATED LINKS -[Get-ChildItem](../microsoft.powershell.management/get-childitem.md) +[Get-ChildItem](../Microsoft.Powershell.Management/Get-ChildItem.md) -[Get-Credential](../microsoft.powershell.security/get-credential.md) +[Get-Credential](../Microsoft.Powershell.Security/Get-Credential.md) -[Get-Culture](../microsoft.powershell.utility/get-culture.md) +[Get-Culture](../Microsoft.Powershell.Utility/Get-Culture.md) -[Get-Item](../microsoft.powershell.management/get-item.md) +[Get-Item](../Microsoft.Powershell.Management/Get-Item.md) [New-CimSession](New-CimSession.md) diff --git a/reference/5.1/CimCmdlets/Register-CimIndicationEvent.md b/reference/5.1/CimCmdlets/Register-CimIndicationEvent.md index 39e26c5a0f1f..2d0c6403f1a4 100644 --- a/reference/5.1/CimCmdlets/Register-CimIndicationEvent.md +++ b/reference/5.1/CimCmdlets/Register-CimIndicationEvent.md @@ -96,13 +96,13 @@ script block for **Action**, which uses the `$event` variable to access the even $action = { $name = $event.SourceEventArgs.NewEvent.ProcessName $id = $event.SourceEventArgs.NewEvent.ProcessId - Write-Host -Object "New Process Started : Name = $name - ID = $id" + Write-Host -Object "New Process Started : Name = $name ID = $id" } Register-CimIndicationEvent -ClassName 'Win32_ProcessStartTrace' -SourceIdentifier "ProcessStarted" -Action $action ``` -For more information, see [Win32_ProcessStartTrace](/previous-versions/windows/desktop/krnlprov/win32-processstarttrace). +For more information, see +[Win32_ProcessStartTrace](/previous-versions/windows/desktop/krnlprov/win32-processstarttrace). ### Example 4: Register the events on a remote computer @@ -390,14 +390,15 @@ This cmdlet returns an **EventSubscription** object. ## RELATED LINKS -[Get-Event](../microsoft.powershell.utility/get-event.md) +[Get-Event](../Microsoft.Powershell.Utility/Get-Event.md) -[Remove-Event](../microsoft.powershell.utility/remove-event.md) +[Remove-Event](../Microsoft.Powershell.Utility/Remove-Event.md) -[Unregister-Event](../microsoft.powershell.utility/unregister-event.md) +[Unregister-Event](../Microsoft.Powershell.Utility/Unregister-Event.md) -[Write-Host](../microsoft.powershell.utility/write-host.md) +[Write-Host](../Microsoft.Powershell.Utility/Write-Host.md) [Get-CimSession](Get-CimSession.md) [New-CimSession](New-CimSession.md) + diff --git a/reference/5.1/CimCmdlets/Remove-CimInstance.md b/reference/5.1/CimCmdlets/Remove-CimInstance.md index 237ee4fd4658..c1a6b74f4a4c 100644 --- a/reference/5.1/CimCmdlets/Remove-CimInstance.md +++ b/reference/5.1/CimCmdlets/Remove-CimInstance.md @@ -320,6 +320,6 @@ This cmdlet returns no output. [New-CimInstance](New-CimInstance.md) -[Get-CimInstance](get-ciminstance.md) +[Get-CimInstance](Get-CimInstance.md) [Set-CimInstance](Set-CimInstance.md) diff --git a/reference/5.1/CimCmdlets/Remove-CimSession.md b/reference/5.1/CimCmdlets/Remove-CimSession.md index 4a0c8cde989e..f27cef7031d0 100644 --- a/reference/5.1/CimCmdlets/Remove-CimSession.md +++ b/reference/5.1/CimCmdlets/Remove-CimSession.md @@ -124,7 +124,8 @@ Specifies the ID of the CIM session to remove. Specify one or more IDs separated the range operator (`..`) to specify a range of IDs. An **Id** is an integer that uniquely identifies the CIM session in the current PowerShell session. -For more information about the range operator, see [about_Operators](../Microsoft.PowerShell.Core/About/about_Operators.md). +For more information about the range operator, see +[about_Operators](../Microsoft.PowerShell.Core/About/about_Operators.md). ```yaml Type: System.UInt32[] @@ -144,7 +145,8 @@ Specifies the instance ID of the CIM session to remove. **InstanceId** is a Glob Identifier (GUID) that uniquely identifies a CIM session. The **InstanceId** is unique, even when you have multiple sessions running in PowerShell. -The **InstanceId** is stored in the **InstanceId** property of the object that represents a CIM session. +The **InstanceId** is stored in the **InstanceId** property of the object that represents a CIM +session. ```yaml Type: System.Guid[] diff --git a/reference/5.1/CimCmdlets/Set-CimInstance.md b/reference/5.1/CimCmdlets/Set-CimInstance.md index 9da90b0b89ac..53dffb7dd817 100644 --- a/reference/5.1/CimCmdlets/Set-CimInstance.md +++ b/reference/5.1/CimCmdlets/Set-CimInstance.md @@ -141,7 +141,7 @@ cmdlet, and retrieves its contents in to a variable `$x`. The variable is then p Because the **PassThru** parameter is used, This example returns a modified CIM instance object. ```powershell -$x = New-CimInstance -ClassName Win32_Environment -Property @{Name="testvar";UserName="domain\user"} -Key Name,UserName -ClientOnly +$x = New-CimInstance -ClassName Win32_Environment -Property @{Name="testvar";UserName="domain\user"} -Key Name, UserName -ClientOnly Set-CimInstance -CimInstance $x -Property @{VariableValue="somevalue"} -PassThru ``` @@ -415,8 +415,8 @@ When you use the **PassThru** parameter, this cmdlet returns the modified CIM in ## RELATED LINKS -[Get-CimInstance](get-ciminstance.md) +[Get-CimInstance](Get-CimInstance.md) [New-CimInstance](New-CimInstance.md) -[Remove-CimInstance](remove-ciminstance.md) +[Remove-CimInstance](Remove-CimInstance.md) diff --git a/reference/5.1/Microsoft.PowerShell.Archive/Expand-Archive.md b/reference/5.1/Microsoft.PowerShell.Archive/Expand-Archive.md index e424bd7f7ede..b6ceed6511ca 100644 --- a/reference/5.1/Microsoft.PowerShell.Archive/Expand-Archive.md +++ b/reference/5.1/Microsoft.PowerShell.Archive/Expand-Archive.md @@ -187,4 +187,4 @@ different than the source filename stored in the archive. ## RELATED LINKS -[Compress-Archive](compress-archive.md) +[Compress-Archive](Compress-Archive.md) diff --git a/reference/5.1/Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.md b/reference/5.1/Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.md index 41ff708d2b29..0b26bb8f039b 100644 --- a/reference/5.1/Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.md +++ b/reference/5.1/Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.md @@ -12,12 +12,16 @@ title: Microsoft.PowerShell.Archive ## Description -This section contains the help topics for the cmdlets that are installed with the PowerShell Microsoft.PowerShell.Archive module. The Archive module contains cmdlets that let you create and extract archive or ZIP files. +This section contains the help topics for the cmdlets that are installed with the PowerShell +Microsoft.PowerShell.Archive module. The Archive module contains cmdlets that let you create and +extract archive or ZIP files. ## Microsoft.PowerShell.Archive Cmdlets ### [Compress-Archive](Compress-Archive.md) + Creates a compressed archive, or zipped file, from specified files and directories. ### [Expand-Archive](Expand-Archive.md) + Extracts files from a specified archive (zipped) file. diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/About.md b/reference/5.1/Microsoft.PowerShell.Core/About/About.md index c9bc27a45a8e..e691c9239bd1 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/About.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/About.md @@ -2,7 +2,7 @@ description: About topics cover a range of concepts about PowerShell. Help Version: 6.0 Locale: en-US -ms.date: 01/14/2025 +ms.date: 01/21/2025 title: About topics --- # About topics @@ -583,7 +583,7 @@ terminating errors. ### [about_Type_Accelerators](about_Type_Accelerators.md) -Describes the Type accelerators available for .NET framework classes +Describes the Type accelerators available for .NET types. ### [about_Type_Conversion](about_Type_Conversion.md) diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Classes_Properties.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Classes_Properties.md index 592c249a0b30..377380e94ce4 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Classes_Properties.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Classes_Properties.md @@ -1,7 +1,7 @@ --- description: Describes how to define properties for PowerShell classes. Locale: en-US -ms.date: 11/13/2023 +ms.date: 01/21/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_classes_properties?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_Classes_Properties @@ -527,7 +527,8 @@ properties: > [!IMPORTANT] > Static properties for classes defined in PowerShell aren't immutable. They -> can +> can be overridden to any valid value, as defined by the static property's +> type and attributes. ## Derived class properties diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Type_Accelerators.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Type_Accelerators.md index cee413dbb35d..eff2c9a0bde9 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Type_Accelerators.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Type_Accelerators.md @@ -1,29 +1,68 @@ --- -description: Describes the Type accelerators available for .NET framework classes +description: Describes the type accelerators available for .NET types. Locale: en-US -ms.date: 08/30/2023 +ms.date: 01/21/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_type_accelerators?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_Type_Accelerators --- # about_Type_Accelerators -## SHORT DESCRIPTION -Describes the Type accelerators available for .NET framework classes +## Short description + +Describes the type accelerators available for .NET types. ## Long description -Type accelerators are aliases for .NET framework classes. They allow you to -access specific .NET framework classes without having to explicitly type the -entire class name. For example, you can shorten the **AliasAttribute** -class from `[System.Management.Automation.AliasAttribute]` to `[Alias]`. +Type accelerators are aliases for .NET types. They allow you to access specific +.NET types without explicitly using the full type name. For example, you can +shorten `[System.Management.Automation.AliasAttribute]` to `[Alias]`. + +Type accelerator names are mostly lowercase, but some are defined using +Pascal-case. PowerShell is case-insensitive, so you can use either. + +## Using type accelerators + +For most type accelerators, you use type accelerators in the same way as +you would use the full type name. However, PowerShell has special handling for +the following two type accelerators: + +- `pscustomobject` - See [about_PSCustomObject](about_PSCustomObject.md) +- `ref` - See [about_Ref](about_Ref.md) + +Type accelerators are most commonly used to specify the type of a variable or +cast an object to a specific type. For those cases, you must enclose the type +name or its accelerator in square brackets (`[]`). For example, `[int]` or +`[int32]`. + +In some contexts, you can specify allow type accelerator name as a string. For +example: + +- When used with type comparison operators + + ```powershell + PS> '1' -as 'int' + 1 + PS> 1 -is 'int' + True + ``` + +- When used with `[type]` type class + + ```powershell + PS> [type]'int' + + IsPublic IsSerial Name BaseType + -------- -------- ---- -------- + True True Int32 System.ValueType + ``` -> [!NOTE] -> All type accelerators still need to be wrapped in square brackets(`[]`). +In other contexts, like reflection, you must use the full type name as a string +rather than the type accelerator name. -## Available Type Accelerators +## Default type accelerators -| Accelerator | Full Class Name | +| Accelerator name | Full type name | | ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | | adsi | [System.DirectoryServices.DirectoryEntry](xref:System.DirectoryServices.DirectoryEntry) | | adsisearcher | [System.DirectoryServices.DirectorySearcher](xref:System.DirectoryServices.DirectorySearcher) | diff --git a/reference/7.4/CimCmdlets/CimCmdlets.md b/reference/7.4/CimCmdlets/CimCmdlets.md index ea38ee007b8e..cf06e6fb0d6c 100644 --- a/reference/7.4/CimCmdlets/CimCmdlets.md +++ b/reference/7.4/CimCmdlets/CimCmdlets.md @@ -20,43 +20,57 @@ This module is only available on the Windows platform. ## CimCmdlets Cmdlets ### [Export-BinaryMiLog](Export-BinaryMiLog.md) + Creates a binary encoded representation of an object or objects and stores it in a file. ### [Get-CimAssociatedInstance](Get-CimAssociatedInstance.md) + Retrieves the CIM instances that are connected to a specific CIM instance by an association. ### [Get-CimClass](Get-CimClass.md) + Gets a list of CIM classes in a specific namespace. ### [Get-CimInstance](Get-CimInstance.md) + Gets the CIM instances of a class from a CIM server. ### [Get-CimSession](Get-CimSession.md) + Gets the CIM session objects from the current session. ### [Import-BinaryMiLog](Import-BinaryMiLog.md) + Used to re-create the saved objects based on the contents of an export file. ### [Invoke-CimMethod](Invoke-CimMethod.md) + Invokes a method of a CIM class. ### [New-CimInstance](New-CimInstance.md) + Creates a CIM instance. ### [New-CimSession](New-CimSession.md) + Creates a CIM session. ### [New-CimSessionOption](New-CimSessionOption.md) + Specifies advanced options for the `New-CimSession` cmdlet. ### [Register-CimIndicationEvent](Register-CimIndicationEvent.md) + Subscribes to indications using a filter expression or a query expression. ### [Remove-CimInstance](Remove-CimInstance.md) + Removes a CIM instance from a computer. ### [Remove-CimSession](Remove-CimSession.md) + Removes one or more CIM sessions. ### [Set-CimInstance](Set-CimInstance.md) + Modifies a CIM instance on a CIM server by calling the **ModifyInstance** method of the CIM class. diff --git a/reference/7.4/CimCmdlets/Get-CimAssociatedInstance.md b/reference/7.4/CimCmdlets/Get-CimAssociatedInstance.md index 6d8426b4101c..3a33d0d91e69 100644 --- a/reference/7.4/CimCmdlets/Get-CimAssociatedInstance.md +++ b/reference/7.4/CimCmdlets/Get-CimAssociatedInstance.md @@ -332,6 +332,6 @@ This cmdlet is only available on Windows platforms. ## RELATED LINKS -[Get-CimClass](get-cimclass.md) +[Get-CimClass](Get-CimClass.md) -[Get-CimInstance](get-ciminstance.md) +[Get-CimInstance](Get-CimInstance.md) diff --git a/reference/7.4/CimCmdlets/Get-CimInstance.md b/reference/7.4/CimCmdlets/Get-CimInstance.md index 04873e74bf35..78befd6d3ca7 100644 --- a/reference/7.4/CimCmdlets/Get-CimInstance.md +++ b/reference/7.4/CimCmdlets/Get-CimInstance.md @@ -144,7 +144,7 @@ the key property `@{ "Handle"=0 }` and stores it in a variable named `$x`. The v a CIM instance to the `Get-CimInstance` cmdlet to get a particular instance. ```powershell -$x = New-CimInstance -ClassName Win32_Process -Namespace root\cimv2 -Property @{ "Handle"=0 } -Key Handle -ClientOnly +$x = New-CimInstance -ClassName Win32_Process -Namespace root\cimv2 -Property @{"Handle"=0} -Key Handle -ClientOnly Get-CimInstance -CimInstance $x ``` @@ -156,7 +156,7 @@ the variables `$x` and `$y`. The variable `$x` is then formatted in a table cont ```powershell $x,$y = Get-CimInstance -ClassName Win32_Process -$x | Format-Table -Property Name,KernelModeTime -AutoSize +$x | Format-Table -Property Name, KernelModeTime -AutoSize ``` ```Output @@ -171,7 +171,7 @@ This example retrieves the CIM instances of a class named **Win32_ComputerSystem computers named **Server01** and **Server02**. ```powershell -Get-CimInstance -ClassName Win32_ComputerSystem -ComputerName Server01,Server02 +Get-CimInstance -ClassName Win32_ComputerSystem -ComputerName Server01, Server02 ``` ### Example 8: Getting only the key properties, instead of all properties @@ -190,8 +190,8 @@ This example retrieves only a subset of properties, which reduces the size of th traffic. ```powershell -Get-CimInstance -Class Win32_Process -Property Name,KernelModeTime -$x = Get-CimInstance -Class Win32_Process -Property Name,KernelModeTime +Get-CimInstance -Class Win32_Process -Property Name, KernelModeTime +$x = Get-CimInstance -Class Win32_Process -Property Name, KernelModeTime $x | Invoke-CimMethod -MethodName GetOwner ``` @@ -206,7 +206,7 @@ the variable are then passed to `Get-CimInstance` by using the **CimSession** pa CIM instances of the class named **Win32_ComputerSystem**. ```powershell -$s = New-CimSession -ComputerName Server01,Server02 +$s = New-CimSession -ComputerName Server01, Server02 Get-CimInstance -ClassName Win32_ComputerSystem -CimSession $s ``` @@ -216,7 +216,8 @@ Get-CimInstance -ClassName Win32_ComputerSystem -CimSession $s Specifies the CIM session to use for this cmdlet. Enter a variable that contains the CIM session or a command that creates or gets the CIM session, such as the `New-CimSession` or `Get-CimSession` -cmdlets. For more information, see [about_CimSession](../Microsoft.PowerShell.Core/About/about_CimSession.md). +cmdlets. For more information, see +[about_CimSession](../Microsoft.PowerShell.Core/About/about_CimSession.md). ```yaml Type: Microsoft.Management.Infrastructure.CimSession[] @@ -322,8 +323,8 @@ Accept wildcard characters: False Indicates that only objects with key properties populated are returned. Specifying the **KeyOnly** parameter reduces the amount of data transferred over the network. -Use the **KeyOnly** parameter to return only a small portion of the object, which can be used for other -operations, such as the `Set-CimInstance` or `Get-CimAssociatedInstance` cmdlets. +Use the **KeyOnly** parameter to return only a small portion of the object, which can be used for +other operations, such as the `Set-CimInstance` or `Get-CimAssociatedInstance` cmdlets. ```yaml Type: System.Management.Automation.SwitchParameter @@ -497,7 +498,8 @@ Accept wildcard characters: False This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, --WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS @@ -523,18 +525,18 @@ This cmdlet is only available on Windows platforms. ## RELATED LINKS -[Format-Table](../microsoft.powershell.utility/format-table.md) +[Format-Table](../Microsoft.Powershell.Utility/Format-Table.md) [Get-CimAssociatedInstance](Get-CimAssociatedInstance.md) [Get-CimClass](Get-CimClass.md) -[Invoke-CimMethod](invoke-cimmethod.md) +[Invoke-CimMethod](Invoke-CimMethod.md) [New-CimInstance](New-CimInstance.md) [Register-CimIndicationEvent](Register-CimIndicationEvent.md) -[Remove-CimInstance](remove-ciminstance.md) +[Remove-CimInstance](Remove-CimInstance.md) [Set-CimInstance](Set-CimInstance.md) diff --git a/reference/7.4/CimCmdlets/Get-CimSession.md b/reference/7.4/CimCmdlets/Get-CimSession.md index 5c9e723b1391..67433362ce4b 100644 --- a/reference/7.4/CimCmdlets/Get-CimSession.md +++ b/reference/7.4/CimCmdlets/Get-CimSession.md @@ -48,7 +48,8 @@ can use the parameters of `Get-CimSession` to get the sessions that are for part you can identify sessions by their names or other identifiers. `Get-CimSession` does not get CIM sessions that were created in other PowerShell sessions or that were created on other computers. -For more information about CIM sessions, see [about_CimSession](../Microsoft.PowerShell.Core/About/about_CimSession.md). +For more information about CIM sessions, see +[about_CimSession](../Microsoft.PowerShell.Core/About/about_CimSession.md). ## EXAMPLES @@ -58,7 +59,7 @@ This example creates CIM sessions using [New-CimSession](New-CimSession.md), and sessions using `Get-CimSession`. ```powershell -New-CimSession -ComputerName Server01,Server02 +New-CimSession -ComputerName Server01, Server02 Get-CimSession ``` @@ -98,7 +99,7 @@ This example gets all CIM sessions in the current PowerShell session and display only the **ComputerName** and **InstanceID** properties. ```powershell -Get-CimSession | Format-Table -Property ComputerName,InstanceId +Get-CimSession | Format-Table -Property ComputerName, InstanceId ``` ```Output @@ -171,7 +172,8 @@ Specifies the identifier of the CIM session to get. For multiple IDs, use commas or use the range operator (`..`) to specify a range of IDs. An **Id** is an integer that uniquely identifies the CIM session within the current PowerShell session. -For more information about the range operator, see [about_Operators](../Microsoft.PowerShell.Core/About/about_Operators.md). +For more information about the range operator, see +[about_Operators](../Microsoft.PowerShell.Core/About/about_Operators.md). ```yaml Type: System.UInt32[] @@ -225,6 +227,7 @@ Accept wildcard characters: True ``` ### CommonParameters + This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see @@ -253,10 +256,10 @@ This cmdlet is only available on Windows platforms. ## RELATED LINKS -[Format-Table](../microsoft.powershell.utility/format-table.md) +[Format-Table](../Microsoft.Powershell.Utility/Format-Table.md) [New-CimSession](New-CimSession.md) -[Remove-CimSession](remove-cimsession.md) +[Remove-CimSession](Remove-CimSession.md) [about_CimSession](../Microsoft.PowerShell.Core/About/about_CimSession.md) diff --git a/reference/7.4/CimCmdlets/Invoke-CimMethod.md b/reference/7.4/CimCmdlets/Invoke-CimMethod.md index b3f2d24c386d..f9dcb897741d 100644 --- a/reference/7.4/CimCmdlets/Invoke-CimMethod.md +++ b/reference/7.4/CimCmdlets/Invoke-CimMethod.md @@ -155,7 +155,7 @@ to `Invoke-CimMethod`. ```powershell $c = Get-CimClass -ClassName Win32_Process -Invoke-CimMethod -CimClass $c -MethodName "xyz" -Arguments @{ CommandLine = 'notepad.exe' } +Invoke-CimMethod -CimClass $c -MethodName "xyz" -Arguments @{CommandLine='notepad.exe'} ``` ## PARAMETERS @@ -476,9 +476,9 @@ This cmdlet is only available on Windows platforms. ## RELATED LINKS -[Get-CimClass](get-cimclass.md) +[Get-CimClass](Get-CimClass.md) -[Get-CimInstance](get-ciminstance.md) +[Get-CimInstance](Get-CimInstance.md) [Get-CimSession](Get-CimSession.md) diff --git a/reference/7.4/CimCmdlets/New-CimInstance.md b/reference/7.4/CimCmdlets/New-CimInstance.md index 5462b4d4a97b..3d17aa2690ce 100644 --- a/reference/7.4/CimCmdlets/New-CimInstance.md +++ b/reference/7.4/CimCmdlets/New-CimInstance.md @@ -277,10 +277,10 @@ Accept wildcard characters: False Specifies the amount of time that the cmdlet waits for a response from the CIM server. By default, the value of this parameter is 0, which means that the cmdlet uses the default timeout value for the -server. If the **OperationTimeoutSec** parameter is set to a value less than the robust connection retry -timeout of 3 minutes, network failures that last more than the value of the **OperationTimeoutSec** -parameter are not recoverable, because the operation on the server times out before the client can -reconnect. +server. If the **OperationTimeoutSec** parameter is set to a value less than the robust connection +retry timeout of 3 minutes, network failures that last more than the value of the +**OperationTimeoutSec** parameter are not recoverable, because the operation on the server times +out before the client can reconnect. ```yaml Type: System.UInt32 @@ -412,10 +412,10 @@ This cmdlet is only available on Windows platforms. ## RELATED LINKS -[Get-CimClass](get-cimclass.md) +[Get-CimClass](Get-CimClass.md) -[Get-CimInstance](get-ciminstance.md) +[Get-CimInstance](Get-CimInstance.md) -[Remove-CimInstance](remove-ciminstance.md) +[Remove-CimInstance](Remove-CimInstance.md) [Set-CimInstance](Set-CimInstance.md) diff --git a/reference/7.4/CimCmdlets/New-CimSession.md b/reference/7.4/CimCmdlets/New-CimSession.md index cb0f279b080e..812340fe1904 100644 --- a/reference/7.4/CimCmdlets/New-CimSession.md +++ b/reference/7.4/CimCmdlets/New-CimSession.md @@ -10,7 +10,6 @@ title: New-CimSession # New-CimSession ## SYNOPSIS - Creates a CIM session. ## SYNTAX @@ -68,7 +67,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 @@ -77,7 +76,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* ``` @@ -130,9 +129,9 @@ parameter are: - NtlmDomain - CredSsp -You cannot use the **NtlmDomain** authentication type for connection to the local computer. **CredSSP** -authentication is available only in Windows Vista, Windows Server 2008, and later versions of -Windows. +You cannot use the **NtlmDomain** authentication type for connection to the local computer. +**CredSSP** authentication is available only in Windows Vista, Windows Server 2008, and later +versions of Windows. > [!CAUTION] > Credential Security Service Provider (CredSSP) authentication is designed for commands that @@ -166,7 +165,8 @@ To get a certificate thumbprint, use the [`Get-ChildItem`](../Microsoft.Powershell.Management/Get-ChildItem.md) cmdlets in the PowerShell Certificate Provider. -For more information, see [about_Certificate_Provider](../Microsoft.PowerShell.Security/About/about_Certificate_Provider.md). +For more information, see +[about_Certificate_Provider](../Microsoft.PowerShell.Security/About/about_Certificate_Provider.md). ```yaml Type: System.String @@ -217,7 +217,8 @@ Specify the value for **Credential** using one of the following formats: - A user name: "User01" - A domain name and a user name: "Domain01\User01" - A user principal name: "User@Domain.com" -- A PSCredential object, such as one returned by the [`Get-Credential`](../Microsoft.PowerShell.Security/Get-Credential.md) cmdlet. +- A PSCredential object, such as one returned by the + [`Get-Credential`](../Microsoft.PowerShell.Security/Get-Credential.md) cmdlet. When you type a user name, you are prompted for a password. @@ -237,8 +238,9 @@ 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. +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. ```yaml Type: System.String diff --git a/reference/7.4/CimCmdlets/New-CimSessionOption.md b/reference/7.4/CimCmdlets/New-CimSessionOption.md index bbfa89d67fcd..8d18c180a2af 100644 --- a/reference/7.4/CimCmdlets/New-CimSessionOption.md +++ b/reference/7.4/CimCmdlets/New-CimSessionOption.md @@ -95,7 +95,8 @@ parameter using one of the following formats: - A culture name in `-` format such as "EN-US". - A variable that contains a **CultureInfo** object. -- A command that gets a **CultureInfo** object, such as [Get-Culture](../Microsoft.PowerShell.Utility/Get-Culture.md) +- A command that gets a **CultureInfo** object, such as + [Get-Culture](../Microsoft.PowerShell.Utility/Get-Culture.md) ```yaml Type: System.Globalization.CultureInfo @@ -488,12 +489,12 @@ This cmdlet is only available on Windows platforms. ## RELATED LINKS -[Get-ChildItem](../microsoft.powershell.management/get-childitem.md) +[Get-ChildItem](../Microsoft.Powershell.Management/Get-ChildItem.md) -[Get-Credential](../microsoft.powershell.security/get-credential.md) +[Get-Credential](../Microsoft.Powershell.Security/Get-Credential.md) -[Get-Culture](../microsoft.powershell.utility/get-culture.md) +[Get-Culture](../Microsoft.Powershell.Utility/Get-Culture.md) -[Get-Item](../microsoft.powershell.management/get-item.md) +[Get-Item](../Microsoft.Powershell.Management/Get-Item.md) [New-CimSession](New-CimSession.md) diff --git a/reference/7.4/CimCmdlets/Register-CimIndicationEvent.md b/reference/7.4/CimCmdlets/Register-CimIndicationEvent.md index 2b8390ac5106..e28caf6c67d0 100644 --- a/reference/7.4/CimCmdlets/Register-CimIndicationEvent.md +++ b/reference/7.4/CimCmdlets/Register-CimIndicationEvent.md @@ -98,13 +98,13 @@ script block for **Action**, which uses the `$event` variable to access the even $action = { $name = $event.SourceEventArgs.NewEvent.ProcessName $id = $event.SourceEventArgs.NewEvent.ProcessId - Write-Host -Object "New Process Started : Name = $name - ID = $id" + Write-Host -Object "New Process Started : Name = $name ID = $id" } Register-CimIndicationEvent -ClassName 'Win32_ProcessStartTrace' -SourceIdentifier "ProcessStarted" -Action $action ``` -For more information, see [Win32_ProcessStartTrace](/previous-versions/windows/desktop/krnlprov/win32-processstarttrace). +For more information, see +[Win32_ProcessStartTrace](/previous-versions/windows/desktop/krnlprov/win32-processstarttrace). ### Example 4: Register the events on a remote computer @@ -399,13 +399,13 @@ This cmdlet is only available on Windows platforms. ## RELATED LINKS -[Get-Event](../microsoft.powershell.utility/get-event.md) +[Get-Event](../Microsoft.Powershell.Utility/Get-Event.md) -[Remove-Event](../microsoft.powershell.utility/remove-event.md) +[Remove-Event](../Microsoft.Powershell.Utility/Remove-Event.md) -[Unregister-Event](../microsoft.powershell.utility/unregister-event.md) +[Unregister-Event](../Microsoft.Powershell.Utility/Unregister-Event.md) -[Write-Host](../microsoft.powershell.utility/write-host.md) +[Write-Host](../Microsoft.Powershell.Utility/Write-Host.md) [Get-CimSession](Get-CimSession.md) diff --git a/reference/7.4/CimCmdlets/Remove-CimInstance.md b/reference/7.4/CimCmdlets/Remove-CimInstance.md index 0683c81674d4..c33db4b2a311 100644 --- a/reference/7.4/CimCmdlets/Remove-CimInstance.md +++ b/reference/7.4/CimCmdlets/Remove-CimInstance.md @@ -329,6 +329,6 @@ This cmdlet is only available on Windows platforms. [New-CimInstance](New-CimInstance.md) -[Get-CimInstance](get-ciminstance.md) +[Get-CimInstance](Get-CimInstance.md) [Set-CimInstance](Set-CimInstance.md) diff --git a/reference/7.4/CimCmdlets/Remove-CimSession.md b/reference/7.4/CimCmdlets/Remove-CimSession.md index 7ebd428f279a..235463369163 100644 --- a/reference/7.4/CimCmdlets/Remove-CimSession.md +++ b/reference/7.4/CimCmdlets/Remove-CimSession.md @@ -126,7 +126,8 @@ Specifies the ID of the CIM session to remove. Specify one or more IDs separated the range operator (`..`) to specify a range of IDs. An **Id** is an integer that uniquely identifies the CIM session in the current PowerShell session. -For more information about the range operator, see [about_Operators](../Microsoft.PowerShell.Core/About/about_Operators.md). +For more information about the range operator, see +[about_Operators](../Microsoft.PowerShell.Core/About/about_Operators.md). ```yaml Type: System.UInt32[] @@ -146,7 +147,8 @@ Specifies the instance ID of the CIM session to remove. **InstanceId** is a Glob Identifier (GUID) that uniquely identifies a CIM session. The **InstanceId** is unique, even when you have multiple sessions running in PowerShell. -The **InstanceId** is stored in the **InstanceId** property of the object that represents a CIM session. +The **InstanceId** is stored in the **InstanceId** property of the object that represents a CIM +session. ```yaml Type: System.Guid[] diff --git a/reference/7.4/CimCmdlets/Set-CimInstance.md b/reference/7.4/CimCmdlets/Set-CimInstance.md index ebc205641666..a241fc87f52d 100644 --- a/reference/7.4/CimCmdlets/Set-CimInstance.md +++ b/reference/7.4/CimCmdlets/Set-CimInstance.md @@ -143,7 +143,7 @@ cmdlet, and retrieves its contents in to a variable `$x`. The variable is then p Because the **PassThru** parameter is used, This example returns a modified CIM instance object. ```powershell -$x = New-CimInstance -ClassName Win32_Environment -Property @{Name="testvar";UserName="domain\user"} -Key Name,UserName -ClientOnly +$x = New-CimInstance -ClassName Win32_Environment -Property @{Name="testvar";UserName="domain\user"} -Key Name, UserName -ClientOnly Set-CimInstance -CimInstance $x -Property @{VariableValue="somevalue"} -PassThru ``` @@ -424,8 +424,8 @@ This cmdlet is only available on Windows platforms. ## RELATED LINKS -[Get-CimInstance](get-ciminstance.md) +[Get-CimInstance](Get-CimInstance.md) [New-CimInstance](New-CimInstance.md) -[Remove-CimInstance](remove-ciminstance.md) +[Remove-CimInstance](Remove-CimInstance.md) diff --git a/reference/7.4/Microsoft.PowerShell.Archive/Expand-Archive.md b/reference/7.4/Microsoft.PowerShell.Archive/Expand-Archive.md index 14aeaca5ae63..b69f364616b1 100644 --- a/reference/7.4/Microsoft.PowerShell.Archive/Expand-Archive.md +++ b/reference/7.4/Microsoft.PowerShell.Archive/Expand-Archive.md @@ -215,4 +215,4 @@ different than the source filename stored in the archive. ## RELATED LINKS -[Compress-Archive](compress-archive.md) +[Compress-Archive](Compress-Archive.md) diff --git a/reference/7.4/Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.md b/reference/7.4/Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.md index 1e809c37eb38..7efddb380729 100644 --- a/reference/7.4/Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.md +++ b/reference/7.4/Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.md @@ -14,13 +14,15 @@ title: Microsoft.PowerShell.Archive ## Description This section contains the help topics for the cmdlets that are installed with the PowerShell -Microsoft.PowerShell.Archive module. The Archive module contains cmdlets that let you manage ZIP -archive files. +Microsoft.PowerShell.Archive module. The Archive module contains cmdlets that let you create and +extract archive or ZIP files. ## Microsoft.PowerShell.Archive Cmdlets ### [Compress-Archive](Compress-Archive.md) -Creates a compressed ZIP archive from specified files and directories. + +Creates a compressed archive, or zipped file, from specified files and directories. ### [Expand-Archive](Expand-Archive.md) -Extracts files from a specified ZIP archive file. + +Extracts files from a specified archive (zipped) file. diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/About.md b/reference/7.4/Microsoft.PowerShell.Core/About/About.md index 62b3763bc7ac..1a38ce399f49 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/About.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/About.md @@ -2,7 +2,7 @@ description: About topics cover a range of concepts about PowerShell. Help Version: 7.4.0.0 Locale: en-US -ms.date: 01/14/2025 +ms.date: 01/21/2025 title: About topics --- # About topics @@ -601,7 +601,7 @@ terminating errors. ### [about_Type_Accelerators](about_Type_Accelerators.md) -Describes the Type accelerators available for .NET framework classes +Describes the Type accelerators available for .NET types. ### [about_Type_Conversion](about_Type_Conversion.md) diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Classes_Properties.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Classes_Properties.md index 4bc1af30d482..183de93b5aae 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Classes_Properties.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Classes_Properties.md @@ -1,7 +1,7 @@ --- description: Describes how to define properties for PowerShell classes. Locale: en-US -ms.date: 11/13/2023 +ms.date: 01/21/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_classes_properties?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_Classes_Properties @@ -523,7 +523,8 @@ properties: > [!IMPORTANT] > Static properties for classes defined in PowerShell aren't immutable. They -> can +> can be overridden to any valid value, as defined by the static property's +> type and attributes. ## Derived class properties diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Type_Accelerators.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Type_Accelerators.md index 3bb53ea5cff9..860061b93a32 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Type_Accelerators.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Type_Accelerators.md @@ -1,29 +1,68 @@ --- -description: Describes the Type accelerators available for .NET framework classes +description: Describes the type accelerators available for .NET types. Locale: en-US -ms.date: 08/30/2023 +ms.date: 01/21/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_type_accelerators?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_Type_Accelerators --- # about_Type_Accelerators -## SHORT DESCRIPTION -Describes the Type accelerators available for .NET framework classes +## Short description + +Describes the type accelerators available for .NET types. ## Long description -Type accelerators are aliases for .NET framework classes. They allow you to -access specific .NET framework classes without having to explicitly type the -entire class name. For example, you can shorten the **AliasAttribute** -class from `[System.Management.Automation.AliasAttribute]` to `[Alias]`. +Type accelerators are aliases for .NET types. They allow you to access specific +.NET types without explicitly using the full type name. For example, you can +shorten `[System.Management.Automation.AliasAttribute]` to `[Alias]`. + +Type accelerator names are mostly lowercase, but some are defined using +Pascal-case. PowerShell is case-insensitive, so you can use either. + +## Using type accelerators + +For most type accelerators, you use type accelerators in the same way as +you would use the full type name. However, PowerShell has special handling for +the following two type accelerators: + +- `pscustomobject` - See [about_PSCustomObject](about_PSCustomObject.md) +- `ref` - See [about_Ref](about_Ref.md) + +Type accelerators are most commonly used to specify the type of a variable or +cast an object to a specific type. For those cases, you must enclose the type +name or its accelerator in square brackets (`[]`). For example, `[int]` or +`[int32]`. + +In some contexts, you can specify allow type accelerator name as a string. For +example: + +- When used with type comparison operators + + ```powershell + PS> '1' -as 'int' + 1 + PS> 1 -is 'int' + True + ``` + +- When used with `[type]` type class + + ```powershell + PS> [type]'int' + + IsPublic IsSerial Name BaseType + -------- -------- ---- -------- + True True Int32 System.ValueType + ``` -> [!NOTE] -> All type accelerators still need to be wrapped in square brackets(`[]`). +In other contexts, like reflection, you must use the full type name as a string +rather than the type accelerator name. -## Available Type Accelerators +## Default type accelerators -| Accelerator | Full Class Name | +| Accelerator name | Full type name | | ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | | adsi | [System.DirectoryServices.DirectoryEntry](xref:System.DirectoryServices.DirectoryEntry) | | adsisearcher | [System.DirectoryServices.DirectorySearcher](xref:System.DirectoryServices.DirectorySearcher) | @@ -66,6 +105,7 @@ class from `[System.Management.Automation.AliasAttribute]` to `[Alias]`. | IPEndpoint | [System.Net.IPEndPoint](xref:System.Net.IPEndPoint) | | long | [System.Int64](xref:System.Int64) | | mailaddress | [System.Net.Mail.MailAddress](xref:System.Net.Mail.MailAddress) | +| NoRunspaceAffinity | [System.Management.Automation.Language.NoRunspaceAffinityAttribute](xref:System.Management.Automation.Language.NoRunspaceAffinityAttribute) | | NullString | [System.Management.Automation.Language.NullString](xref:System.Management.Automation.Language.NullString) | | ObjectSecurity | [System.Security.AccessControl.ObjectSecurity](xref:System.Security.AccessControl.ObjectSecurity) | | ordered | [System.Collections.Specialized.OrderedDictionary](xref:System.Collections.Specialized.OrderedDictionary) | @@ -115,6 +155,7 @@ class from `[System.Management.Automation.AliasAttribute]` to `[Alias]`. | ValidateLength | [System.Management.Automation.ValidateLengthAttribute](xref:System.Management.Automation.ValidateLengthAttribute) | | ValidateNotNull | [System.Management.Automation.ValidateNotNullAttribute](xref:System.Management.Automation.ValidateNotNullAttribute) | | ValidateNotNullOrEmpty | [System.Management.Automation.ValidateNotNullOrEmptyAttribute](xref:System.Management.Automation.ValidateNotNullOrEmptyAttribute) | +| ValidateNotNullOrWhiteSpace | [System.Management.Automation.ValidateNotNullOrWhiteSpaceAttribute](xref:System.Management.Automation.ValidateNotNullOrWhiteSpaceAttribute) | | ValidatePattern | [System.Management.Automation.ValidatePatternAttribute](xref:System.Management.Automation.ValidatePatternAttribute) | | ValidateRange | [System.Management.Automation.ValidateRangeAttribute](xref:System.Management.Automation.ValidateRangeAttribute) | | ValidateScript | [System.Management.Automation.ValidateScriptAttribute](xref:System.Management.Automation.ValidateScriptAttribute) | diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/About.md b/reference/7.5/Microsoft.PowerShell.Core/About/About.md index 9fece39f02aa..66047e8cfc6d 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/About.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/About.md @@ -2,7 +2,7 @@ description: About topics cover a range of concepts about PowerShell. Help Version: 7.5.0.0 Locale: en-US -ms.date: 01/14/2025 +ms.date: 01/21/2025 title: About topics --- # About topics @@ -601,7 +601,7 @@ terminating errors. ### [about_Type_Accelerators](about_Type_Accelerators.md) -Describes the Type accelerators available for .NET framework classes +Describes the Type accelerators available for .NET types. ### [about_Type_Conversion](about_Type_Conversion.md) diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Classes_Properties.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Classes_Properties.md index 51d58cf4eab3..f25c7f547ff6 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Classes_Properties.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Classes_Properties.md @@ -1,7 +1,7 @@ --- description: Describes how to define properties for PowerShell classes. Locale: en-US -ms.date: 11/13/2023 +ms.date: 01/21/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_classes_properties?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_Classes_Properties @@ -522,7 +522,8 @@ properties: > [!IMPORTANT] > Static properties for classes defined in PowerShell aren't immutable. They -> can +> can be overridden to any valid value, as defined by the static property's +> type and attributes. ## Derived class properties diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Data_Files.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Data_Files.md index ee224b6c125c..4b307afa41e9 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Data_Files.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Data_Files.md @@ -48,10 +48,10 @@ the commands and variables that can be used. For more information, see [about_Language_Modes][02]. -Originally, localized data files were meant to be used to store string data that -could be translated into other languages. This allowed your scripts to import -the data to provide localized string output in other languages. However, you -aren't limited to storing string data and don't have to use the data for +Originally, localized data files were meant to be used to store string data +that could be translated into other languages. This allowed your scripts to +import the data to provide localized string output in other languages. However, +you aren't limited to storing string data and don't have to use the data for localized output. The data in the file isn't limited to hashtables. It can be in any format diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Data_Sections.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Data_Sections.md index 24b3450c5489..bc1cac37644a 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Data_Sections.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Data_Sections.md @@ -98,8 +98,8 @@ DATA -supportedCommand Format-Xml ### Using a `DATA` Section -To use the content of a `DATA` section, assign it to a variable and use variable -notation to access the content. +To use the content of a `DATA` section, assign it to a variable and use +variable notation to access the content. For example, the following `DATA` section contains a `ConvertFrom-StringData` command that converts the here-string into a hash table. The hash table is @@ -173,7 +173,7 @@ A single-quoted here-string that uses the `ConvertFrom-StringData` cmdlet: ```powershell DATA { - ConvertFrom-StringData -stringdata @' + ConvertFrom-StringData -StringData @' Text001 = Windows 7 Text002 = Windows Server 2008 R2 '@ @@ -184,7 +184,7 @@ A double-quoted here-string that uses the `ConvertFrom-StringData` cmdlet: ```powershell DATA { - ConvertFrom-StringData -stringdata @" + ConvertFrom-StringData -StringData @" Msg1 = To start, press any key. Msg2 = To exit, type "quit". "@ @@ -195,7 +195,7 @@ A data section that includes a user-written cmdlet that generates data: ```powershell DATA -supportedCommand Format-XML { - Format-Xml -strings string1, string2, string3 + Format-Xml -Strings string1, string2, string3 } ``` diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Debuggers.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Debuggers.md index 8d43c45c7487..0471022e86da 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Debuggers.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Debuggers.md @@ -192,7 +192,7 @@ For example, the following command gets the variables in the local (script) scope: ```powershell -Get-Variable -scope 0 +Get-Variable -Scope 0 ``` This is a useful way to see only the variables that you defined in the script @@ -225,17 +225,17 @@ For example: ```powershell function test-cmdlet { begin { - write-output "Begin" + Write-Output "Begin" } process { - write-output "Process" + Write-Output "Process" } end { - write-output "End" + Write-Output "End" } } -C:\PS> Set-PSBreakpoint -command test-cmdlet +C:\PS> Set-PSBreakpoint -Command test-cmdlet C:\PS> test-cmdlet @@ -285,7 +285,7 @@ identifying changes to the prompt: ```powershell Enter-PSSession -Cn localhost -[localhost]: PS C:\psscripts> Set-PSBreakpoint .\ttest19.ps1 6,11,22,25 +[localhost]: PS C:\psscripts> Set-PSBreakpoint .\ttest19.ps1 6, 11, 22, 25 ID Script Line Command Variable Action -- ------ ---- ------- -------- ------ @@ -367,7 +367,7 @@ Start by creating a line breakpoint on the first line of the Test.ps1 script in the current directory. ```powershell -PS C:\ps-test> Set-PSBreakpoint -line 1 -script test.ps1 +PS C:\ps-test> Set-PSBreakpoint -Line 1 -Script test.ps1 ``` The command returns a **System.Management.Automation.LineBreakpoint** object. @@ -482,7 +482,7 @@ reuse the breakpoint, use the `Disable-PsBreakpoint` cmdlet instead of `Remove-PsBreakpoint`.) ```powershell -PS C:\ps-test> Get-PSBreakpoint| Remove-PSBreakpoint +PS C:\ps-test> Get-PSBreakpoint | Remove-PSBreakpoint ``` You can abbreviate this command as: @@ -501,13 +501,13 @@ function delbr { gbp | rbp } Now, create a breakpoint on the `$scriptname` variable. ```powershell -PS C:\ps-test> Set-PSBreakpoint -variable scriptname -script test.ps1 +PS C:\ps-test> Set-PSBreakpoint -Variable scriptname -Script test.ps1 ``` You can abbreviate the command as: ```powershell -PS C:\ps-test> sbp -v scriptname -s test.ps1 +PS C:\ps-test> sbp -V scriptname -S test.ps1 ``` Now, start the script. The script reaches the variable breakpoint. The default @@ -557,8 +557,8 @@ Have you run a background job today (start-job)? test.ps1:13 "Done $scriptName" ``` -The `StepOver` command executes the function, and it previews the next statement -in the script, which prints the final line. +The `StepOver` command executes the function, and it previews the next +statement in the script, which prints the final line. Use a `Stop` command (`t`) to exit the debugger. The command prompt reverts to the standard command prompt. @@ -571,19 +571,19 @@ To delete the breakpoints, use the `Get-PsBreakpoint` and `Remove-PsBreakpoint` cmdlets. ```powershell -PS C:\ps-test> Get-PSBreakpoint| Remove-PSBreakpoint +PS C:\ps-test> Get-PSBreakpoint | Remove-PSBreakpoint ``` Create a new command breakpoint on the `psversion` function. ```powershell -PS C:\ps-test> Set-PSBreakpoint -command psversion -script test.ps1 +PS C:\ps-test> Set-PSBreakpoint -Command psversion -Script test.ps1 ``` You can abbreviate this command to: ```powershell -PS C:\ps-test> sbp -c psversion -s test.ps1 +PS C:\ps-test> sbp -C psversion -S test.ps1 ``` Now, run the script. @@ -612,7 +612,7 @@ Windows PowerShell 2.0 Have you run a background job today (start-job)? Done C:\ps-test\test.ps1 -PS C:\ps-test> Get-PSBreakpoint| Remove-PSBreakpoint +PS C:\ps-test> Get-PSBreakpoint | Remove-PSBreakpoint PS C:\ps-test> ``` @@ -623,9 +623,9 @@ the action, execution doesn't stop. The backtick (`` ` ``) is the line-continuation character. ```powershell -PS C:\ps-test> Set-PSBreakpoint -command psversion -script test.ps1 ` --action { add-content "The value of `$scriptName is $scriptName." ` --path action.log} +PS C:\ps-test> Set-PSBreakpoint -Command psversion -Script test.ps1 ` +-Action { Add-Content "The value of `$scriptName is $scriptName." ` +-Path action.log} ``` You can also add actions that set conditions for the breakpoint. In the @@ -634,8 +634,8 @@ policy is set to RemoteSigned, the most restrictive policy that still permits you to run scripts. ```powershell -PS C:\ps-test> Set-PSBreakpoint -script test.ps1 -command psversion ` --action { if ((Get-ExecutionPolicy) -eq "RemoteSigned") { break }} +PS C:\ps-test> Set-PSBreakpoint -Script test.ps1 -Command psversion ` +-Action { if ((Get-ExecutionPolicy) -eq "RemoteSigned") { break }} ``` The `break` keyword in the action directs the debugger to execute the @@ -700,7 +700,7 @@ features that you can use to debug scripts and functions. [01]: /powershell/scripting/dev-cross-plat/vscode/using-vscode#debugging-with-visual-studio-code -[02]: about_prompts.md +[02]: about_Prompts.md [05]: xref:Microsoft.PowerShell.Utility.Disable-PSBreakpoint [06]: xref:Microsoft.PowerShell.Utility.Enable-PSBreakpoint [07]: xref:Microsoft.PowerShell.Utility.Get-PSBreakpoint diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Environment_Provider.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Environment_Provider.md index aa17a4be1f23..bd33bfbdc571 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Environment_Provider.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Environment_Provider.md @@ -26,8 +26,8 @@ Provides access to the Windows environment variables. ## Detailed description -The PowerShell **Environment** provider lets you get, add, change, clear, and delete environment -variables and values in PowerShell. +The PowerShell **Environment** provider lets you get, add, change, clear, and +delete environment variables and values in PowerShell. **Environment** variables are dynamically named variables that describe the environment in which your programs run. Windows and PowerShell use environment @@ -42,19 +42,18 @@ have no child items. The **Environment** provider supports the following cmdlets, which are covered in this article. -- [Get-Location](xref:Microsoft.PowerShell.Management.Get-Location) -- [Set-Location](xref:Microsoft.PowerShell.Management.Set-Location) -- [Get-Item](xref:Microsoft.PowerShell.Management.Get-Item) -- [New-Item](xref:Microsoft.PowerShell.Management.New-Item) -- [Remove-Item](xref:Microsoft.PowerShell.Management.Remove-Item) -- [Clear-Item](xref:Microsoft.PowerShell.Management.Clear-Item) +- [Get-Location][01] +- [Set-Location][02] +- [Get-Item][03] +- [New-Item][04] +- [Remove-Item][05] +- [Clear-Item][06] ## Types exposed by this provider Each environment variable is an instance of the -[System.Collections.DictionaryEntry](/dotnet/api/system.collections.dictionaryentry) -class. The name of the variable is the dictionary key. The value of the -environment variable is the dictionary value. +[System.Collections.DictionaryEntry][07] class. The name of the variable is the +dictionary key. The value of the environment variable is the dictionary value. ## Navigating the Environment drive @@ -75,10 +74,11 @@ Set-Location C: ``` You can also work with the **Environment** provider from any other PowerShell -drive. To reference an environment variable from another location, use the drive name `Env:` in the path. +drive. To reference an environment variable from another location, use the +drive name `Env:` in the path. -The **Environment** provider also exposes environment variables using a variable -prefix of `$env:`. The following command views the contents of the +The **Environment** provider also exposes environment variables using a +variable prefix of `$env:`. The following command views the contents of the **ProgramFiles** environment variable. The `$env:` variable prefix can be used from any PowerShell drive. @@ -94,9 +94,8 @@ session for as long as it is active. > [!NOTE] > PowerShell uses aliases to allow you a familiar way to work with provider > paths. Commands such as `dir` and `ls` are now aliases for -> [Get-ChildItem](xref:Microsoft.PowerShell.Management.Get-ChildItem), -> `cd` is an alias for [Set-Location](xref:Microsoft.PowerShell.Management.Set-Location). and `pwd` is -> an alias for [Get-Location](xref:Microsoft.PowerShell.Management.Get-Location). +> [Get-ChildItem][08], `cd` is an alias for [Set-Location][02] and `pwd` is +> an alias for [Get-Location][01]. ## Getting environment variables @@ -203,8 +202,8 @@ Beginning in Windows PowerShell 3.0, you can get customized help topics for provider cmdlets that explain how those cmdlets behave in a file system drive. To get the help topics that are customized for the file system drive, run a -[Get-Help](xref:Microsoft.PowerShell.Core.Get-Help) command in a file system drive or use the `-Path` -parameter of [Get-Help](xref:Microsoft.PowerShell.Core.Get-Help) to specify a file system drive. +[Get-Help][09] command in a file system drive or use the `-Path` parameter of +[Get-Help][09] to specify a file system drive. ```powershell Get-Help Get-ChildItem @@ -216,4 +215,16 @@ Get-Help Get-ChildItem -Path env: ## See also -- [about_Providers](about_Providers.md) +- [about_Providers][10] + + +[01]: xref:Microsoft.PowerShell.Management.Get-Location +[02]: xref:Microsoft.PowerShell.Management.Set-Location +[03]: xref:Microsoft.PowerShell.Management.Get-Item +[04]: xref:Microsoft.PowerShell.Management.New-Item +[05]: xref:Microsoft.PowerShell.Management.Remove-Item +[06]: xref:Microsoft.PowerShell.Management.Clear-Item +[07]: /dotnet/api/system.collections.dictionaryentry +[08]: xref:Microsoft.PowerShell.Management.Get-ChildItem +[09]: xref:Microsoft.PowerShell.Core.Get-Help +[10]: about_Providers.md diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Environment_Variables.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Environment_Variables.md index e0408b87a5a2..234dd5274675 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Environment_Variables.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Environment_Variables.md @@ -542,7 +542,7 @@ or `NO_COLOR` environment variables. - `dumb` - sets `$Host.UI.SupportsVirtualTerminal = $false` - `xterm-mono` - sets `$PSStyle.OutputRendering = PlainText` - - `xtermm` - sets `$PSStyle.OutputRendering = PlainText` + - `xterm` - sets `$PSStyle.OutputRendering = PlainText` - `NO_COLOR` @@ -563,12 +563,12 @@ or `NO_COLOR` environment variables. [03]: #powershell-environment-variables [04]: about_Environment_Provider.md [05]: about_Execution_Policies.md -[06]: about_preference_variables.md -[07]: about_profiles.md +[06]: about_Preference_Variables.md +[07]: about_Profiles.md [08]: about_PSModulePath.md [09]: about_Telemetry.md [10]: about_Update_Notifications.md -[11]: about_variables.md +[11]: about_Variables.md [12]: https://no-color.org/ [13]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html [14]: xref:PowerShellGet.Install-Module diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Execution_Policies.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Execution_Policies.md index 2e38f921755d..c6bfaa9732a5 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Execution_Policies.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Execution_Policies.md @@ -87,9 +87,9 @@ execution policies are as follows: - The default execution policy for Windows client computers. - Permits individual commands, but does not allow scripts. - - Prevents running of all script files, including formatting and configuration - files (`.ps1xml`), module script files (`.psm1`), and PowerShell profiles - (`.ps1`). + - Prevents running of all script files, including formatting and + configuration files (`.ps1xml`), module script files (`.psm1`), and + PowerShell profiles (`.ps1`). - `Undefined` @@ -137,8 +137,8 @@ execution policies are as follows: The **Process** scope only affects the current PowerShell session. The execution policy is saved in the environment variable - `$env:PSExecutionPolicyPreference`, rather than the configuration file. When the - PowerShell session is closed, the variable and value are deleted. + `$env:PSExecutionPolicyPreference`, rather than the configuration file. When + the PowerShell session is closed, the variable and value are deleted. - CurrentUser @@ -201,12 +201,12 @@ To change the PowerShell execution policy on your Windows computer, use the need to restart PowerShell. If you set the execution policy for the scopes **LocalMachine** or the -**CurrentUser**, the change is saved in the configuration file and remains effective -until you change it again. +**CurrentUser**, the change is saved in the configuration file and remains +effective until you change it again. If you set the execution policy for the **Process** scope, it's not saved in -the configuration file. The execution policy is retained until the current process and -any child processes are closed. +the configuration file. The execution policy is retained until the current +process and any child processes are closed. > [!NOTE] > In Windows Vista and later versions of Windows, to run commands that @@ -280,15 +280,15 @@ For example: pwsh.exe -ExecutionPolicy AllSigned ``` -The execution policy that you set isn't stored in the configuration file. Instead, it's -stored in the `$env:PSExecutionPolicyPreference` environment variable. The -variable is deleted when you close the session in which the policy is set. You -cannot change the policy by editing the variable value. +The execution policy that you set isn't stored in the configuration file. +Instead, it's stored in the `$env:PSExecutionPolicyPreference` environment +variable. The variable is deleted when you close the session in which the +policy is set. You cannot change the policy by editing the variable value. During the session, the execution policy that is set for the session takes -precedence over an execution policy that is set in the configuration file for the local -computer or current user. However, it doesn't take precedence over the -execution policy set by using a Group Policy. +precedence over an execution policy that is set in the configuration file for +the local computer or current user. However, it doesn't take precedence over +the execution policy set by using a Group Policy. ## Use Group Policy to Manage Execution Policy @@ -359,8 +359,7 @@ Beginning in PowerShell 3.0, you can use the **Stream** parameter of the from the internet. Use the `Unblock-File` cmdlet to unblock the scripts so that you can run them in PowerShell. -For more information, see [about_Signing][04], -[Get-Item][05], and +For more information, see [about_Signing][04], [Get-Item][05], and [Unblock-File][08]. > [!NOTE] @@ -411,7 +410,7 @@ Zone check which avoids the problem. [01]: about_Environment_Variables.md [02]: about_Group_Policy_Settings.md -[03]: about_pwsh.md +[03]: about_Pwsh.md [04]: about_Signing.md [05]: xref:Microsoft.PowerShell.Management.Get-Item [06]: xref:Microsoft.PowerShell.Security.Get-ExecutionPolicy diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Experimental_Features.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Experimental_Features.md index acd2ed661dc3..9aba29cd0d1c 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Experimental_Features.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Experimental_Features.md @@ -125,8 +125,8 @@ public class InvokeWebRequestCommandV2 : WebCmdletBaseV2 { ... } public class InvokeWebRequestCommand : WebCmdletBase { ... } ``` -When the `MyWebCmdlets.PSWebCmdletV2` experimental feature is enabled, the existing -`InvokeWebRequestCommand` implementation is hidden and the +When the `MyWebCmdlets.PSWebCmdletV2` experimental feature is enabled, the +existing `InvokeWebRequestCommand` implementation is hidden and the `InvokeWebRequestCommandV2` provides the implementation of `Invoke-WebRequest`. diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md index 54e13e8de45f..64e10d4cc49f 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md @@ -547,9 +547,10 @@ non-hidden items. The **Hidden** parameter was introduced in Windows PowerShell 3.0. -To get only hidden items, use the **Hidden** parameter, its `h` or `ah` aliases, -or the **Hidden** value of the **Attributes** parameter. To exclude hidden -items, omit the **Hidden** parameter or use the **Attributes** parameter. +To get only hidden items, use the **Hidden** parameter, its `h` or `ah` +aliases, or the **Hidden** value of the **Attributes** parameter. To exclude +hidden items, omit the **Hidden** parameter or use the **Attributes** +parameter. #### Cmdlets supported @@ -681,7 +682,7 @@ Get-Help Get-ChildItem -Path c: - [about_Providers][08] - + [01]: /dotnet/api/system.datetime [02]: /dotnet/api/system.io.directoryinfo [03]: /dotnet/api/system.io.fileattributes diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_For.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_For.md index 9e3e2c077107..73ae31fc0bd2 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_For.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_For.md @@ -118,7 +118,7 @@ for (($i = 0), ($j = 0); $i -lt 10 -and $j -lt 10; $i++,$j++) } ``` -For more information, see [about_Logical_Operators](about_Logical_Operators.md). +For more information, see [about_Logical_Operators][01]. ### Syntax examples @@ -225,7 +225,7 @@ for ($i = 0; $i -le 20; $i += 2) The `For` loop can also be written on one line as in the following example. ```powershell -for ($i = 0; $i -lt 10; $i++) { Write-Host $i } +for ($i = 0; $i -lt 10; $i++){Write-Host $i} ``` ### Functional example @@ -356,7 +356,7 @@ properties: index. ```powershell -$paddedList = Get-ChildItem -path ./work_items +$paddedList = Get-ChildItem -Path ./work_items # Sort both file lists by name. $sortedOriginal = $fileList | Sort-Object -Property Name @@ -406,5 +406,10 @@ In the output, the sorted work items after padding are in the expected order. ## See also -- [about_Comparison_Operators](about_Comparison_Operators.md) -- [about_Foreach](about_Foreach.md) +- [about_Comparison_Operators][02] +- [about_Foreach][03] + + +[01]: about_Logical_Operators.md +[02]: about_Comparison_Operators.md +[03]: about_Foreach.md diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Foreach.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Foreach.md index 1c6e2c5c9a8c..9ef0ae1bed5e 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Foreach.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Foreach.md @@ -105,8 +105,8 @@ counts files over 100 KB in size: ```powershell $i = 0 foreach ($file in Get-ChildItem) { - if ($file.length -gt 100KB) { - Write-Host $file 'file size:' ($file.length / 1024).ToString('F0') KB + if ($file.Length -gt 100KB) { + Write-Host $file 'file size:' ($file.Length / 1024).ToString('F0') KB $i = $i + 1 } } @@ -128,7 +128,7 @@ display a count of files over 100KB. The previous example also demonstrates how to format the file length results: ```powershell -($file.length / 1024).ToString('F0') +($file.Length / 1024).ToString('F0') ``` The value is divided by 1,024 to show the results in kilobytes rather than diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Format.ps1xml.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Format.ps1xml.md index fc8f42d83dea..ad45211db7c3 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Format.ps1xml.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Format.ps1xml.md @@ -65,10 +65,9 @@ new objects, create your own `Format.ps1xml` files, and then add them to your PowerShell session. To create a `Format.ps1xml` file to define a custom view, use the -[Get-FormatData](xref:Microsoft.PowerShell.Utility.Get-FormatData) and -[Export-FormatData](xref:Microsoft.PowerShell.Utility.Export-FormatData) -cmdlets. Use a text editor to edit the file. The file can be saved to any -directory that PowerShell can access, such as a subdirectory of `$HOME`. +[Get-FormatData][01] and [Export-FormatData][02] cmdlets. Use a text editor to +edit the file. The file can be saved to any directory that PowerShell can +access, such as a subdirectory of `$HOME`. To change the formatting of a current view, locate the view in the formatting file, and then use the tags to change the view. To create a view for a new @@ -76,13 +75,12 @@ object type, create a new view, or use an existing view as a model. The tags are described in the next section. You can then delete all the other views in the file so that the changes are obvious to anyone examining the file. -After you save the changes, use the -[Update-FormatData](xref:Microsoft.PowerShell.Utility.Update-FormatData) to -add the new file to your PowerShell session. If you want your view to take -precedence over a view defined in the built-in files, use the **PrependPath** -parameter. `Update-FormatData` affects only the current session. To make the -change to all future sessions, add the `Update-FormatData` command to your -PowerShell profile. +After you save the changes, use the [Update-FormatData][03] to add the new file +to your PowerShell session. If you want your view to take precedence over a +view defined in the built-in files, use the **PrependPath** parameter. +`Update-FormatData` affects only the current session. To make the change to +all future sessions, add the `Update-FormatData` command to your PowerShell +profile. ### Example: Add calendar data to culture objects @@ -193,7 +191,7 @@ the current PowerShell session. This example uses the **PrependPath** parameter to place the new file in a higher precedence order than the original file. For more information, see -[Update-FormatData](xref:Microsoft.PowerShell.Utility.Update-FormatData). +[Update-FormatData][03]. ```powershell Update-FormatData -PrependPath $HOME\Format\CultureInfo.Format.ps1xml @@ -214,8 +212,8 @@ LCID Name Calendar DisplayName ## The XML in Format.ps1xml files -The full schema definition can be found in [Format.xsd](https://github.com/PowerShell/PowerShell/blob/master/src/Schemas/Format.xsd) -in the PowerShell source code repository on GitHub. +The full schema definition can be found in [Format.xsd][04] in the PowerShell +source code repository on GitHub. The **ViewDefinitions** section of each `Format.ps1xml` file contains the `` tags that define each view. A typical `` tag includes the @@ -284,9 +282,9 @@ The `` tag typically contains a `` tag. The contains one `` tag. A `` tag must include either a `` tag or a -`` tag. A `` tag specifies the property to display at -the specified location in the view. A `` tag specifies a script to -evaluate and display at the specified location in the view. +`` tag. A `` tag specifies the property to display +at the specified location in the view. A `` tag specifies a script +to evaluate and display at the specified location in the view. A `` tag can contain a `` tag that specifies how to display the property. @@ -309,15 +307,12 @@ value of the **Name** parameter: - FormatFileLoading - FormatViewBinding -For more information, see -[Trace-Command](xref:Microsoft.PowerShell.Utility.Trace-Command) and -[Get-TraceSource](xref:Microsoft.PowerShell.Utility.Get-TraceSource). +For more information, see [Trace-Command][05] and [Get-TraceSource][06]. ## Signing a Format.ps1xml file To protect the users of your `Format.ps1xml` file, sign the file using a -digital signature. For more information, see -[about_Signing](about_Signing.md). +digital signature. For more information, see [about_Signing][07]. ## Sample XML for a Format-Table custom view @@ -341,8 +336,7 @@ For this example, the custom view must use the table format, otherwise, Use `Format-Table` with the **View** parameter to specify the custom view's name, **mygciview**, and format the table's output with the **CreationTime** -column. For an example of how the command is run, see -[Format-Table](xref:Microsoft.PowerShell.Utility.Format-Table). +column. For an example of how the command is run, see [Format-Table][08]. > [!NOTE] > Although you can get the formatting XML from the source code to create a @@ -429,10 +423,22 @@ Update-FormatData -AppendPath ./Mygciview.Format.ps1xml ## See also -- [Trace-Command](xref:Microsoft.PowerShell.Utility.Trace-Command) -- [Export-FormatData](xref:Microsoft.PowerShell.Utility.Export-FormatData) -- [Get-FormatData](xref:Microsoft.PowerShell.Utility.Get-FormatData) -- [Update-FormatData](xref:Microsoft.PowerShell.Utility.Update-FormatData) -- [Get-TraceSource](xref:Microsoft.PowerShell.Utility.Get-TraceSource) -- [Format Schema XML Reference](/powershell/scripting/developer/format/format-schema-xml-reference) -- [Writing a PowerShell Formatting File](/powershell/scripting/developer/format/writing-a-powershell-formatting-file) +- [Trace-Command][05] +- [Export-FormatData][02] +- [Get-FormatData][01] +- [Update-FormatData][03] +- [Get-TraceSource][06] +- [Format Schema XML Reference][09] +- [Writing a PowerShell Formatting File][10] + + +[01]: xref:Microsoft.PowerShell.Utility.Get-FormatData +[02]: xref:Microsoft.PowerShell.Utility.Export-FormatData +[03]: xref:Microsoft.PowerShell.Utility.Update-FormatData +[04]: https://github.com/PowerShell/PowerShell/blob/master/src/Schemas/Format.xsd +[05]: xref:Microsoft.PowerShell.Utility.Trace-Command +[06]: xref:Microsoft.PowerShell.Utility.Get-TraceSource +[07]: about_Signing.md +[08]: xref:Microsoft.PowerShell.Utility.Format-Table +[09]: /powershell/scripting/developer/format/format-schema-xml-reference +[10]: /powershell/scripting/developer/format/writing-a-powershell-formatting-file diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Function_Provider.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Function_Provider.md index 0ce0be66aa66..1ec00fce3c22 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Function_Provider.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Function_Provider.md @@ -40,20 +40,18 @@ and filter objects. Neither functions nor filters have child items. The **Function** provider supports the following cmdlets, which are covered in this article. -- [Get-Location](xref:Microsoft.PowerShell.Management.Get-Location) -- [Set-Location](xref:Microsoft.PowerShell.Management.Set-Location) -- [Get-Item](xref:Microsoft.PowerShell.Management.Get-Item) -- [New-Item](xref:Microsoft.PowerShell.Management.New-Item) -- [Remove-Item](xref:Microsoft.PowerShell.Management.Remove-Item) -- [Clear-Item](xref:Microsoft.PowerShell.Management.Clear-Item) +- [Get-Location][01] +- [Set-Location][02] +- [Get-Item][03] +- [New-Item][04] +- [Remove-Item][05] +- [Clear-Item][06] ## Types exposed by this provider Each function is an instance of the -[System.Management.Automation.FunctionInfo](/dotnet/api/system.management.automation.functioninfo) -class. Each filter is an instance of the -[System.Management.Automation.FilterInfo](/dotnet/api/system.management.automation.filterinfo) -class. +[System.Management.Automation.FunctionInfo][07] class. Each filter is an +instance of the [System.Management.Automation.FilterInfo][08] class. ## Navigating the Function drive @@ -80,9 +78,8 @@ drive. To reference a function from another location, use the drive name > [!NOTE] > PowerShell uses aliases to allow you a familiar way to work with provider > paths. Commands such as `dir` and `ls` are now aliases for -> [Get-ChildItem](xref:Microsoft.PowerShell.Management.Get-ChildItem), -> `cd` is an alias for [Set-Location](xref:Microsoft.PowerShell.Management.Set-Location). and `pwd` is -> an alias for [Get-Location](xref:Microsoft.PowerShell.Management.Get-Location). +> [Get-ChildItem][09], `cd` is an alias for [Set-Location][10] and `pwd` is +> an alias for [Get-Location][01]. ## Getting functions @@ -223,9 +220,9 @@ Determines the value of the **Options** property of a function. ### Cmdlets supported -- [New-Item](xref:Microsoft.PowerShell.Management.New-Item) +- [New-Item][04] -- [Set-Item](xref:Microsoft.PowerShell.Management.Set-Item) +- [Set-Item][11] ## Using the pipeline @@ -240,8 +237,8 @@ Beginning in Windows PowerShell 3.0, you can get customized help topics for provider cmdlets that explain how those cmdlets behave in a file system drive. To get the help topics that are customized for the file system drive, run a -[Get-Help](xref:Microsoft.PowerShell.Core.Get-Help) command in a file system drive or use the `-Path` -parameter of [Get-Help](xref:Microsoft.PowerShell.Core.Get-Help) to specify a file system drive. +[Get-Help][12] command in a file system drive or use the `-Path` parameter of +[Get-Help][12] to specify a file system drive. ```powershell Get-Help Get-ChildItem @@ -253,5 +250,21 @@ Get-Help Get-ChildItem -Path function: ## See also -- [about_Functions](about_Functions.md) -- [about_Providers](about_Providers.md) +- [about_Functions][13] +- [about_Providers][14] + + +[01]: xref:Microsoft.PowerShell.Management.Get-Location +[02]: xref:Microsoft.PowerShell.Management.Set-Location +[03]: xref:Microsoft.PowerShell.Management.Get-Item +[04]: xref:Microsoft.PowerShell.Management.New-Item +[05]: xref:Microsoft.PowerShell.Management.Remove-Item +[06]: xref:Microsoft.PowerShell.Management.Clear-Item +[07]: /dotnet/api/system.management.automation.functioninfo +[08]: /dotnet/api/system.management.automation.filterinfo +[09]: xref:Microsoft.PowerShell.Management.Get-ChildItem +[10]: xref:Microsoft.PowerShell.Management.Set-Location +[11]: xref:Microsoft.PowerShell.Management.Set-Item +[12]: xref:Microsoft.PowerShell.Core.Get-Help +[13]: about_Functions.md +[14]: about_Providers.md diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions.md index 7c9ef0cf035d..cc50f3a9d15e 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions.md @@ -303,8 +303,8 @@ function Get-SmallFiles { } ``` -In the function, you can use the `$Size` variable, which is the name defined for -the parameter. +In the function, you can use the `$Size` variable, which is the name defined +for the parameter. To use this function, type the following command: @@ -494,7 +494,7 @@ function Get-Pipeline process {"The value is: $_"} } -1,2,4 | Get-Pipeline +1, 2, 4 | Get-Pipeline ``` ```Output @@ -527,9 +527,9 @@ function Get-SumOfNumbers { end { $retValue } } -PS> 1,2,3,4 | Get-SumOfNumbers +PS> 1, 2, 3, 4 | Get-SumOfNumbers 10 -PS> Get-SumOfNumbers 1,2,3,4 +PS> Get-SumOfNumbers 1, 2, 3, 4 10 ``` @@ -553,7 +553,7 @@ If this function is run using the pipeline, it displays the following results: ```powershell -1,2,4 | Get-PipelineBeginEnd +1, 2, 4 | Get-PipelineBeginEnd ``` ```Output @@ -582,7 +582,7 @@ object at a time. The `$input` automatic variable is empty when the function reaches the `end` keyword. ```powershell -1,2,4 | Get-PipelineInput +1, 2, 4 | Get-PipelineInput ``` ```Output @@ -771,7 +771,7 @@ You can write help for a function using either of the two following methods: [05]: about_Automatic_Variables.md [06]: about_Automatic_Variables.md#using-enumerators [07]: about_Comment_Based_Help.md -[08]: about_Function_provider.md +[08]: about_Function_Provider.md [09]: about_Functions_Advanced_Methods.md [10]: about_Functions_Advanced_Parameters.md [11]: about_Functions_Advanced.md diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Advanced.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Advanced.md index 6e3bd6324339..7b863880e940 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Advanced.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Advanced.md @@ -9,6 +9,7 @@ title: about_Functions_Advanced # about_Functions_Advanced ## Short description + Introduces advanced functions that are a way to create cmdlets using scripts. ## Long description @@ -45,7 +46,7 @@ function Send-Greeting [CmdletBinding()] param( [Parameter(Mandatory=$true)] - [string] $Name + [string]$Name ) process diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Methods.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Methods.md index e95bac57d805..50e9f5a0861d 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Methods.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Methods.md @@ -121,7 +121,7 @@ function Get-SumOfNumbers { end { $retValue } } -PS> Get-SumOfNumbers 1,2,3,4 +PS> Get-SumOfNumbers 1, 2, 3, 4 10 PS> 1,2,3,4 | Get-SumOfNumbers 10 diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md index 05e04bc46773..66e34b168001 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Advanced_Parameters.md @@ -585,7 +585,7 @@ function Test-Remainder { "${i}: $($Remaining[$i])" } } -Test-Remainder first one,two +Test-Remainder first one, two ``` ```Output @@ -1351,7 +1351,7 @@ This attribute was added in PowerShell 6.1.1. - [about_Functions_OutputTypeAttribute][13] -[01]: about_comment_based_help.md +[01]: about_Comment_Based_Help.md [02]: /dotnet/api/system.management.automation.runtimedefinedparameter [03]: /dotnet/standard/base-types/composite-formatting#composite-format-string [04]: /dotnet/standard/base-types/composite-formatting#format-string-component diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Argument_Completion.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Argument_Completion.md index c28e8040e61d..c23c30df4016 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Argument_Completion.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Functions_Argument_Completion.md @@ -40,8 +40,7 @@ example, the value of the **Fruit** parameter can only be **Apple**, Param( [Parameter(Mandatory=$true)] [ValidateSet('Apple', 'Banana', 'Pear')] - [string[]] - $Fruit + [string[]]$Fruit ) ``` @@ -51,7 +50,7 @@ be used on any variable, not just parameters. ```powershell [ValidateSet('Chocolate', 'Strawberry', 'Vanilla')] -[string]$flavor = 'Strawberry' +[string]$Flavor = 'Strawberry' ``` The validation occurs whenever that variable is assigned even within the diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md index 6da3f61dea38..2a98da8c8e13 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md @@ -93,7 +93,8 @@ User Configuration\ > These **PowerShell Core Administrative Templates** don't include settings > for Windows PowerShell. For more information about acquiring other templates > and configuring Group policy, see -> [How to create and manage the Central Store for Group Policy Administrative Templates in Windows][gpstore]. +> [How to create and manage the Central Store for Group Policy Administrative +> Templates in Windows][gpstore]. ## Console session configuration diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Hash_Tables.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Hash_Tables.md index 6ca1f9954947..962385dab3d3 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Hash_Tables.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Hash_Tables.md @@ -10,6 +10,7 @@ title: about_Hash_Tables # about_Hash_Tables ## Short description + Describes how to create, use, and sort hashtables in PowerShell. ## Long description @@ -314,9 +315,9 @@ member notation or array index notation. ### Handling property name collisions If the key name collides with one of the property names of the **HashTable** -type, you can use the **psbase** [intrinsic member](about_Intrinsic_Members.md) -to access those properties. For example, if the key name is `keys` and you want -to return the collection of the **HashTable** keys, use this syntax: +type, you can use the **psbase** [intrinsic member][01] to access those +properties. For example, if the key name is `keys` and you want to return the +collection of the **HashTable** keys, use this syntax: ```powershell $hashtable.psbase.Keys @@ -332,7 +333,7 @@ ways. Each of the examples in this section has identical output. They iterate over the `$hash` variable defined here: ```powershell -$hash = [ordered]@{ Number = 1; Shape = "Square"; Color = "Blue"} +$hash = [ordered]@{Number = 1; Shape = "Square"; Color = "Blue"} ``` > [!NOTE] @@ -476,7 +477,7 @@ Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName ------- ------ ----- ----- ----- ------ -- ----------- 441 24 54196 54012 571 5.10 1788 PowerShell -PS> $p.keys | ForEach-Object {$p.$_.handles} +PS> $p.Keys | ForEach-Object {$p.$_.Handles} 441 251 ``` @@ -504,7 +505,7 @@ PowerShell System.Diagnostics.Process (PowerShell) Notepad System.Diagnostics.Process (notepad) System.ServiceProcess.Servi... Running -PS> $p.keys +PS> $p.Keys PowerShell Notepad @@ -512,7 +513,7 @@ Status Name DisplayName ------ ---- ----------- Running winrm Windows Remote Management (WS-Manag... -PS> $p.keys | ForEach-Object {$_.name} +PS> $p.Keys | ForEach-Object {$_.Name} WinRM ``` @@ -605,7 +606,7 @@ The syntax is as follows: This method works only for classes that have a constructor that has no parameters. The object properties must be public and settable. -For more information, see [about_Object_Creation](about_Object_Creation.md). +For more information, see [about_Object_Creation][02]. ## ConvertFrom-StringData @@ -617,7 +618,7 @@ cmdlet safely in the Data section of a script, and you can use it with the Here-strings are especially useful when the values in the hashtable include quotation marks. For more information about here-strings, see -[about_Quoting_Rules](about_Quoting_Rules.md). +[about_Quoting_Rules][03]. The following example shows how to create a here-string of the user messages in the previous example and how to use `ConvertFrom-StringData` to convert them @@ -647,16 +648,25 @@ Msg2 She said, "Hello, World." Msg1 Type "Windows". ``` -For more information about here-strings, see -[about_Quoting_Rules](about_Quoting_Rules.md). +For more information about here-strings, see [about_Quoting_Rules][03]. ## See also -- [about_Arrays](about_Arrays.md) -- [about_Intrinsic_Members](about_Intrinsic_Members.md) -- [about_Object_Creation](about_Object_Creation.md) -- [about_Quoting_Rules](about_Quoting_Rules.md) -- [about_Script_Internationalization](about_Script_Internationalization.md) -- [Import-LocalizedData](xref:Microsoft.PowerShell.Utility.Import-LocalizedData) -- [ConvertFrom-StringData](xref:Microsoft.PowerShell.Utility.ConvertFrom-StringData) -- [System.Collections.Hashtable](/dotnet/api/system.collections.hashtable) +- [about_Arrays][04] +- [about_Intrinsic_Members][01] +- [about_Object_Creation][02] +- [about_Quoting_Rules][03] +- [about_Script_Internationalization][05] +- [Import-LocalizedData][06] +- [ConvertFrom-StringData][07] +- [System.Collections.Hashtable][08] + + +[01]: about_Intrinsic_Members.md +[02]: about_Object_Creation.md +[03]: about_Quoting_Rules.md +[04]: about_Arrays.md +[05]: about_Script_Internationalization.md +[06]: xref:Microsoft.PowerShell.Utility.Import-LocalizedData +[07]: xref:Microsoft.PowerShell.Utility.ConvertFrom-StringData +[08]: /dotnet/api/system.collections.hashtable diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Hidden.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Hidden.md index 3b5cc6dc0b51..13f8df42be5e 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Hidden.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Hidden.md @@ -17,9 +17,9 @@ Describes the `hidden` keyword, which hides class members from default When you use the `hidden` keyword in a script, you hide the members of a class by default. Hidden members do not display in the default results of the -`Get-Member` cmdlet, IntelliSense, or tab completion results. To display members -that you have hidden with the `hidden` keyword, add the **Force** parameter to a -`Get-Member` command. +`Get-Member` cmdlet, IntelliSense, or tab completion results. To display +members that you have hidden with the `hidden` keyword, add the **Force** +parameter to a `Get-Member` command. The `hidden` keyword can hide: @@ -48,11 +48,12 @@ PowerShell 5.0. ## EXAMPLE The following example shows how to use the `hidden` keyword in a class -definition. The **Car** class method, **Drive**, has a property, **rides**, that -does not need to be viewed or changed as it merely tallies the number of times -that **Drive** is called on the **Car** class. That metric that is not important -to users of the class (consider, for example, that when you are buying a car, -you do not ask the seller on how many drives the car has been taken). +definition. The **Car** class method, **Drive**, has a property, **rides**, +that does not need to be viewed or changed as it merely tallies the number of +times that **Drive** is called on the **Car** class. That metric that is not +important to users of the class (consider, for example, that when you are +buying a car, you do not ask the seller on how many drives the car has been +taken). Because there is little need for users of the class to change this property, we can hide the property from `Get-Member` and automatic completion results by @@ -114,8 +115,8 @@ ModelYear Property string ModelYear {get;set;} ``` Now, try running `Get-Member` again, but this time, add the `-Force` parameter. -Note that the results contain the hidden **rides** property, among other members -that are hidden by default. +Note that the results contain the hidden **rides** property, among other +members that are hidden by default. ```output PS C:\Windows\system32> $TestCar | Get-Member -Force diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_History.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_History.md index 2a8fed1da8aa..7192ccad0a80 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_History.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_History.md @@ -29,13 +29,13 @@ The PSReadLine history tracks the commands used in all PowerShell sessions. The history is written to a central file per host. That history file is available to all sessions and contains all past history. The history is not deleted when the session ends. Also, that history cannot be managed by the -`*-History` cmdlets. For more information, see -[about_PSReadLine](../../PSReadLine/About/about_PSReadLine.md). +`*-History` cmdlets. For more information, see [about_PSReadLine][01]. ## Using the built-in session history The built-in history only tracks the commands used in the current session. The -history is not available to other sessions and is deleted when the session ends. +history is not available to other sessions and is deleted when the session +ends. ### History Cmdlets @@ -72,7 +72,7 @@ command history. > module. PSReadLine loads automatically when you start a PowerShell session. > With PSReadLine loaded, F7 and F9 are not bound to any > function. PSReadLine does not provide equivalent functionality. For more -> information, see [about_PSReadLine](../../PSReadLine/About/about_PSReadLine.md). +> information, see [about_PSReadLine][01]. ### MaximumHistoryCount @@ -91,10 +91,10 @@ To apply the setting, restart PowerShell. To save the new variable value for all your PowerShell sessions, add the assignment statement to a PowerShell profile. For more information about -profiles, see [about_Profiles](about_Profiles.md). +profiles, see [about_Profiles][02]. For more information about the `$MaximumHistoryCount` preference variable, see -[about_Preference_Variables](about_Preference_Variables.md). +[about_Preference_Variables][03]. ### Order of Commands in the History @@ -106,8 +106,15 @@ completed only when you exit the prompt level. ## See also -- [about_Line_Editing](about_Line_Editing.md) -- [about_Preference_Variables](about_Preference_Variables.md) -- [about_Profiles](about_Profiles.md) -- [about_PSReadLine](../../PSReadLine/About/about_PSReadLine.md) -- [about_Variables](about_Variables.md) +- [about_Line_Editing][04] +- [about_Preference_Variables][03] +- [about_Profiles][02] +- [about_PSReadLine][01] +- [about_Variables][05] + + +[01]: ../../PSReadLine/About/about_PSReadLine.md +[02]: about_Profiles.md +[03]: about_Preference_Variables.md +[04]: about_Line_Editing.md +[05]: about_Variables.md diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Type_Accelerators.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Type_Accelerators.md index ed360f6203b8..38dd1f3a81b8 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Type_Accelerators.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Type_Accelerators.md @@ -1,30 +1,68 @@ --- -description: Describes the Type accelerators available for .NET framework classes +description: Describes the type accelerators available for .NET types. Locale: en-US -ms.date: 08/30/2023 +ms.date: 01/21/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_type_accelerators?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_Type_Accelerators --- # about_Type_Accelerators -## SHORT DESCRIPTION +## Short description -Describes the Type accelerators available for .NET framework classes +Describes the type accelerators available for .NET types. ## Long description -Type accelerators are aliases for .NET framework classes. They allow you to -access specific .NET framework classes without having to explicitly type the -entire class name. For example, you can shorten the **AliasAttribute** -class from `[System.Management.Automation.AliasAttribute]` to `[Alias]`. +Type accelerators are aliases for .NET types. They allow you to access specific +.NET types without explicitly using the full type name. For example, you can +shorten `[System.Management.Automation.AliasAttribute]` to `[Alias]`. -> [!NOTE] -> All type accelerators still need to be wrapped in square brackets(`[]`). +Type accelerator names are mostly lowercase, but some are defined using +Pascal-case. PowerShell is case-insensitive, so you can use either. -## Available Type Accelerators +## Using type accelerators -| Accelerator | Full Class Name | +For most type accelerators, you use type accelerators in the same way as +you would use the full type name. However, PowerShell has special handling for +the following two type accelerators: + +- `pscustomobject` - See [about_PSCustomObject](about_PSCustomObject.md) +- `ref` - See [about_Ref](about_Ref.md) + +Type accelerators are most commonly used to specify the type of a variable or +cast an object to a specific type. For those cases, you must enclose the type +name or its accelerator in square brackets (`[]`). For example, `[int]` or +`[int32]`. + +In some contexts, you can specify allow type accelerator name as a string. For +example: + +- When used with type comparison operators + + ```powershell + PS> '1' -as 'int' + 1 + PS> 1 -is 'int' + True + ``` + +- When used with `[type]` type class + + ```powershell + PS> [type]'int' + + IsPublic IsSerial Name BaseType + -------- -------- ---- -------- + True True Int32 System.ValueType + ``` + +In other contexts, like reflection, you must use the full type name as a string +rather than the type accelerator name. + +## Default type accelerators + +| Accelerator name | Full type name | | ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | | adsi | [System.DirectoryServices.DirectoryEntry](xref:System.DirectoryServices.DirectoryEntry) | | adsisearcher | [System.DirectoryServices.DirectorySearcher](xref:System.DirectoryServices.DirectorySearcher) | @@ -67,6 +105,7 @@ class from `[System.Management.Automation.AliasAttribute]` to `[Alias]`. | IPEndpoint | [System.Net.IPEndPoint](xref:System.Net.IPEndPoint) | | long | [System.Int64](xref:System.Int64) | | mailaddress | [System.Net.Mail.MailAddress](xref:System.Net.Mail.MailAddress) | +| NoRunspaceAffinity | [System.Management.Automation.Language.NoRunspaceAffinityAttribute](xref:System.Management.Automation.Language.NoRunspaceAffinityAttribute) | | NullString | [System.Management.Automation.Language.NullString](xref:System.Management.Automation.Language.NullString) | | ObjectSecurity | [System.Security.AccessControl.ObjectSecurity](xref:System.Security.AccessControl.ObjectSecurity) | | ordered | [System.Collections.Specialized.OrderedDictionary](xref:System.Collections.Specialized.OrderedDictionary) | @@ -116,6 +155,7 @@ class from `[System.Management.Automation.AliasAttribute]` to `[Alias]`. | ValidateLength | [System.Management.Automation.ValidateLengthAttribute](xref:System.Management.Automation.ValidateLengthAttribute) | | ValidateNotNull | [System.Management.Automation.ValidateNotNullAttribute](xref:System.Management.Automation.ValidateNotNullAttribute) | | ValidateNotNullOrEmpty | [System.Management.Automation.ValidateNotNullOrEmptyAttribute](xref:System.Management.Automation.ValidateNotNullOrEmptyAttribute) | +| ValidateNotNullOrWhiteSpace | [System.Management.Automation.ValidateNotNullOrWhiteSpaceAttribute](xref:System.Management.Automation.ValidateNotNullOrWhiteSpaceAttribute) | | ValidatePattern | [System.Management.Automation.ValidatePatternAttribute](xref:System.Management.Automation.ValidatePatternAttribute) | | ValidateRange | [System.Management.Automation.ValidateRangeAttribute](xref:System.Management.Automation.ValidateRangeAttribute) | | ValidateScript | [System.Management.Automation.ValidateScriptAttribute](xref:System.Management.Automation.ValidateScriptAttribute) | diff --git a/reference/7.6/CimCmdlets/Get-CimAssociatedInstance.md b/reference/7.6/CimCmdlets/Get-CimAssociatedInstance.md index dac584057ba6..be997fb179d9 100644 --- a/reference/7.6/CimCmdlets/Get-CimAssociatedInstance.md +++ b/reference/7.6/CimCmdlets/Get-CimAssociatedInstance.md @@ -332,6 +332,6 @@ This cmdlet is only available on Windows platforms. ## RELATED LINKS -[Get-CimClass](get-cimclass.md) +[Get-CimClass](Get-CimClass.md) -[Get-CimInstance](get-ciminstance.md) +[Get-CimInstance](Get-CimInstance.md) diff --git a/reference/7.6/CimCmdlets/Get-CimInstance.md b/reference/7.6/CimCmdlets/Get-CimInstance.md index 26a2b8d78b3a..7c2c9612eabd 100644 --- a/reference/7.6/CimCmdlets/Get-CimInstance.md +++ b/reference/7.6/CimCmdlets/Get-CimInstance.md @@ -144,7 +144,7 @@ the key property `@{ "Handle"=0 }` and stores it in a variable named `$x`. The v a CIM instance to the `Get-CimInstance` cmdlet to get a particular instance. ```powershell -$x = New-CimInstance -ClassName Win32_Process -Namespace root\cimv2 -Property @{ "Handle"=0 } -Key Handle -ClientOnly +$x = New-CimInstance -ClassName Win32_Process -Namespace root\cimv2 -Property @{"Handle"=0} -Key Handle -ClientOnly Get-CimInstance -CimInstance $x ``` @@ -156,7 +156,7 @@ the variables `$x` and `$y`. The variable `$x` is then formatted in a table cont ```powershell $x,$y = Get-CimInstance -ClassName Win32_Process -$x | Format-Table -Property Name,KernelModeTime -AutoSize +$x | Format-Table -Property Name, KernelModeTime -AutoSize ``` ```Output @@ -171,7 +171,7 @@ This example retrieves the CIM instances of a class named **Win32_ComputerSystem computers named **Server01** and **Server02**. ```powershell -Get-CimInstance -ClassName Win32_ComputerSystem -ComputerName Server01,Server02 +Get-CimInstance -ClassName Win32_ComputerSystem -ComputerName Server01, Server02 ``` ### Example 8: Getting only the key properties, instead of all properties @@ -190,8 +190,8 @@ This example retrieves only a subset of properties, which reduces the size of th traffic. ```powershell -Get-CimInstance -Class Win32_Process -Property Name,KernelModeTime -$x = Get-CimInstance -Class Win32_Process -Property Name,KernelModeTime +Get-CimInstance -Class Win32_Process -Property Name, KernelModeTime +$x = Get-CimInstance -Class Win32_Process -Property Name, KernelModeTime $x | Invoke-CimMethod -MethodName GetOwner ``` @@ -206,7 +206,7 @@ the variable are then passed to `Get-CimInstance` by using the **CimSession** pa CIM instances of the class named **Win32_ComputerSystem**. ```powershell -$s = New-CimSession -ComputerName Server01,Server02 +$s = New-CimSession -ComputerName Server01, Server02 Get-CimInstance -ClassName Win32_ComputerSystem -CimSession $s ``` @@ -216,7 +216,8 @@ Get-CimInstance -ClassName Win32_ComputerSystem -CimSession $s Specifies the CIM session to use for this cmdlet. Enter a variable that contains the CIM session or a command that creates or gets the CIM session, such as the `New-CimSession` or `Get-CimSession` -cmdlets. For more information, see [about_CimSession](../Microsoft.PowerShell.Core/About/about_CimSession.md). +cmdlets. For more information, see +[about_CimSession](../Microsoft.PowerShell.Core/About/about_CimSession.md). ```yaml Type: Microsoft.Management.Infrastructure.CimSession[] @@ -322,8 +323,8 @@ Accept wildcard characters: False Indicates that only objects with key properties populated are returned. Specifying the **KeyOnly** parameter reduces the amount of data transferred over the network. -Use the **KeyOnly** parameter to return only a small portion of the object, which can be used for other -operations, such as the `Set-CimInstance` or `Get-CimAssociatedInstance` cmdlets. +Use the **KeyOnly** parameter to return only a small portion of the object, which can be used for +other operations, such as the `Set-CimInstance` or `Get-CimAssociatedInstance` cmdlets. ```yaml Type: System.Management.Automation.SwitchParameter @@ -497,7 +498,8 @@ Accept wildcard characters: False This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, --WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS @@ -523,18 +525,18 @@ This cmdlet is only available on Windows platforms. ## RELATED LINKS -[Format-Table](../microsoft.powershell.utility/format-table.md) +[Format-Table](../Microsoft.Powershell.Utility/Format-Table.md) [Get-CimAssociatedInstance](Get-CimAssociatedInstance.md) [Get-CimClass](Get-CimClass.md) -[Invoke-CimMethod](invoke-cimmethod.md) +[Invoke-CimMethod](Invoke-CimMethod.md) [New-CimInstance](New-CimInstance.md) [Register-CimIndicationEvent](Register-CimIndicationEvent.md) -[Remove-CimInstance](remove-ciminstance.md) +[Remove-CimInstance](Remove-CimInstance.md) [Set-CimInstance](Set-CimInstance.md) diff --git a/reference/7.6/CimCmdlets/Get-CimSession.md b/reference/7.6/CimCmdlets/Get-CimSession.md index 09be413b56ab..3d85f2b62b4a 100644 --- a/reference/7.6/CimCmdlets/Get-CimSession.md +++ b/reference/7.6/CimCmdlets/Get-CimSession.md @@ -48,7 +48,8 @@ can use the parameters of `Get-CimSession` to get the sessions that are for part you can identify sessions by their names or other identifiers. `Get-CimSession` does not get CIM sessions that were created in other PowerShell sessions or that were created on other computers. -For more information about CIM sessions, see [about_CimSession](../Microsoft.PowerShell.Core/About/about_CimSession.md). +For more information about CIM sessions, see +[about_CimSession](../Microsoft.PowerShell.Core/About/about_CimSession.md). ## EXAMPLES @@ -58,7 +59,7 @@ This example creates CIM sessions using [New-CimSession](New-CimSession.md), and sessions using `Get-CimSession`. ```powershell -New-CimSession -ComputerName Server01,Server02 +New-CimSession -ComputerName Server01, Server02 Get-CimSession ``` @@ -98,7 +99,7 @@ This example gets all CIM sessions in the current PowerShell session and display only the **ComputerName** and **InstanceID** properties. ```powershell -Get-CimSession | Format-Table -Property ComputerName,InstanceId +Get-CimSession | Format-Table -Property ComputerName, InstanceId ``` ```Output @@ -171,7 +172,8 @@ Specifies the identifier of the CIM session to get. For multiple IDs, use commas or use the range operator (`..`) to specify a range of IDs. An **Id** is an integer that uniquely identifies the CIM session within the current PowerShell session. -For more information about the range operator, see [about_Operators](../Microsoft.PowerShell.Core/About/about_Operators.md). +For more information about the range operator, see +[about_Operators](../Microsoft.PowerShell.Core/About/about_Operators.md). ```yaml Type: System.UInt32[] @@ -254,10 +256,10 @@ This cmdlet is only available on Windows platforms. ## RELATED LINKS -[Format-Table](../microsoft.powershell.utility/format-table.md) +[Format-Table](../Microsoft.Powershell.Utility/Format-Table.md) [New-CimSession](New-CimSession.md) -[Remove-CimSession](remove-cimsession.md) +[Remove-CimSession](Remove-CimSession.md) [about_CimSession](../Microsoft.PowerShell.Core/About/about_CimSession.md) diff --git a/reference/7.6/CimCmdlets/Invoke-CimMethod.md b/reference/7.6/CimCmdlets/Invoke-CimMethod.md index 31c9178dd75a..6de5e28fb553 100644 --- a/reference/7.6/CimCmdlets/Invoke-CimMethod.md +++ b/reference/7.6/CimCmdlets/Invoke-CimMethod.md @@ -155,7 +155,7 @@ to `Invoke-CimMethod`. ```powershell $c = Get-CimClass -ClassName Win32_Process -Invoke-CimMethod -CimClass $c -MethodName "xyz" -Arguments @{ CommandLine = 'notepad.exe' } +Invoke-CimMethod -CimClass $c -MethodName "xyz" -Arguments @{CommandLine='notepad.exe'} ``` ## PARAMETERS @@ -476,9 +476,9 @@ This cmdlet is only available on Windows platforms. ## RELATED LINKS -[Get-CimClass](get-cimclass.md) +[Get-CimClass](Get-CimClass.md) -[Get-CimInstance](get-ciminstance.md) +[Get-CimInstance](Get-CimInstance.md) [Get-CimSession](Get-CimSession.md) diff --git a/reference/7.6/CimCmdlets/New-CimInstance.md b/reference/7.6/CimCmdlets/New-CimInstance.md index cc03c86ef4a0..042918d72400 100644 --- a/reference/7.6/CimCmdlets/New-CimInstance.md +++ b/reference/7.6/CimCmdlets/New-CimInstance.md @@ -277,10 +277,10 @@ Accept wildcard characters: False Specifies the amount of time that the cmdlet waits for a response from the CIM server. By default, the value of this parameter is 0, which means that the cmdlet uses the default timeout value for the -server. If the **OperationTimeoutSec** parameter is set to a value less than the robust connection retry -timeout of 3 minutes, network failures that last more than the value of the **OperationTimeoutSec** -parameter are not recoverable, because the operation on the server times out before the client can -reconnect. +server. If the **OperationTimeoutSec** parameter is set to a value less than the robust connection +retry timeout of 3 minutes, network failures that last more than the value of the +**OperationTimeoutSec** parameter are not recoverable, because the operation on the server times +out before the client can reconnect. ```yaml Type: System.UInt32 @@ -412,10 +412,10 @@ This cmdlet is only available on Windows platforms. ## RELATED LINKS -[Get-CimClass](get-cimclass.md) +[Get-CimClass](Get-CimClass.md) -[Get-CimInstance](get-ciminstance.md) +[Get-CimInstance](Get-CimInstance.md) -[Remove-CimInstance](remove-ciminstance.md) +[Remove-CimInstance](Remove-CimInstance.md) [Set-CimInstance](Set-CimInstance.md) diff --git a/reference/7.6/CimCmdlets/New-CimSession.md b/reference/7.6/CimCmdlets/New-CimSession.md index f28d94f87161..3e60357a9505 100644 --- a/reference/7.6/CimCmdlets/New-CimSession.md +++ b/reference/7.6/CimCmdlets/New-CimSession.md @@ -10,7 +10,6 @@ title: New-CimSession # New-CimSession ## SYNOPSIS - Creates a CIM session. ## SYNTAX @@ -68,7 +67,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 @@ -77,7 +76,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* ``` @@ -130,9 +129,9 @@ parameter are: - NtlmDomain - CredSsp -You cannot use the **NtlmDomain** authentication type for connection to the local computer. **CredSSP** -authentication is available only in Windows Vista, Windows Server 2008, and later versions of -Windows. +You cannot use the **NtlmDomain** authentication type for connection to the local computer. +**CredSSP** authentication is available only in Windows Vista, Windows Server 2008, and later +versions of Windows. > [!CAUTION] > Credential Security Service Provider (CredSSP) authentication is designed for commands that @@ -166,7 +165,8 @@ To get a certificate thumbprint, use the [`Get-ChildItem`](../Microsoft.Powershell.Management/Get-ChildItem.md) cmdlets in the PowerShell Certificate Provider. -For more information, see [about_Certificate_Provider](../Microsoft.PowerShell.Security/About/about_Certificate_Provider.md). +For more information, see +[about_Certificate_Provider](../Microsoft.PowerShell.Security/About/about_Certificate_Provider.md). ```yaml Type: System.String @@ -217,7 +217,8 @@ Specify the value for **Credential** using one of the following formats: - A user name: "User01" - A domain name and a user name: "Domain01\User01" - A user principal name: "User@Domain.com" -- A PSCredential object, such as one returned by the [`Get-Credential`](../Microsoft.PowerShell.Security/Get-Credential.md) cmdlet. +- A PSCredential object, such as one returned by the + [`Get-Credential`](../Microsoft.PowerShell.Security/Get-Credential.md) cmdlet. When you type a user name, you are prompted for a password. @@ -237,8 +238,9 @@ 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. +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. ```yaml Type: System.String diff --git a/reference/7.6/CimCmdlets/New-CimSessionOption.md b/reference/7.6/CimCmdlets/New-CimSessionOption.md index d22cecd91baf..81107a1f5d0b 100644 --- a/reference/7.6/CimCmdlets/New-CimSessionOption.md +++ b/reference/7.6/CimCmdlets/New-CimSessionOption.md @@ -95,7 +95,8 @@ parameter using one of the following formats: - A culture name in `-` format such as "EN-US". - A variable that contains a **CultureInfo** object. -- A command that gets a **CultureInfo** object, such as [Get-Culture](../Microsoft.PowerShell.Utility/Get-Culture.md) +- A command that gets a **CultureInfo** object, such as + [Get-Culture](../Microsoft.PowerShell.Utility/Get-Culture.md) ```yaml Type: System.Globalization.CultureInfo @@ -488,12 +489,12 @@ This cmdlet is only available on Windows platforms. ## RELATED LINKS -[Get-ChildItem](../microsoft.powershell.management/get-childitem.md) +[Get-ChildItem](../Microsoft.Powershell.Management/Get-ChildItem.md) -[Get-Credential](../microsoft.powershell.security/get-credential.md) +[Get-Credential](../Microsoft.Powershell.Security/Get-Credential.md) -[Get-Culture](../microsoft.powershell.utility/get-culture.md) +[Get-Culture](../Microsoft.Powershell.Utility/Get-Culture.md) -[Get-Item](../microsoft.powershell.management/get-item.md) +[Get-Item](../Microsoft.Powershell.Management/Get-Item.md) [New-CimSession](New-CimSession.md) diff --git a/reference/7.6/CimCmdlets/Register-CimIndicationEvent.md b/reference/7.6/CimCmdlets/Register-CimIndicationEvent.md index d9f5c673860e..5b23f3048e27 100644 --- a/reference/7.6/CimCmdlets/Register-CimIndicationEvent.md +++ b/reference/7.6/CimCmdlets/Register-CimIndicationEvent.md @@ -98,13 +98,13 @@ script block for **Action**, which uses the `$event` variable to access the even $action = { $name = $event.SourceEventArgs.NewEvent.ProcessName $id = $event.SourceEventArgs.NewEvent.ProcessId - Write-Host -Object "New Process Started : Name = $name - ID = $id" + Write-Host -Object "New Process Started : Name = $name ID = $id" } Register-CimIndicationEvent -ClassName 'Win32_ProcessStartTrace' -SourceIdentifier "ProcessStarted" -Action $action ``` -For more information, see [Win32_ProcessStartTrace](/previous-versions/windows/desktop/krnlprov/win32-processstarttrace). +For more information, see +[Win32_ProcessStartTrace](/previous-versions/windows/desktop/krnlprov/win32-processstarttrace). ### Example 4: Register the events on a remote computer @@ -399,13 +399,13 @@ This cmdlet is only available on Windows platforms. ## RELATED LINKS -[Get-Event](../microsoft.powershell.utility/get-event.md) +[Get-Event](../Microsoft.Powershell.Utility/Get-Event.md) -[Remove-Event](../microsoft.powershell.utility/remove-event.md) +[Remove-Event](../Microsoft.Powershell.Utility/Remove-Event.md) -[Unregister-Event](../microsoft.powershell.utility/unregister-event.md) +[Unregister-Event](../Microsoft.Powershell.Utility/Unregister-Event.md) -[Write-Host](../microsoft.powershell.utility/write-host.md) +[Write-Host](../Microsoft.Powershell.Utility/Write-Host.md) [Get-CimSession](Get-CimSession.md) diff --git a/reference/7.6/CimCmdlets/Remove-CimInstance.md b/reference/7.6/CimCmdlets/Remove-CimInstance.md index 1fab959caee1..f52e154ace1b 100644 --- a/reference/7.6/CimCmdlets/Remove-CimInstance.md +++ b/reference/7.6/CimCmdlets/Remove-CimInstance.md @@ -329,6 +329,6 @@ This cmdlet is only available on Windows platforms. [New-CimInstance](New-CimInstance.md) -[Get-CimInstance](get-ciminstance.md) +[Get-CimInstance](Get-CimInstance.md) [Set-CimInstance](Set-CimInstance.md) diff --git a/reference/7.6/CimCmdlets/Remove-CimSession.md b/reference/7.6/CimCmdlets/Remove-CimSession.md index f4ab40c1309c..c6af97137647 100644 --- a/reference/7.6/CimCmdlets/Remove-CimSession.md +++ b/reference/7.6/CimCmdlets/Remove-CimSession.md @@ -126,7 +126,8 @@ Specifies the ID of the CIM session to remove. Specify one or more IDs separated the range operator (`..`) to specify a range of IDs. An **Id** is an integer that uniquely identifies the CIM session in the current PowerShell session. -For more information about the range operator, see [about_Operators](../Microsoft.PowerShell.Core/About/about_Operators.md). +For more information about the range operator, see +[about_Operators](../Microsoft.PowerShell.Core/About/about_Operators.md). ```yaml Type: System.UInt32[] @@ -146,7 +147,8 @@ Specifies the instance ID of the CIM session to remove. **InstanceId** is a Glob Identifier (GUID) that uniquely identifies a CIM session. The **InstanceId** is unique, even when you have multiple sessions running in PowerShell. -The **InstanceId** is stored in the **InstanceId** property of the object that represents a CIM session. +The **InstanceId** is stored in the **InstanceId** property of the object that represents a CIM +session. ```yaml Type: System.Guid[] diff --git a/reference/7.6/CimCmdlets/Set-CimInstance.md b/reference/7.6/CimCmdlets/Set-CimInstance.md index b405916e3e7a..6566f790ce30 100644 --- a/reference/7.6/CimCmdlets/Set-CimInstance.md +++ b/reference/7.6/CimCmdlets/Set-CimInstance.md @@ -143,7 +143,7 @@ cmdlet, and retrieves its contents in to a variable `$x`. The variable is then p Because the **PassThru** parameter is used, This example returns a modified CIM instance object. ```powershell -$x = New-CimInstance -ClassName Win32_Environment -Property @{Name="testvar";UserName="domain\user"} -Key Name,UserName -ClientOnly +$x = New-CimInstance -ClassName Win32_Environment -Property @{Name="testvar";UserName="domain\user"} -Key Name, UserName -ClientOnly Set-CimInstance -CimInstance $x -Property @{VariableValue="somevalue"} -PassThru ``` @@ -424,8 +424,8 @@ This cmdlet is only available on Windows platforms. ## RELATED LINKS -[Get-CimInstance](get-ciminstance.md) +[Get-CimInstance](Get-CimInstance.md) [New-CimInstance](New-CimInstance.md) -[Remove-CimInstance](remove-ciminstance.md) +[Remove-CimInstance](Remove-CimInstance.md) diff --git a/reference/7.6/Microsoft.PowerShell.Archive/Expand-Archive.md b/reference/7.6/Microsoft.PowerShell.Archive/Expand-Archive.md index 09f8166113e9..b8475a354012 100644 --- a/reference/7.6/Microsoft.PowerShell.Archive/Expand-Archive.md +++ b/reference/7.6/Microsoft.PowerShell.Archive/Expand-Archive.md @@ -210,4 +210,4 @@ different than the source filename stored in the archive. ## RELATED LINKS -[Compress-Archive](compress-archive.md) +[Compress-Archive](Compress-Archive.md) diff --git a/reference/7.6/Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.md b/reference/7.6/Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.md index 42eef7fd68ab..59197dba7067 100644 --- a/reference/7.6/Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.md +++ b/reference/7.6/Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.md @@ -13,7 +13,9 @@ title: Microsoft.PowerShell.Archive ## Description -This section contains the help topics for the cmdlets that are installed with the PowerShell Microsoft.PowerShell.Archive module. The Archive module contains cmdlets that let you create and extract archive or ZIP files. +This section contains the help topics for the cmdlets that are installed with the PowerShell +Microsoft.PowerShell.Archive module. The Archive module contains cmdlets that let you create and +extract archive or ZIP files. ## Microsoft.PowerShell.Archive Cmdlets diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/About.md b/reference/7.6/Microsoft.PowerShell.Core/About/About.md index f88e8083564b..2cc0b52b0a63 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/About.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/About.md @@ -2,7 +2,7 @@ description: About topics cover a range of concepts about PowerShell. Help Version: 7.6.0.0 Locale: en-US -ms.date: 01/14/2025 +ms.date: 01/21/2025 title: About topics --- # About topics @@ -601,7 +601,7 @@ terminating errors. ### [about_Type_Accelerators](about_Type_Accelerators.md) -Describes the Type accelerators available for .NET framework classes +Describes the Type accelerators available for .NET types. ### [about_Type_Conversion](about_Type_Conversion.md) diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Classes_Properties.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Classes_Properties.md index 3a2df6bcda1d..c0571948a703 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Classes_Properties.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Classes_Properties.md @@ -1,7 +1,7 @@ --- description: Describes how to define properties for PowerShell classes. Locale: en-US -ms.date: 11/13/2023 +ms.date: 01/21/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_classes_properties?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_Classes_Properties @@ -523,7 +523,8 @@ properties: > [!IMPORTANT] > Static properties for classes defined in PowerShell aren't immutable. They -> can +> can be overridden to any valid value, as defined by the static property's +> type and attributes. ## Derived class properties diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Type_Accelerators.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Type_Accelerators.md index b913dccac3dd..ff6b2c6c9505 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Type_Accelerators.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Type_Accelerators.md @@ -1,30 +1,68 @@ --- -description: Describes the Type accelerators available for .NET framework classes +description: Describes the type accelerators available for .NET types. Locale: en-US -ms.date: 08/30/2023 +ms.date: 01/21/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_type_accelerators?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_Type_Accelerators --- # about_Type_Accelerators -## SHORT DESCRIPTION +## Short description -Describes the Type accelerators available for .NET framework classes +Describes the type accelerators available for .NET types. ## Long description -Type accelerators are aliases for .NET framework classes. They allow you to -access specific .NET framework classes without having to explicitly type the -entire class name. For example, you can shorten the **AliasAttribute** -class from `[System.Management.Automation.AliasAttribute]` to `[Alias]`. +Type accelerators are aliases for .NET types. They allow you to access specific +.NET types without explicitly using the full type name. For example, you can +shorten `[System.Management.Automation.AliasAttribute]` to `[Alias]`. -> [!NOTE] -> All type accelerators still need to be wrapped in square brackets(`[]`). +Type accelerator names are mostly lowercase, but some are defined using +Pascal-case. PowerShell is case-insensitive, so you can use either. -## Available Type Accelerators +## Using type accelerators -| Accelerator | Full Class Name | +For most type accelerators, you use type accelerators in the same way as +you would use the full type name. However, PowerShell has special handling for +the following two type accelerators: + +- `pscustomobject` - See [about_PSCustomObject](about_PSCustomObject.md) +- `ref` - See [about_Ref](about_Ref.md) + +Type accelerators are most commonly used to specify the type of a variable or +cast an object to a specific type. For those cases, you must enclose the type +name or its accelerator in square brackets (`[]`). For example, `[int]` or +`[int32]`. + +In some contexts, you can specify allow type accelerator name as a string. For +example: + +- When used with type comparison operators + + ```powershell + PS> '1' -as 'int' + 1 + PS> 1 -is 'int' + True + ``` + +- When used with `[type]` type class + + ```powershell + PS> [type]'int' + + IsPublic IsSerial Name BaseType + -------- -------- ---- -------- + True True Int32 System.ValueType + ``` + +In other contexts, like reflection, you must use the full type name as a string +rather than the type accelerator name. + +## Default type accelerators + +| Accelerator name | Full type name | | ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | | adsi | [System.DirectoryServices.DirectoryEntry](xref:System.DirectoryServices.DirectoryEntry) | | adsisearcher | [System.DirectoryServices.DirectorySearcher](xref:System.DirectoryServices.DirectorySearcher) | @@ -67,6 +105,7 @@ class from `[System.Management.Automation.AliasAttribute]` to `[Alias]`. | IPEndpoint | [System.Net.IPEndPoint](xref:System.Net.IPEndPoint) | | long | [System.Int64](xref:System.Int64) | | mailaddress | [System.Net.Mail.MailAddress](xref:System.Net.Mail.MailAddress) | +| NoRunspaceAffinity | [System.Management.Automation.Language.NoRunspaceAffinityAttribute](xref:System.Management.Automation.Language.NoRunspaceAffinityAttribute) | | NullString | [System.Management.Automation.Language.NullString](xref:System.Management.Automation.Language.NullString) | | ObjectSecurity | [System.Security.AccessControl.ObjectSecurity](xref:System.Security.AccessControl.ObjectSecurity) | | ordered | [System.Collections.Specialized.OrderedDictionary](xref:System.Collections.Specialized.OrderedDictionary) | @@ -116,6 +155,7 @@ class from `[System.Management.Automation.AliasAttribute]` to `[Alias]`. | ValidateLength | [System.Management.Automation.ValidateLengthAttribute](xref:System.Management.Automation.ValidateLengthAttribute) | | ValidateNotNull | [System.Management.Automation.ValidateNotNullAttribute](xref:System.Management.Automation.ValidateNotNullAttribute) | | ValidateNotNullOrEmpty | [System.Management.Automation.ValidateNotNullOrEmptyAttribute](xref:System.Management.Automation.ValidateNotNullOrEmptyAttribute) | +| ValidateNotNullOrWhiteSpace | [System.Management.Automation.ValidateNotNullOrWhiteSpaceAttribute](xref:System.Management.Automation.ValidateNotNullOrWhiteSpaceAttribute) | | ValidatePattern | [System.Management.Automation.ValidatePatternAttribute](xref:System.Management.Automation.ValidatePatternAttribute) | | ValidateRange | [System.Management.Automation.ValidateRangeAttribute](xref:System.Management.Automation.ValidateRangeAttribute) | | ValidateScript | [System.Management.Automation.ValidateScriptAttribute](xref:System.Management.Automation.ValidateScriptAttribute) |