diff --git a/reference/5.1/ISE/Get-IseSnippet.md b/reference/5.1/ISE/Get-IseSnippet.md index e86da9673ef9..8e0853d00802 100644 --- a/reference/5.1/ISE/Get-IseSnippet.md +++ b/reference/5.1/ISE/Get-IseSnippet.md @@ -71,7 +71,7 @@ function Parse-Snippet { foreach ($SnippetFile in $SnippetFiles) { Write-Host "" $Title = Select-Xml -Path $SnippetFile.FullName -Namespace $SnippetNamespace -XPath "//x:Title" | - ForEach-Object {$_.Node.InnerXML} + ForEach-Object {$_.Node.InnerXml} $Text = Select-Xml -Path $SnippetFile.FullName -Namespace $SnippetNamespace -XPath "//x:Script" | ForEach-Object {$_.Node.InnerText} Write-Host "Title: $Title" @@ -83,10 +83,10 @@ function Parse-Snippet { ```Output Title: Mandatory Text: -Param +param ( - [parameter(Mandatory=True)] - [String[]] + [Parameter(Mandatory=True)] + [string[]] $ ) @@ -138,7 +138,7 @@ This cmdlet returns a file object representing the snippet file. ## NOTES -- The `New-IseSnippet` cmdlet stores new user-created snippets in unsigned .ps1xml files. As such, +- The `New-IseSnippet` cmdlet stores new user-created snippets in unsigned `.ps1xml` files. As such, Windows PowerShell cannot add them to a session in which the execution policy is **AllSigned** or **Restricted**. In a **Restricted** or **AllSigned** session, you can create, get, and import unsigned user-created snippets, but you cannot use them in the session. diff --git a/reference/5.1/ISE/Import-IseSnippet.md b/reference/5.1/ISE/Import-IseSnippet.md index 79a6891690f1..146e165cdef9 100644 --- a/reference/5.1/ISE/Import-IseSnippet.md +++ b/reference/5.1/ISE/Import-IseSnippet.md @@ -38,7 +38,7 @@ Snippets** or press Ctrl+J. Imported snippets are available only in the current session. To import the snippets into all Windows PowerShell ISE sessions, add an `Import-IseSnippet` command to your Windows PowerShell profile or copy the snippet files to your local snippets directory -`$HOME\Documents\WindowsPowershell\Snippets`. +`$HOME\Documents\WindowsPowerShell\Snippets`. To import snippets, they must be properly formatted in the snippet XML for Windows PowerShell ISE snippets and saved in Snippet.ps1xml files. To create eligible snippets, use the `New-IseSnippet` @@ -78,9 +78,9 @@ Import-IseSnippet -Module SnippetModule -ListAvailable This example gets snippets in all installed modules in the **PSModulePath** environment variable. ```powershell -($env:PSModulePath).split(";") | +($Env:PSModulePath).Split(";") | ForEach-Object {dir $_\*\Snippets\*.Snippets.ps1xml -ErrorAction SilentlyContinue} | - ForEach-Object {$_.Fullname} + ForEach-Object {$_.FullName} ``` ### Example 4: Import all module snippets @@ -90,7 +90,7 @@ you don't need to run a command like this because modules that have snippets wil `Import-IseSnippet` cmdlet to import them for you when the module is imported. ```powershell -($env:PSModulePath).split(";") | +($Env:PSModulePath).Split(";") | ForEach-Object {dir $_\*\Snippets\*.Snippets.ps1xml -ErrorAction SilentlyContinue} | ForEach-Object {$psISE.CurrentPowerShellTab.Snippets.Load($_)} ``` @@ -102,7 +102,7 @@ the current user. Unlike imported snippets, which affect only the current sessio are available in every Windows PowerShell ISE session. ```powershell -($env:PSModulePath).split(";") | +($Env:PSModulePath).Split(";") | ForEach-Object {dir $_\*\Snippets\*.Snippets.ps1xml -ErrorAction SilentlyContinue} | Copy-Item -Destination $HOME\Documents\WindowsPowerShell\Snippets ``` @@ -215,7 +215,7 @@ This cmdlet returns no output. **Microsoft.PowerShell.Host.ISE.ISESnippetCollection** objects. You can also use the **Load** method of snippets in the Windows PowerShell ISE object model: `$psISE.CurrentPowerShellTab.Snippets.Load()` -- The `New-IseSnippet` cmdlet stores new user-created snippets in unsigned .ps1xml files. As such, +- The `New-IseSnippet` cmdlet stores new user-created snippets in unsigned `.ps1xml` files. As such, Windows PowerShell cannot load them into a session in which the execution policy is **AllSigned** or **Restricted**. In a **Restricted** or **AllSigned** session, you can create, get, and import unsigned user-created snippets, but you cannot use them in the session. diff --git a/reference/5.1/ISE/New-IseSnippet.md b/reference/5.1/ISE/New-IseSnippet.md index 00c681717119..c65096020718 100644 --- a/reference/5.1/ISE/New-IseSnippet.md +++ b/reference/5.1/ISE/New-IseSnippet.md @@ -66,10 +66,10 @@ This command creates a Comment-BasedHelp snippet for Windows PowerShell ISE. It ```powershell $M = @' -Param +param ( - [parameter(Mandatory=$true)] - [String[]] + [Parameter(Mandatory=$true)] + [string[]] $ ) '@ @@ -227,7 +227,7 @@ This cmdlet returns no output. ## NOTES -`New-IseSnippet` stores new user-created snippets in unsigned .ps1xml files. As such, Windows +`New-IseSnippet` stores new user-created snippets in unsigned `.ps1xml` files. As such, Windows PowerShell cannot add them to a session in which the execution policy is **AllSigned** or **Restricted**. In a **Restricted** or **AllSigned** session, you can create, get, and import unsigned user-created snippets, but you cannot use them in the session. diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_DesiredStateConfiguration.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_DesiredStateConfiguration.md index 1ecaf0fdde98..1a508d4a049e 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_DesiredStateConfiguration.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_DesiredStateConfiguration.md @@ -92,7 +92,7 @@ have defined (two in the example above). For example, in this case: ```powershell MyWebConfig -MachineName "TestMachine" -WebsiteFilePath ` - "\\filesrv\WebFiles" -OutputPath "C:\Windows\system32\temp" + "\\filesrv\WebFiles" -OutputPath "C:\Windows\system32\Temp" # OutputPath is optional ``` @@ -103,7 +103,7 @@ configuration, and enact those configurations. Note that you do not need to create a separate MOF file for class-based DSC resources. ```powershell -Start-DscConfiguration -Verbose -Wait -Path "C:\Windows\system32\temp" +Start-DscConfiguration -Verbose -Wait -Path "C:\Windows\system32\Temp" ``` ## USING DSC TO MAINTAIN CONFIGURATION STATE diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Eventlogs.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Eventlogs.md index 2cf55e2e5aea..e1d7dc928e59 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Eventlogs.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Eventlogs.md @@ -74,7 +74,7 @@ Get-WmiObject Win32_NTEventlogFile | To find the Win32 event-related WMI classes, type: ```powershell -Get-WmiObject -List | where Name -Like "win32*event*" +Get-WmiObject -List | where Name -Like "Win32*Event*" ``` For more information, see [Get-EventLog][05] and [Get-WmiObject][06]. @@ -86,18 +86,18 @@ recorded in the Windows PowerShell event log. There are six event log preference variables; two variables for each of the three logging components: the engine (the Windows PowerShell program), the -providers, and the commands. The LifeCycleEvent variables log normal starting -and stopping events. The Health variables log error events. +providers, and the commands. The `LifecycleEvent` variables log normal starting +and stopping events. The `Health` variables log error events. The following table lists the event log preference variables. | Variable | Description | | ---------------------------- | ----------------------------------------------- | -| `$LogEngineLifeCycleEvent` | Logs the start and stop of PowerShell | +| `$LogEngineLifecycleEvent` | Logs the start and stop of PowerShell | | `$LogEngineHealthEvent` | Logs PowerShell program errors | -| `$LogProviderLifeCycleEvent` | Logs the start and stop of PowerShell providers | +| `$LogProviderLifecycleEvent` | Logs the start and stop of PowerShell providers | | `$LogProviderHealthEvent` | Logs PowerShell provider errors | -| `$LogCommandLifeCycleEvent` | Logs the starting and completion of commands | +| `$LogCommandLifecycleEvent` | Logs the starting and completion of commands | | `$LogCommandHealthEvent` | Logs command errors | (For information about Windows PowerShell providers, see @@ -105,29 +105,29 @@ The following table lists the event log preference variables. By default, only the following event types are enabled: -- `$LogEngineLifeCycleEvent` +- `$LogEngineLifecycleEvent` - `$LogEngineHealthEvent` -- `$LogProviderLifeCycleEvent` +- `$LogProviderLifecycleEvent` - `$LogProviderHealthEvent` To enable an event type, set the preference variable for that event type to `$true`. For example, to enable command life-cycle events, type: ```powershell -$LogCommandLifeCycleEvent +$LogCommandLifecycleEvent ``` Or, type: ```powershell -$LogCommandLifeCycleEvent = $true +$LogCommandLifecycleEvent = $true ``` To disable an event type, set the preference variable for that event type to `$false`. For example, to disable command life-cycle events, type: ```powershell -$LogProviderLifeCycleEvent = $false +$LogProviderLifecycleEvent = $false ``` You can disable any event, except for the events that indicate that the Windows diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Logging.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Logging.md index eb6efeb8f453..36b50e484394 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Logging.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Logging.md @@ -147,7 +147,7 @@ private key: ```powershell Get-WinEvent Microsoft-Windows-PowerShell/Operational | - Where-Object Id -eq 4104 | + Where-Object Id -EQ 4104 | Unprotect-CmsMessage ``` diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_PSSnapins.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_PSSnapins.md index ccf5a11b411f..f190d0c90ba5 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_PSSnapins.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_PSSnapins.md @@ -45,14 +45,14 @@ Get-PSSnapin To get the snap-in for each Windows PowerShell provider, type: ```powershell -Get-PSProvider | Format-List name, pssnapin +Get-PSProvider | Format-List Name, PSSnapIn ``` To get all the registered snap-ins on your system or to verify that a snap-in is registered, type: ```powershell -Get-PSSnapin -registered +Get-PSSnapin -Registered ``` To get a list of the cmdlets in a Windows PowerShell snap-in, type: @@ -70,7 +70,7 @@ your session. ## Add a snap-in to the current session -To add a registered snap-in to the current session, use the `Add-PsSnapin` +To add a registered snap-in to the current session, use the `Add-PSSnapin` cmdlet. For example, to add the Microsoft SQL Server snap-in to the session, type: @@ -84,7 +84,7 @@ session unless you save them. ## Save a snap-ins -To use a snap-in in future Windows PowerShell sessions, add the `Add-PsSnapin` +To use a snap-in in future Windows PowerShell sessions, add the `Add-PSSnapin` command to your Windows PowerShell profile. Or, export the snap-in names to a console file. @@ -92,7 +92,7 @@ If you add the `Add-PSSnapin` command to your profile, it's available in all future Windows PowerShell sessions. If you export the names of the snap-ins in your session, you can use the export file only when you need the snap-ins. -To add the `Add-PsSnapin` command to your Windows PowerShell profile, open your +To add the `Add-PSSnapin` command to your Windows PowerShell profile, open your profile, paste or type the command, and then save the profile. For more information, see [about_Profiles][03]. @@ -111,12 +111,12 @@ For more information, see [Export-Console][05]. To use a console file that includes the snap-in, start Windows PowerShell (`powershell.exe`) from the command prompt in `cmd.exe` or in another Windows -PowerShell session. Use the **PsConsoleFile** parameter to specify the console +PowerShell session. Use the **PSConsoleFile** parameter to specify the console file that includes the snap-in. For example, the following command starts Windows PowerShell with the `NewConsole.psc1` console file: ```powershell -PowerShell.exe -psconsolefile NewConsole.psc1 +powershell.exe -PSConsoleFile NewConsole.psc1 ``` The providers and cmdlets in the snap-in are now available for use in the @@ -125,7 +125,7 @@ session. ## Remove a snap-in To remove a Windows PowerShell snap-in from the current session, use the -`Remove-PsSnapin` cmdlet. For example, to remove the SQL Server snap-in from the +`Remove-PSSnapin` cmdlet. For example, to remove the SQL Server snap-in from the current session, type: ```powershell @@ -148,9 +148,9 @@ For more information, see [about_EventLogs][01]. - [about_Profiles][03] - [Get-Command][06] - [Export-Console][05] -- [Add-PsSnapin][04] -- [Get-PsSnapin][07] -- [Remove-PsSnapin][08] +- [Add-PSSnapin][04] +- [Get-PSSnapin][07] +- [Remove-PSSnapin][08] [01]: about_EventLogs.md diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_PowerShell_Ise_exe.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_PowerShell_Ise_exe.md index 5c4df17b0c7d..d9b37bf0369b 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_PowerShell_Ise_exe.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_PowerShell_Ise_exe.md @@ -1,5 +1,5 @@ --- -description: Explains how to use the PowerShell_Ise.exe command-line tool. +description: Explains how to use the `powershell_ise.exe` command-line tool. Locale: en-US ms.date: 06/09/2017 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_powershell_ise_exe?view=powershell-5.1&WT.mc_id=ps-gethelp @@ -11,23 +11,22 @@ title: about_PowerShell_Ise_exe ## Short description -Explains how to use the PowerShell_Ise.exe command-line tool. +Explains how to use the `powershell_ise.exe` command-line tool. ## Long description -PowerShell_Ise.exe starts a Windows PowerShell Integrated +Running `powershell_ise.exe` starts a Windows PowerShell Integrated Scripting Environment (ISE) session. You can run it in Cmd.exe and in Windows PowerShell. -To run PowerShell_ISE.exe, type PowerShell_ISE.exe, PowerShell_ISE, -or ISE. +To run Windows PowerShell ISE, type `powershell_ise.exe`, `powershell_ise`, +or `ISE`. ## Syntax ``` -PowerShell_Ise[.exe] -PowerShell_ISE[.exe] -ISE[.exe] +powershell_ise[.exe] +ISE [-File] [-NoProfile] [-MTA] -Help | ? | -? | /? Displays the syntax and describes the command-line switches. ``` @@ -43,7 +42,9 @@ commas to separate the file names within the string. For example: -PowerShell_ISE -File "File1.ps1,File2.ps1,File3.xml". +```powershell +powershell_ise -File "File1.ps1,File2.ps1,File3.xml". +``` Spaces between the file names are permitted in Windows PowerShell, but might not be interpreted correctly by other programs, such as @@ -52,7 +53,7 @@ Cmd.exe. You can use this parameter to open any text file, including Windows PowerShell script files and XML files. -### -Mta +### -MTA Starts Windows PowerShell ISE using a multi-threaded apartment. This parameter is introduced in Windows PowerShell 3.0. Single-threaded @@ -69,7 +70,7 @@ For more information, see [about_Profiles](about_Profiles.md). ### -Help -?, /? -Displays help for PowerShell_ISE.exe. +Displays help for `powershell_ise.exe`. ## Examples @@ -77,8 +78,8 @@ These commands start Windows PowerShell ISE. The commands are equivalent and can be used interchangeably. ``` -PS C:> PowerShell_ISE.exe -PS C:> PowerShell_ISE +PS C:> powershell_ise.exe +PS C:> powershell_ise PS C:> ISE ``` @@ -86,7 +87,7 @@ These commands open the Get-Profile.ps1 script in Windows PowerShell ISE. The commands are equivalent and can be used interchangeably. ``` -PS C:> PowerShell_ISE.exe -File .\Get-Profile.ps1 +PS C:> powershell_ise.exe -File .\Get-Profile.ps1 PS C:> ISE -File .\Get-Profile.ps1 PS C:> ISE .\Get-Profile.ps1 ``` @@ -106,10 +107,10 @@ This command starts Windows PowerShell ISE with no profiles. PS C:> ISE -NoProfile ``` -This command gets help for PowerShell_ISE.exe. +This command gets help for `powershell_ise.exe`. ``` -PS C:> ISE -help +PS C:> ISE -Help ``` ## See also diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_PowerShell_exe.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_PowerShell_exe.md index c3c6de3b9323..5a7109b23cfa 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_PowerShell_exe.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_PowerShell_exe.md @@ -74,10 +74,10 @@ interpretation by the current shell. For example, if you are in `cmd.exe` and want to pass an environment variable value, you would use the `cmd.exe` syntax: `powershell.exe -File .\test.ps1 -TestParam %windir%` -In contrast, running `powershell.exe -File .\test.ps1 -TestParam $env:windir` -in `cmd.exe` results in the script receiving the literal string `$env:windir` +In contrast, running `powershell.exe -File .\test.ps1 -TestParam $Env:windir` +in `cmd.exe` results in the script receiving the literal string `$Env:windir` because it has no special meaning to the current `cmd.exe` shell. The -`$env:windir` style of environment variable reference _can_ be used inside a +`$Env:windir` style of environment variable reference _can_ be used inside a **Command** parameter, since there it's interpreted as PowerShell code. Similarly, if you want to execute the same command from a _Batch script_, you @@ -122,7 +122,7 @@ expression, or parsed by the PowerShell host as a literal script block enclosed in curly braces (`{}`), before being passed to `powershell.exe`. ```powershell -powershell -Command {Get-WinEvent -LogName security} +powershell -Command {Get-WinEvent -LogName Security} ``` In `cmd.exe`, there is no such thing as a script block (or **ScriptBlock** @@ -137,7 +137,7 @@ running from `cmd.exe`. To execute an inline script block defined inside a string, the [call operator][05] `&` can be used: ```cmd -powershell.exe -Command "& {Get-WinEvent -LogName security}" +powershell.exe -Command "& {Get-WinEvent -LogName Security}" ``` If the value of **Command** is a string, **Command** must be the last parameter @@ -211,7 +211,7 @@ braces. The string must be formatted using UTF-16LE character encoding. ### -ExecutionPolicy \ Sets the default execution policy for the current session and saves it in the -`$env:PSExecutionPolicyPreference` environment variable. This parameter does +`$Env:PSExecutionPolicyPreference` environment variable. This parameter does not change the PowerShell execution policy that's set in the registry. For information about PowerShell execution policies, including a list of valid values, see [about_Execution_Policies][04]. @@ -279,7 +279,7 @@ Sets the window style for the session. Valid values are `Normal`, `Minimized`, ### -Help, -?, /? -Displays help for `PowerShell.exe`. If you are typing a `PowerShell.exe` +Displays help for `powershell.exe`. If you are typing a `powershell.exe` command in a PowerShell session, prepend the command parameters with a hyphen (`-`), not a forward slash (`/`). You can use either a hyphen or forward slash in `cmd.exe`. @@ -299,19 +299,19 @@ PowerShell -PSConsoleFile sqlsnapin.psc1 PowerShell -Version 2.0 -NoLogo -InputFormat text -OutputFormat XML # Execute a PowerShell Command in a session -PowerShell -Command "Get-EventLog -LogName security" +PowerShell -Command "Get-EventLog -LogName Security" # Run a script block in a session -PowerShell -Command {Get-EventLog -LogName security} +PowerShell -Command {Get-EventLog -LogName Security} # An alternate way to run a command in a new session -PowerShell -Command "& {Get-EventLog -LogName security}" +PowerShell -Command "& {Get-EventLog -LogName Security}" # To use the -EncodedCommand parameter: -$command = "dir 'c:\program files' " +$command = "dir 'C:\Program Files' " $bytes = [System.Text.Encoding]::Unicode.GetBytes($command) $encodedCommand = [Convert]::ToBase64String($bytes) -powershell.exe -encodedCommand $encodedCommand +powershell.exe -EncodedCommand $encodedCommand ``` diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Transactions.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Transactions.md index e3c536a329bc..e4755ef895ca 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Transactions.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Transactions.md @@ -87,7 +87,7 @@ Get-Help For example, to get Help for the Registry provider, type: ```powershell -Get-Help registry +Get-Help Registry ``` ## The **UseTransaction** parameter @@ -214,7 +214,7 @@ data store, the data can be changed while the transaction is in progress. The examples in this section use the PowerShell Registry provider and assume that you are familiar with it. For information about the Registry provider, -type `Get-Help registry`. +type `Get-Help Registry`. ### Example 1: Committing a transaction @@ -232,7 +232,7 @@ For example, the following command, which sets the current location in the Software key of the `HKCU:` drive, isn't included in the transaction. ```powershell -cd hkcu:\Software +cd HKCU:\Software ``` The following command, which creates the MyCompany key, uses the @@ -347,7 +347,7 @@ registry entry to the MyCompany key. The command uses the UseTransaction parameter to include the command in the transaction. ```powershell -New-Itemproperty -path MyCompany -Name MyKey -value 123 -UseTransaction +New-ItemProperty -Path MyCompany -Name MyKey -Value 123 -UseTransaction ``` The command returns an object representing the new registry entry, but the @@ -383,7 +383,7 @@ To preview the effect of committing the transaction, enter a `Get-ChildItem` the data from within the transaction. ```powershell -dir m* -useTransaction +dir m* -UseTransaction ``` The result shows that, if the transaction is committed, the `MyKey` entry is @@ -566,7 +566,7 @@ to add text to the string. Because the command isn't part of the transaction, the change is effective immediately. ```powershell -$t.append("Windows") +$t.Append("Windows") ``` The following command uses the same Append method to add text, but it adds the @@ -575,14 +575,14 @@ set as the value of the **ScriptBlock** parameter of `Use-Transaction`. The **UseTransaction** parameter (**usetx**) is required. ```powershell -Use-Transaction {$t.append(" PowerShell")} -usetx +Use-Transaction {$t.Append(" PowerShell")} -usetx ``` To see the current content of the transacted string in `$t`, use the `ToString` method of the **TransactedString** object. ```powershell -$t.tostring() +$t.ToString() ``` The output shows that only the non-transacted changes are effective. @@ -595,7 +595,7 @@ To see the current content of the transacted string in $t from within the transaction, embed the expression in a `Use-Transaction` command. ```powershell -Use-Transaction {$t.tostring()} -usetx +Use-Transaction {$t.ToString()} -usetx ``` The output shows the transaction view. @@ -613,7 +613,7 @@ Complete-Transaction To see the final string: ``` -$t.tostring() +$t.ToString() PowerShell ``` @@ -676,7 +676,7 @@ entry to the MyCompany key. It uses the UseTransaction parameter to include the command in the transaction. ```powershell -New-ItemProperty -path MyCompany -name MyKey -UseTransaction +New-ItemProperty -Path MyCompany -Name MyKey -UseTransaction ``` The MyCompany key doesn't exist in the registry, but this command succeeds diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_WMI.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_WMI.md index 9f5a7f8397c7..c5191cae0a0c 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_WMI.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_WMI.md @@ -44,7 +44,7 @@ WMI Namespaces organize WMI providers and WMI classes into groups of related components. In this way, they're similar to .NET Framework namespaces. Namespaces aren't physical locations, but are more like logical databases. All WMI namespaces are instances of the __Namespace system class. The default WMI -namespace is `root/cimv2` (since Microsoft Windows 2000). To use Windows +namespace is **root/CIMV2** (since Microsoft Windows 2000). To use Windows PowerShell to get WMI namespaces in the current session, use a command with the following format. @@ -54,10 +54,10 @@ Get-WmiObject -Class __Namespace To get WMI namespaces in other namespaces, use the Namespace parameter to change the location of the search. The following command finds WMI namespaces -that reside in the `root/cimv2/Applications` namespace. +that reside in the **root/CIMV2/Applications** namespace. ```powershell -Get-WmiObject -Class __Namespace -Namespace root/cimv2/applications +Get-WmiObject -Class __Namespace -Namespace root/CIMV2/Applications ``` WMI namespaces are hierarchical. Therefore, obtaining a list of all namespaces @@ -72,23 +72,23 @@ requested through the management application. ## FINDING WMI CLASSES -In a default installation of Windows 8, there are more than 1,100 WMI classes -in `root/cimv2`. With this many WMI classes, the challenge becomes identifying +In a default Windows 8 installation, there are more than 1,100 WMI classes in +**root/CIMV2**. With this many WMI classes, the challenge becomes identifying the appropriate WMI class to use to perform a specific task. Windows PowerShell 3.0 provides two ways to find WMI classes that are related to a specific topic. -For example,to find WMI classes in the `root/cimv2` WMI namespace that are +For example, to find WMI classes in the **root/CIMV2** WMI namespace that are related to disks, you can use a query such as the one shown here. ```powershell -Get-WmiObject -List *disk* +Get-WmiObject -List *Disk* ``` To find WMI classes that are related to memory, you might use a query such as the one shown here. ```powershell -Get-WmiObject -List *memory* +Get-WmiObject -List *Memory* ``` The CIM cmdlets also provide the ability to discover WMI classes. To do this, @@ -96,15 +96,15 @@ use the `Get-CimClass` cmdlet. The command shown here lists WMI classes related to video. ```powershell -Get-CimClass *video* +Get-CimClass *Video* ``` Tab expansion works when changing WMI namespaces, and therefore use of tab expansion makes sub-WMI namespaces easily discoverable. In the following example, the `Get-CimClass` cmdlet lists WMI classes related to power settings. -To find it, type the `root/cimv2` namespace and then press the Tab key several -times until the power namespace appears. Here is the command: +To find it, type the **root/CIMV2** namespace and then press the Tab key +several times until the **power** namespace appears. Here is the command: ```powershell -Get-CimClass *power* -Namespace root/cimv2/power +Get-CimClass *Power* -Namespace root/CIMV2/power ``` diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_WMI_Cmdlets.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_WMI_Cmdlets.md index 87286987058d..15321998e245 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_WMI_Cmdlets.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_WMI_Cmdlets.md @@ -58,24 +58,24 @@ The following WMI cmdlets are included. The following command displays the BIOS information for the local computer. ```powershell -C:\PS> get-wmiobject win32_bios | format-list * +C:\PS> Get-WmiObject Win32_BIOS | Format-List * ``` The following command displays information about the WinRM service for three remote computers. ```powershell -$wql = "select * from win32_service where name='WinRM'" -get-wmiobject -query $wql -computername server01, server01, server03 +$wql = "select * from Win32_Service where name='WinRM'" +Get-WmiObject -Query $wql -ComputerName server01, server01, server03 ``` The following more complex command exits all instances of a program. ```powershell C:\PS> notepad.exe -C:\PS> $wql = "select * from win32_process where name='notepad.exe'" -C:\PS> $np = get-wmiobject -query $wql -C:\PS> $np | remove-wmiobject +C:\PS> $wql = "select * from Win32_Process where name='notepad.exe'" +C:\PS> $np = Get-WmiObject -Query $wql +C:\PS> $np | Remove-WmiObject ``` ### WMI-BASED REMOTING @@ -95,23 +95,23 @@ accelerator approach would allow. The following type accelerators are supported with WMI: -[WMISEARCHER] - A shortcut for searching for WMI objects. +`[wmisearcher]` - A shortcut for searching for WMI objects. -[WMICLASS] - A shortcut for accessing the static properties and methods of a class. +`[wmiclass]` - A shortcut for accessing the static properties and methods of a class. -[WMI] - A shortcut for getting a single instance of a class. +`[wmi]` - A shortcut for getting a single instance of a class. -[WMISEARCHER] is a type accelerator for a ManagementObjectSearcher. It can -take a string constructor to create a searcher that you can then do a GET() +`[wmisearcher]` is a type accelerator for a `ManagementObjectSearcher`. It can +take a string constructor to create a searcher that you can then do a `Get()` on. For example: ```powershell -PS> $s = [WmiSearcher]'Select * from Win32_Process where Handlecount > 1000' -PS> $s.Get() |sort handlecount |ft handlecount,__path,name -auto +PS> $s = [wmisearcher]'Select * from Win32_Process where HandleCount > 1000' +PS> $s.Get() | sort HandleCount | ft HandleCount, __PATH, Name -Auto -count __PATH name +Count __PATH Name ----- ------ ---- 1105 \\SERVER01\root\cimv2:Win32_Process.Handle="3724" PowerShell... 1132 \\SERVER01\root\cimv2:Win32_Process.Handle="1388" winlogon.exe @@ -121,14 +121,14 @@ count __PATH name 2579 \\SERVER01\root\cimv2:Win32_Process.Handle="1768" svchost.exe ``` -[WMICLASS] is a type accelerator for ManagementClass. This has a string +`[wmiclass]` is a type accelerator for `ManagementClass`. This has a string constructor that takes a local or absolute WMI path to a WMI class and returns an object that is bound to that class. For example: ```powershell -PS> $c = [WMICLASS]"root\cimv2:WIn32_Process" +PS> $c = [wmiclass]"root\CIMV2:Win32_Process" PS> $c |fl * Name : Win32_Process __GENUS : 1 @@ -144,14 +144,14 @@ __NAMESPACE : ROOT\cimv2 __PATH : \\SERVER01\ROOT\cimv2:Win32_Process ``` -[WMI] is a type accelerator for ManagementObject. This has a string +`[wmi]` is a type accelerator for `ManagementObject`. This has a string constructor that takes a local or absolute WMI path to a WMI instance and returns an object that is bound to that instance. For example: ```powershell -PS> $p = [WMI]'\\SERVER01\root\cimv2:Win32_Process.Handle="1204"' +PS> $p = [wmi]'\\SERVER01\root\CIMV2:Win32_Process.Handle="1204"' PS> $p.Name OUTLOOK.EXE ``` diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_WQL.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_WQL.md index 58f42abb99a0..939dd60bf118 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_WQL.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_WQL.md @@ -53,10 +53,10 @@ SELECT FROM ``` For example, the following `SELECT` statement selects all properties (`*`) from -the instances of the **Win32_Bios** WMI class. +the instances of the **Win32_BIOS** WMI class. ``` -SELECT * FROM Win32_Bios +SELECT * FROM Win32_BIOS ``` > [!NOTE] @@ -67,19 +67,19 @@ SELECT * FROM Win32_Bios To select a particular property of a WMI class, place the property name between the `SELECT` and `FROM` keywords. -The following query selects only the name of the BIOS from the **Win32_Bios** +The following query selects only the name of the BIOS from the **Win32_BIOS** WMI class. The command saves the query in the `$queryName` variable. ``` -SELECT Name FROM Win32_Bios +SELECT Name FROM Win32_BIOS ``` To select more than one property, use commas to separate the property names. -The following WMI query selects the name and the version of the **Win32_Bios** +The following WMI query selects the name and the version of the **Win32_BIOS** WMI class. The command saves the query in the `$queryNameVersion` variable. ```WQL -SELECT name, version FROM Win32_Bios +SELECT name, version FROM Win32_BIOS ``` ## Using the WQL query @@ -97,7 +97,7 @@ a string) and then use the query string as the value of the **Query** parameter of the `Get-WmiObject` cmdlet, as shown in the following example. ```powershell -Get-WmiObject -Query "SELECT * FROM Win32_Bios" +Get-WmiObject -Query "SELECT * FROM Win32_BIOS" ``` ```output @@ -112,7 +112,7 @@ You can also save the WQL statement in a variable and then use the variable as the value of the **Query** parameter, as shown in the following command. ```powershell -$query = "SELECT * FROM Win32_Bios" +$query = "SELECT * FROM Win32_BIOS" Get-WmiObject -Query $query ``` @@ -121,7 +121,7 @@ the query in the `$queryName` variable to get only the **Name** and **Version** properties of the system BIOS. ```powershell -$queryNameVersion = "SELECT Name, Version FROM Win32_Bios" +$queryNameVersion = "SELECT Name, Version FROM Win32_BIOS" Get-WmiObject -Query $queryNameVersion ``` @@ -143,11 +143,11 @@ PSComputerName : Remember that you can use the parameters of the `Get-WmiObject` cmdlet to get the same result. For example, the following command also gets the values of the -**Name** and **Version** properties of instances of the **Win32_Bios** WMI +**Name** and **Version** properties of instances of the **Win32_BIOS** WMI class. ```powershell -Get-WmiObject -Class Win32_Bios -Property Name, Version +Get-WmiObject -Class Win32_BIOS -Property Name, Version ``` ```output @@ -184,7 +184,7 @@ Any WQL query that can be used with `Get-WmiObject` can also be used with `Get-CimInstance`. ```powershell -Get-CimInstance -Query "SELECT * FROM Win32_Bios" +Get-CimInstance -Query "SELECT * FROM Win32_BIOS" ``` ```output @@ -200,10 +200,10 @@ Version : LENOVO - 1270 similar. ```powershell -PS> (Get-CimInstance -Query "SELECT * FROM Win32_Bios").GetType().FullName +PS> (Get-CimInstance -Query "SELECT * FROM Win32_BIOS").GetType().FullName Microsoft.Management.Infrastructure.CimInstance -PS> (Get-WmiObject -Query "SELECT * FROM Win32_Bios").GetType().FullName +PS> (Get-WmiObject -Query "SELECT * FROM Win32_BIOS").GetType().FullName System.Management.ManagementObject ``` @@ -228,7 +228,7 @@ result in the `$bios` variable, and then calls the `Get()` method of the **ManagementObjectSearcher** object in the `$bios` variable. ```powershell -$bios = [wmisearcher]"SELECT * FROM Win32_Bios" +$bios = [wmisearcher]"SELECT * FROM Win32_BIOS" $bios.Get() ``` @@ -245,7 +245,7 @@ variable. In the following example, the `[wmisearcher]` type accelerator is used to cast the variable. The result is the same. ```powershell -[wmisearcher]$bios = "SELECT * FROM Win32_Bios" +[wmisearcher]$bios = "SELECT * FROM Win32_BIOS" $bios.Get() ``` @@ -261,21 +261,21 @@ When you use the `[wmisearcher]` type accelerator, it changes the query string into a **ManagementObjectSearcher** object, as shown in the following commands. ```powershell -$a = "SELECT * FROM Win32_Bios" +$a = "SELECT * FROM Win32_BIOS" $a.GetType().FullName System.String -$a = [wmisearcher]"SELECT * FROM Win32_Bios" +$a = [wmisearcher]"SELECT * FROM Win32_BIOS" $a.GetType().FullName System.Management.ManagementObjectSearcher ``` This command format works on any query. The following command gets the value -of the **Name** property of the **Win32_Bios** WMI class. +of the **Name** property of the **Win32_BIOS** WMI class. ```powershell -$biosname = [wmisearcher]"Select Name from Win32_Bios" -$biosname.Get() +$biosName = [wmisearcher]"Select Name from Win32_BIOS" +$biosName.Get() ``` ```output @@ -372,24 +372,24 @@ The WQL operators can also be used in the value of the **Filter** parameter of the `Get-WmiObject` or `Get-CimInstance` cmdlets, as well as in the value of the **Query** parameters of these cmdlets. -For example, the following command gets the **Name** and **ProcessID** -properties of the last five processes that have **ProcessID** values greater +For example, the following command gets the **Name** and **ProcessId** +properties of the last five processes that have **ProcessId** values greater than 1004. The command uses the **Filter** parameter to specify the -**ProcessID** condition. +**ProcessId** condition. ```powershell $getWmiObjectSplat = @{ Class = 'Win32_Process' - Property = 'Name', 'ProcessID' - Filter = "ProcessID >= 1004" + Property = 'Name', 'ProcessId' + Filter = "ProcessId >= 1004" } Get-WmiObject @getWmiObjectSplat | - Sort-Object ProcessID | - Select-Object Name, ProcessID -Last 5 + Sort-Object ProcessId | + Select-Object Name, ProcessId -Last 5 ``` ```output -Name ProcessID +Name ProcessId ---- --------- SROSVC.exe 4220 WINWORD.EXE 4664 @@ -444,11 +444,11 @@ The query should return any process from `Hotepad.exe` through `Notepad.exe`. ```powershell Notepad # Starts Notepad $query = "SELECT * FROM Win32_Process WHERE Name LIKE '[H-N]otepad.exe'" -Get-WmiObject -Query $query | Select Name, ProcessID +Get-WmiObject -Query $query | select Name, ProcessId ``` ```output -Name ProcessID +Name ProcessId ---- --------- notepad.exe 1740 ``` @@ -460,13 +460,13 @@ letter between A and P (case-insensitive) followed by zero or more letters in any combination. The `Get-WmiObject` cmdlet runs the query, the `Select-Object` cmdlet gets the -**Name** and **ProcessID** properties, and the `Sort-Object` cmdlet sorts the +**Name** and **ProcessId** properties, and the `Sort-Object` cmdlet sorts the results in alphabetical order by name. ```powershell $query = "SELECT * FROM Win32_Process WHERE name LIKE '[A-P]%'" Get-WmiObject -Query $query | - Select-Object -Property Name, ProcessID | + Select-Object -Property Name, ProcessId | Sort-Object -Property Name ``` @@ -480,7 +480,7 @@ and followed zero or more letters. ```powershell $query = "SELECT * FROM Win32_Process WHERE name LIKE '[^ASWPRCUN]%'" Get-WmiObject -Query $query | - Select-Object -Property Name, ProcessID | + Select-Object -Property Name, ProcessId | Sort-Object -Property Name ``` @@ -492,11 +492,11 @@ asterisk (`*`) wildcard in PowerShell. ```powershell $query = "SELECT * FROM Win32_Process WHERE Name LIKE 'calc%'" -Get-WmiObject -Query $query | Select-Object -Property Name, ProcessID +Get-WmiObject -Query $query | Select-Object -Property Name, ProcessId ``` ```output -Name ProcessID +Name ProcessId ---- --------- calc.exe 4424 ``` @@ -511,11 +511,11 @@ more than one character. ```powershell $query = "SELECT * FROM Win32_Process WHERE Name LIKE 'c_lc.exe'" -Get-WmiObject -Query $query | Select-Object -Property Name, ProcessID +Get-WmiObject -Query $query | Select-Object -Property Name, ProcessId ``` ```output -Name ProcessID +Name ProcessId ---- --------- calc.exe 4424 ``` @@ -528,11 +528,11 @@ include any wildcard characters. ```powershell $query = "SELECT * FROM Win32_Process WHERE name LIKE 'WLIDSVC.exe'" -Get-WmiObject -Query $query | Select-Object -Property Name, ProcessID +Get-WmiObject -Query $query | Select-Object -Property Name, ProcessId ```powershell ```output -Name ProcessID +Name ProcessId ---- --------- WLIDSVC.exe 84 ``` @@ -560,7 +560,7 @@ Get-WmiObject -Query $q ``` The `OR` statement can be used with more than two conditions. In the following -query, the `OR` statement gets `Winword.exe`, `Excel.exe`, or `Powershell.exe`. +query, the `OR` statement gets `Winword.exe`, `Excel.exe`, or `powershell.exe`. ```powershell $q = "SELECT * FROM Win32_Process WHERE Name='winword.exe'" + @@ -586,7 +586,7 @@ Note that the commands use the `Get-CimInstance` cmdlet. ```powershell $q = "SELECT * FROM Win32_Process WHERE Name = 'winword.exe' " + - "AND ProcessID =6512" + "AND ProcessId =6512" Get-CimInstance -Query $q ``` diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Windows_PowerShell_ISE.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Windows_PowerShell_ISE.md index b79838925f9c..56e7c56f6aee 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Windows_PowerShell_ISE.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Windows_PowerShell_ISE.md @@ -19,7 +19,7 @@ Integrated Scripting Environment (ISE). Windows PowerShell ISE is a graphical host application for Windows PowerShell. In Windows PowerShell ISE, you can run commands and write, test, and debug scripts in a single Windows-based graphical user interface. Its features -include Intellisense, multiline editing, tab completion, auto-save, syntax +include IntelliSense, multiline editing, tab completion, auto-save, syntax coloring, selective execution, context-sensitive help, Show Command (compose commands in a window) and support for double-byte character sets and right-to-left languages. @@ -52,9 +52,9 @@ supported versions of Windows. Windows PowerShell ISE. - In a Windows PowerShell console, Cmd.exe, or the Run or Search box in - Windows, type "PowerShell_ise.exe". You can also use the command-line + Windows, type `powershell_ise.exe`. You can also use the command-line parameters, including the NoProfile switch. For more information, see - [PowerShell_ISE.exe Console Help](about_powershell_ise_exe.md). + [about_PowerShell_Ise_exe](about_powershell_ise_exe.md). ## Running Interactive Commands diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Windows_Powershell_5.1.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Windows_Powershell_5.1.md index be3afe424be5..6ce0015bdd08 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Windows_Powershell_5.1.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Windows_Powershell_5.1.md @@ -7,7 +7,7 @@ schema: 2.0.0 title: about_Windows_Powershell_5.1 --- -# about_Windows_Powershell_5.1 +# about_Windows_PowerShell_5.1 ## Short description @@ -113,19 +113,19 @@ Starting with WMF 5.1, PowerShell provides control over the file that's used to cache data about a module, such as the commands it exports. By default, this cache is stored in the file -`${env:LOCALAPPDATA}\Microsoft\Windows\PowerShell\ModuleAnalysisCache`. The +`${Env:LOCALAPPDATA}\Microsoft\Windows\PowerShell\ModuleAnalysisCache`. The cache is typically read at startup while searching for a command and is written on a background thread sometime after a module is imported. To change the default location of the cache, set the -`$env:PSModuleAnalysisCachePath` environment variable before starting +`$Env:PSModuleAnalysisCachePath` environment variable before starting PowerShell. Changes to this environment variable only affect child processes. The value should name a full path (including filename) that PowerShell has permission to create and write files. To disable the file cache, set this value to an invalid location, for example: ```powershell -$env:PSModuleAnalysisCachePath = 'nul' +$Env:PSModuleAnalysisCachePath = 'nul' ``` This sets the path to an invalid device. If PowerShell can't write to the path, @@ -142,7 +142,7 @@ to avoid an unnecessarily large cache. You can disable the checks using the following setting: ```powershell -$env:PSDisableModuleAnalysisCacheCleanup = 1 +$Env:PSDisableModuleAnalysisCacheCleanup = 1 ``` Setting this environment variable takes effect immediately in the current diff --git a/reference/5.1/Microsoft.PowerShell.Core/Add-PSSnapin.md b/reference/5.1/Microsoft.PowerShell.Core/Add-PSSnapin.md index bc4ac92aa355..9d9926fd81dd 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Add-PSSnapin.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Add-PSSnapin.md @@ -38,7 +38,7 @@ imported automatically on first use and you can use the Import-Module cmdlet to ### Example 1: Add snap-ins ```powershell -PS C:\> Add-PSSnapIn -Name Microsoft.Exchange, Microsoft.Windows.AD +PS C:\> Add-PSSnapin -Name Microsoft.Exchange, Microsoft.Windows.AD ``` This command adds the Microsoft Exchange and Active Directory snap-ins to the current session. @@ -88,12 +88,12 @@ find the value of the PSSnapin property of the Set-Alias cmdlet. ```powershell PS C:\> Get-PSSnapin PS C:\> Get-PSSnapin -Registered -PS C:\> Set-Alias installutil $env:windir\Microsoft.NET\Framework\v2.0.50727\installutil.exe +PS C:\> Set-Alias installutil $Env:windir\Microsoft.NET\Framework\v2.0.50727\installutil.exe PS C:\> installutil C:\Dev\Management\ManagementCmdlets.dll PS C:\> Get-PSSnapin -Registered -PS C:\> add-pssnapin ManagementFeatures +PS C:\> Add-PSSnapin ManagementFeatures PS C:\> Get-Command -Module ManagementFeatures -PS C:\> (Get-Command Set-Alias).pssnapin +PS C:\> (Get-Command Set-Alias).PSSnapin ``` This example demonstrates the process of registering a snap-in on your system and then adding it to diff --git a/reference/5.1/Microsoft.PowerShell.Core/Export-Console.md b/reference/5.1/Microsoft.PowerShell.Core/Export-Console.md index 25560391ce3c..920cd8544f25 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Export-Console.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Export-Console.md @@ -26,8 +26,8 @@ session to a Windows PowerShell console file (.psc1). You can use this cmdlet to for use in future sessions. To add the snap-ins in the .psc1 console file to a session, start Windows PowerShell -(PowerShell.exe) at the command line by using Cmd.exe or another Windows PowerShell session, and -then use the **PSConsoleFile** parameter of PowerShell.exe to specify the console file. +(`powershell.exe`) at the command line by using Cmd.exe or another Windows PowerShell session, and +then use the **PSConsoleFile** parameter of `powershell.exe` to specify the console file. For more information about Windows PowerShell snap-ins, see [about_PSSnapins](About/about_PSSnapins.md). @@ -59,8 +59,8 @@ to continue and then prompted for a file name. ``` Add-PSSnapin NewPSSnapin -Export-Console -path NewPSSnapinConsole.psc1 -powershell.exe -PsConsoleFile NewPsSnapinConsole.psc1 +Export-Console -Path NewPSSnapinConsole.psc1 +powershell.exe -PSConsoleFile NewPsSnapinConsole.psc1 ``` These commands add the **NewPSSnapin** Windows PowerShell snap-in to the current session, export the @@ -80,7 +80,7 @@ are available in the current session. ### Example 4: Export names of snap-ins to a specified location ``` -PS C:\> export-console -path Console01 +PS C:\> Export-Console -Path Console01 PS C:\> notepad console01.psc1 @@ -110,8 +110,8 @@ Export-Console This example shows how to use the `$ConsoleFileName` automatic variable to determine the console file that will be updated if you use `Export-Console` without a **Path** parameter value. -The first command uses the **PSConsoleFile** parameter of PowerShell.exe to open Windows PowerShell -with the `Console01.psc1` file. +The first command uses the **PSConsoleFile** parameter of `powershell.exe` to open Windows +PowerShell with the `Console01.psc1` file. The second command uses the `Add-PSSnapin` cmdlet to add the MySnapin Windows PowerShell snap-in to the current session. @@ -229,7 +229,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 @@ -253,10 +254,11 @@ This cmdlet creates a file that contains the exported aliases. To use a Windows PowerShell console file in a new session, use the following syntax to start Windows PowerShell: - `powershell.exe -PsConsoleFile \.psc1` + `powershell.exe -PSConsoleFile .psc1` - You can also save Windows PowerShell snap-ins for future sessions by adding an Add-PSSnapin - command to your Windows PowerShell profile. For more information, see [about_Profiles](About/about_Profiles.md). + You can also save Windows PowerShell snap-ins for future sessions by adding an `Add-PSSnapin` + command to your Windows PowerShell profile. For more information, see + [about_Profiles](About/about_Profiles.md). ## RELATED LINKS diff --git a/reference/5.1/Microsoft.PowerShell.Core/Get-PSSnapin.md b/reference/5.1/Microsoft.PowerShell.Core/Get-PSSnapin.md index 09e94b7d96a8..9fa6abc17c5f 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Get-PSSnapin.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Get-PSSnapin.md @@ -39,7 +39,7 @@ imported automatically on first use and you can use the `Import-Module` cmdlet t ### Example 1: Get snap-ins that are currently loaded ``` -PS C:\> Get-PSSnapIn +PS C:\> Get-PSSnapin ``` This command gets the Windows PowerShell snap-ins that are currently loaded in the session. This @@ -49,7 +49,7 @@ the session. ### Example 2: Get snap-ins that have been registered ``` -PS C:\> get-PSSnapIn -Registered +PS C:\> Get-PSSnapin -Registered ``` This command gets the Windows PowerShell snap-ins that have been registered on the computer, @@ -60,7 +60,7 @@ that are installed with Windows PowerShell or Windows PowerShell snap-in dynamic ### Example 3: Get current snap-ins that match a string ``` -PS C:\> Get-PSSnapIn -Name smp* +PS C:\> Get-PSSnapin -Name smp* ``` This command gets the Windows PowerShell snap-ins in the current session that have names that begin diff --git a/reference/5.1/Microsoft.PowerShell.Core/Remove-PSSnapin.md b/reference/5.1/Microsoft.PowerShell.Core/Remove-PSSnapin.md index 39832eed8d56..3afaf654c92f 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Remove-PSSnapin.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Remove-PSSnapin.md @@ -42,7 +42,7 @@ is complete, the cmdlets and providers that the snap-in supported are not availa ### Example 2: Remove snap-ins by using names with the pipeline ```powershell -Get-PSSnapIn smp* | Remove-PSSnapIn +Get-PSSnapin smp* | Remove-PSSnapin ``` This command removes the Windows PowerShell snap-ins that have names that start with smp from the diff --git a/reference/5.1/Microsoft.PowerShell.Core/Resume-Job.md b/reference/5.1/Microsoft.PowerShell.Core/Resume-Job.md index 49a4224c76cf..957bd419dc7b 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Resume-Job.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Resume-Job.md @@ -157,7 +157,7 @@ time and the date and time that was saved in the `$a` variable before the workfl ``` #SampleWorkflow -Workflow Test-Suspend +workflow Test-Suspend { $a = Get-Date Suspend-Workflow diff --git a/reference/5.1/Microsoft.PowerShell.Core/Suspend-Job.md b/reference/5.1/Microsoft.PowerShell.Core/Suspend-Job.md index df16eb3f1eb7..1765ec801ec7 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Suspend-Job.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Suspend-Job.md @@ -104,11 +104,11 @@ the checkpoint and then suspends. ```powershell #Sample Workflow -Workflow Get-SystemLog +workflow Get-SystemLog { $Events = Get-WinEvent -LogName System CheckPoint-Workflow - InlineScript {\\Server01\Scripts\Analyze-SystemEvents.ps1 -Events $Events} + inlinescript {\\Server01\Scripts\Analyze-SystemEvents.ps1 -Events $Events} } Get-SystemLog -AsJob -JobName "LogflowJob" Get-Job -Name LogflowJob @@ -177,7 +177,7 @@ Id Name PSJobTypeName State HasMoreData Location ### Example 3: Suspend a workflow job on a remote computer ```powershell -Invoke-Command -ComputerName Srv01 -Scriptblock {Suspend-Job -Filter @{CustomID="031589"} +Invoke-Command -ComputerName Srv01 -ScriptBlock {Suspend-Job -Filter @{CustomID="031589"} ``` This command uses the `Invoke-Command` cmdlet to suspend a workflow job on the Srv01 remote diff --git a/reference/5.1/Microsoft.PowerShell.Management/Clear-EventLog.md b/reference/5.1/Microsoft.PowerShell.Management/Clear-EventLog.md index 57a1c0c949fa..ce8afec7d7bc 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Clear-EventLog.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Clear-EventLog.md @@ -51,7 +51,7 @@ Office Sessions (OSession) logs on the local computer and the Server02 remote co ### Example 3: Clear all logs on the specified computers then display the event log list ```powershell -Clear-EventLog -LogName application, system -confirm +Clear-EventLog -LogName Application, System -Confirm ``` This command prompts you for confirmation before deleting the entries in the specified event logs. @@ -59,11 +59,11 @@ This command prompts you for confirmation before deleting the entries in the spe ### Example 4: Clear all logs on the specified computers then display the event log list ```powershell -function clear-all-event-logs ($computerName="localhost") +function clear-all-event-logs ($ComputerName="localhost") { - $logs = Get-EventLog -ComputerName $computername -List | ForEach-Object {$_.Log} - $logs | ForEach-Object {Clear-EventLog -ComputerName $computername -LogName $_ } - Get-EventLog -ComputerName $computername -list + $logs = Get-EventLog -ComputerName $ComputerName -List | ForEach-Object {$_.Log} + $logs | ForEach-Object {Clear-EventLog -ComputerName $ComputerName -LogName $_ } + Get-EventLog -ComputerName $ComputerName -List } clear-all-event-logs -ComputerName Server01 diff --git a/reference/5.1/Microsoft.PowerShell.Management/Complete-Transaction.md b/reference/5.1/Microsoft.PowerShell.Management/Complete-Transaction.md index 2bb1e48e0ed6..dc5656c6f2d5 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Complete-Transaction.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Complete-Transaction.md @@ -35,7 +35,7 @@ For more information, see [about_Transactions](../Microsoft.PowerShell.Core/Abou ### Example 1: Commit a transaction ```powershell -Set-Location hkcu:\software +Set-Location HKCU:\software Start-Transaction New-Item MyCompany -UseTransaction Get-ChildItem m* @@ -78,7 +78,7 @@ effective. As a result, the second `Get-ChildItem` command shows that the regist ### Example 2: Commit a transaction that has more than one subscriber ```powershell -Set-Location hkcu:\software +Set-Location HKCU:\software Start-Transaction New-Item MyCompany -UseTransaction ``` @@ -179,7 +179,7 @@ registry. This is confirmed by a second `Get-ChildItem m*` command, which shows ### Example 3: Perform a transaction that does not change any data ```powershell -Set-Location hkcu:\software +Set-Location HKCU:\software Start-Transaction New-Item MyCompany -UseTransaction Get-ChildItem m* diff --git a/reference/5.1/Microsoft.PowerShell.Management/Convert-Path.md b/reference/5.1/Microsoft.PowerShell.Management/Convert-Path.md index fee528992e8d..ee317fd62182 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Convert-Path.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Convert-Path.md @@ -104,7 +104,7 @@ Accept wildcard characters: True ### -UseTransaction Includes the command in the active transaction. This parameter is valid only when a transaction is in progress. -For more information, see [about_transactions](../Microsoft.PowerShell.Core/About/about_Transactions.md). +For more information, see [about_Transactions](../Microsoft.PowerShell.Core/About/about_Transactions.md). ```yaml Type: System.Management.Automation.SwitchParameter diff --git a/reference/5.1/Microsoft.PowerShell.Management/Get-ComputerInfo.md b/reference/5.1/Microsoft.PowerShell.Management/Get-ComputerInfo.md index e4ab2d7d7b72..ab464b1e74d2 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Get-ComputerInfo.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Get-ComputerInfo.md @@ -39,7 +39,7 @@ Get-ComputerInfo This command gets all version properties from the computer. ```powershell -Get-ComputerInfo -Property "*version" +Get-ComputerInfo -Property "*Version" ``` ```Output diff --git a/reference/5.1/Microsoft.PowerShell.Management/Get-EventLog.md b/reference/5.1/Microsoft.PowerShell.Management/Get-EventLog.md index 75fc90bd3e8c..c637f88c4ab3 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Get-EventLog.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Get-EventLog.md @@ -156,7 +156,7 @@ Index Time EntryType Source InstanceID Message ``` The `Get-EventLog` cmdlet uses the **LogName** parameter to specify the System log. The -**InstanceID** parameter selects the events with the specified Instance ID. The **Source** parameter +**InstanceId** parameter selects the events with the specified Instance ID. The **Source** parameter specifies the event property. ### Example 6: Get events from multiple computers diff --git a/reference/5.1/Microsoft.PowerShell.Management/Get-Location.md b/reference/5.1/Microsoft.PowerShell.Management/Get-Location.md index fb813fd19b80..dc906b7c54e4 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Get-Location.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Get-Location.md @@ -223,7 +223,7 @@ Accept wildcard characters: False ### -UseTransaction Includes the command in the active transaction. This parameter is valid only when a transaction is in progress. -For more information, see [about_transactions](../Microsoft.PowerShell.Core/About/about_Transactions.md). +For more information, see [about_Transactions](../Microsoft.PowerShell.Core/About/about_Transactions.md). ```yaml Type: System.Management.Automation.SwitchParameter diff --git a/reference/5.1/Microsoft.PowerShell.Management/Get-Transaction.md b/reference/5.1/Microsoft.PowerShell.Management/Get-Transaction.md index e73e18d5b7fc..0cbb94f7202f 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Get-Transaction.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Get-Transaction.md @@ -77,7 +77,7 @@ object. ### Example 3: Show the property values of a rolled back transaction ```powershell -Set-Location hklm:\software +Set-Location HKLM:\software Start-Transaction New-Item MyCompany -UseTransaction Undo-Transaction @@ -96,7 +96,7 @@ rolled back. ### Example 4: Show the property values of a committed transaction ```powershell -Set-Location hklm:\software +Set-Location HKLM:\software Start-Transaction New-Item MyCompany -UseTransaction Complete-Transaction @@ -115,7 +115,7 @@ committed. ### Example 5: Start a transaction while another is in progress ```powershell -Set-Location hklm:\software +Set-Location HKLM:\software Start-Transaction New-Item MyCompany -UseTransaction Start-Transaction @@ -176,7 +176,7 @@ The second `Complete-Transaction` command commits the transaction. ### Example 6: Start an independent transaction while another is in progress ```powershell -Set-Location hklm:\software +Set-Location HKLM:\software Start-Transaction Get-Transaction ``` diff --git a/reference/5.1/Microsoft.PowerShell.Management/Get-WmiObject.md b/reference/5.1/Microsoft.PowerShell.Management/Get-WmiObject.md index d23ca136961d..0f7a84839038 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Get-WmiObject.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Get-WmiObject.md @@ -104,7 +104,7 @@ Get-WmiObject -Class Win32_Service -ComputerName 10.1.4.62 This example gets the WMI classes in the root or default namespace of the local computer. ```powershell -Get-WmiObject -Namespace "root/default" -List +Get-WmiObject -Namespace "root/DEFAULT" -List ``` ### Example 4: Get a named service on multiple computers @@ -113,8 +113,8 @@ This example gets the WinRM service on the computers specified by the value of t parameter. ```powershell -Get-WmiObject -Query "select * from win32_service where name='WinRM'" -ComputerName Server01, Server02 | - Format-List -Property PSComputerName, Name, ExitCode, Name, ProcessID, StartMode, State, Status +Get-WmiObject -Query "select * from Win32_Service where name='WinRM'" -ComputerName Server01, Server02 | + Format-List -Property PSComputerName, Name, ExitCode, Name, ProcessId, StartMode, State, Status ``` ```Output @@ -122,7 +122,7 @@ PSComputerName : SERVER01 Name : WinRM ExitCode : 0 Name : WinRM -ProcessID : 844 +ProcessId : 844 StartMode : Auto State : Running Status : OK @@ -131,7 +131,7 @@ PSComputerName : SERVER02 Name : WinRM ExitCode : 0 Name : WinRM -ProcessID : 932 +ProcessId : 932 StartMode : Auto State : Running Status : OK @@ -161,7 +161,7 @@ This example gets the BIOS information from the local computer. The **Property** only the subset of properties defined in the `Types.ps1xml` configuration file are displayed. ```powershell -Get-WmiObject -Class Win32_Bios | Format-List -Property * +Get-WmiObject -Class Win32_BIOS | Format-List -Property * ``` ```Output @@ -429,12 +429,12 @@ Specifies a **Where** clause to use as a filter. Uses the syntax of the WMI Quer > [!IMPORTANT] > Do not include the **Where** keyword in the value of the parameter. For example, the following -> commands return only the logical disks that have a **DeviceID** of `c:` and services that have the +> commands return only the logical disks that have a **DeviceID** of `C:\ and services that have the > name 'WinRM' without using the **Where** keyword. -`Get-WmiObject Win32_LogicalDisk -filter "DeviceID = 'c:' "` +`Get-WmiObject Win32_LogicalDisk -Filter "DeviceID = 'C:' "` -`Get-WmiObject win32_service -filter "name='WinRM'"` +`Get-WmiObject Win32_Service -Filter "name='WinRM'"` ```yaml Type: System.String @@ -480,7 +480,7 @@ Gets the names of the WMI classes in the WMI repository namespace that is specif **Namespace** parameter. If you specify the **List** parameter, but not the **Namespace** parameter, `Get-WmiObject` uses -the **Root\Cimv2** namespace by default. This cmdlet does not use the **Default Namespace** registry +the **root/CIMV2** namespace by default. This cmdlet does not use the **Default Namespace** registry entry in the `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WBEM\Scripting` registry key to determine the default namespace. diff --git a/reference/5.1/Microsoft.PowerShell.Management/Invoke-Item.md b/reference/5.1/Microsoft.PowerShell.Management/Invoke-Item.md index 13ee7a07ce89..85528230b700 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Invoke-Item.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Invoke-Item.md @@ -182,7 +182,7 @@ Accept wildcard characters: True Includes the command in the active transaction. This parameter is valid only when a transaction is in progress. -For more information, see [about_transactions](../Microsoft.PowerShell.Core/About/about_Transactions.md). +For more information, see [about_Transactions](../Microsoft.PowerShell.Core/About/about_Transactions.md). ```yaml Type: System.Management.Automation.SwitchParameter diff --git a/reference/5.1/Microsoft.PowerShell.Management/Invoke-WmiMethod.md b/reference/5.1/Microsoft.PowerShell.Management/Invoke-WmiMethod.md index db527ea6bec4..e45ead02f48f 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Invoke-WmiMethod.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Invoke-WmiMethod.md @@ -102,7 +102,7 @@ entered in a specific order. ### Example 2: Start an instance of an application ```powershell -([Wmiclass]'Win32_Process').Create.OverloadDefinitions +([wmiclass]'Win32_Process').Create.OverloadDefinitions ``` ```Output diff --git a/reference/5.1/Microsoft.PowerShell.Management/Limit-EventLog.md b/reference/5.1/Microsoft.PowerShell.Management/Limit-EventLog.md index c7ede9eb93aa..60b4d3eb36a5 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Limit-EventLog.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Limit-EventLog.md @@ -53,7 +53,7 @@ retained for at least 7 days. ### Example 3: Change the overflow action of all event logs ```powershell -$Logs = Get-EventLog -List | ForEach {$_.log} +$Logs = Get-EventLog -List | foreach {$_.Log} Limit-EventLog -OverflowAction OverwriteOlder -LogName $Logs Get-EventLog -List ``` diff --git a/reference/5.1/Microsoft.PowerShell.Management/New-EventLog.md b/reference/5.1/Microsoft.PowerShell.Management/New-EventLog.md index 5b61e7de1948..53cf6fce81d3 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/New-EventLog.md +++ b/reference/5.1/Microsoft.PowerShell.Management/New-EventLog.md @@ -205,7 +205,7 @@ new log, but the log is not created until the first entry is written to it. The operating system stores event logs as files. When you create a new event log, the associated file is stored in the -`$env:SystemRoot\System32\Config` directory on the specified computer. +`$Env:SystemRoot\System32\Config` directory on the specified computer. The file name is the first eight characters of the **Log** property with an `.evt` file name extension. diff --git a/reference/5.1/Microsoft.PowerShell.Management/New-WebServiceProxy.md b/reference/5.1/Microsoft.PowerShell.Management/New-WebServiceProxy.md index 68973e6d57e5..fe57349f0fa5 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/New-WebServiceProxy.md +++ b/reference/5.1/Microsoft.PowerShell.Management/New-WebServiceProxy.md @@ -71,7 +71,7 @@ parameters to specify the namespace and class of the object. ### Example 3: Display methods of a Web service proxy ```powershell -$calc | Get-Member -MemberType method +$calc | Get-Member -MemberType Method ``` ```Output diff --git a/reference/5.1/Microsoft.PowerShell.Management/Register-WmiEvent.md b/reference/5.1/Microsoft.PowerShell.Management/Register-WmiEvent.md index cc626c6186c4..abab0c99c58d 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Register-WmiEvent.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Register-WmiEvent.md @@ -71,7 +71,7 @@ This command uses a query to subscribe to Win32_process instance creation events ```powershell $wmiParameters = @{ - Query = "select * from __instancecreationevent within 5 where targetinstance isa 'win32_process'" + Query = "select * from __instancecreationevent within 5 where targetinstance isa 'Win32_Process'" SourceIdentifier = "WMIProcess" MessageData = "Test 01" TimeOut = 500 @@ -85,14 +85,18 @@ This example shows how to use an action to respond to an event. In this case, wh any `Start-Process` commands in the current session are written to an XML file. ```powershell -$action = { Get-History | where { $_.commandline -like "*start-process*" } | export-cliXml "commandHistory.clixml" } -Register-WmiEvent -Class 'Win32_ProcessStartTrace' -SourceIdentifier "ProcessStarted" -Action $action +$action = { + Get-History | + Where-Object { $_.CommandLine -like "*Start-Process*" } | + Export-CliXml "commandHistory.clixml" +} +Register-WmiEvent -Class Win32_ProcessStartTrace -SourceIdentifier ProcessStarted -Action $action ``` ```Output Id Name State HasMoreData Location Command -- ---- ----- ----------- -------- ------- -1 ProcessStarted NotStarted False get-history | where {... +1 ProcessStarted NotStarted False Get-History | where {... ``` When you use the **Action** parameter, `Register-WmiEvent` returns a background job that represents @@ -106,7 +110,7 @@ For more information, see [about_Jobs](../Microsoft.PowerShell.Core/About/about_ This example registers for events on the Server01 remote computer. ```powershell -Register-WmiEvent -Class 'Win32_ProcessStartTrace' -SourceIdentifier "Start" -Computername Server01 +Register-WmiEvent -Class 'Win32_ProcessStartTrace' -SourceIdentifier "Start" -ComputerName Server01 Get-Event -SourceIdentifier "Start" ``` @@ -123,7 +127,8 @@ event is raised instead of sending the event to the event queue. Enclose the com The value of **Action** can include the `$Event`, `$EventSubscriber`, `$Sender`, `$EventArgs`, and `$args` automatic variables, which provide information about the event to the **Action** script -block. For more information, see [about_Automatic_Variables](../Microsoft.PowerShell.Core/About/about_Automatic_Variables.md). +block. For more information, see +[about_Automatic_Variables](../Microsoft.PowerShell.Core/About/about_Automatic_Variables.md). When you specify an action, `Register-WmiEvent` returns an event job object that represents that action. You can use the cmdlets that contain the **Job** noun (the **Job** cmdlets) to manage the diff --git a/reference/5.1/Microsoft.PowerShell.Management/Remove-EventLog.md b/reference/5.1/Microsoft.PowerShell.Management/Remove-EventLog.md index 909bee650f70..bc2800caea8d 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Remove-EventLog.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Remove-EventLog.md @@ -119,7 +119,7 @@ The third command lists the event logs again. The ZapLog event log no longer app ### Example 5: Remove an event source and confirm the action ```powershell -Get-WmiObject win32_nteventlogfile -Filter "logfilename='TestLog'" | foreach {$_.sources} +Get-WmiObject Win32_NTEventlogFile -Filter "logfilename='TestLog'" | foreach {$_.Sources} ``` ```Output @@ -129,7 +129,7 @@ TestApp ```powershell Remove-Eventlog -Source "MyApp" -Get-WmiObject win32_nteventlogfile -Filter "logfilename='TestLog'"} | foreach {$_.sources} +Get-WmiObject Win32_NTEventlogFile -Filter "logfilename='TestLog'"} | foreach {$_.Sources} ``` ```Output diff --git a/reference/7.5/Microsoft.PowerShell.Utility/ConvertFrom-CliXml.md b/reference/7.5/Microsoft.PowerShell.Utility/ConvertFrom-CliXml.md index 064eba51c672..0eab495a17c1 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/ConvertFrom-CliXml.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/ConvertFrom-CliXml.md @@ -26,7 +26,7 @@ Infrastructure (CLI) XML to a custom **PSObject**. This command is similar to `I it doesn't read from a file. Instead, it takes a string as input. The newly deserialized objects aren't live objects. They're a snapshot of the objects at the time of -serialization. The deserialized objects include properties but no methods. The **PSTypeNames** +serialization. The deserialized objects include properties but no methods. The **pstypenames** property contains the original type name prefixed with `Deserialized`. This cmdlet was introduced in PowerShell 7.5-preview.4. @@ -36,13 +36,13 @@ This cmdlet was introduced in PowerShell 7.5-preview.4. ### Example 1 - Convert a process object to CliXml and back This example shows the result of converting a process object to CliXml and back. First, the current -process is stored in the variable `$process`. The **PSTypeNames** property of the process object +process is stored in the variable `$process`. The **pstypenames** property of the process object shows that the object is of type **System.Diagnostics.Process**. The next command displays the count for each type of member in the process object. ```powershell $process = Get-Process -Id $PID -$process.PSTypeNames +$process.pstypenames ``` ```Output @@ -72,7 +72,7 @@ Event 4 ```powershell $xml = $process | ConvertTo-CliXml $fromXML = ConvertFrom-CliXml $xml -$fromXML.PSTypeNames +$fromXML.pstypenames ``` ```Output diff --git a/reference/7.5/Microsoft.PowerShell.Utility/ConvertTo-CliXml.md b/reference/7.5/Microsoft.PowerShell.Utility/ConvertTo-CliXml.md index 99d7eac25d24..b41d0e1e9386 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/ConvertTo-CliXml.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/ConvertTo-CliXml.md @@ -32,13 +32,13 @@ This cmdlet was introduced in PowerShell 7.5-preview.4. ### Example 1 - Convert a process object to CliXml and back This example shows the result of converting a process object to CliXml and back. First, the current -process is stored in the variable `$process`. The **PSTypeNames** property of the process object +process is stored in the variable `$process`. The **pstypenames** property of the process object shows that the object is of type **System.Diagnostics.Process**. The next command displays the count for each type of member in the process object. ```powershell $process = Get-Process -Id $PID -$process.PSTypeNames +$process.pstypenames ``` ```Output @@ -68,7 +68,7 @@ Event 4 ```powershell $xml = $process | ConvertTo-CliXml $fromXML = ConvertFrom-CliXml $xml -$fromXML.PSTypeNames +$fromXML.pstypenames ``` ```Output diff --git a/reference/7.6/Microsoft.PowerShell.Utility/ConvertFrom-CliXml.md b/reference/7.6/Microsoft.PowerShell.Utility/ConvertFrom-CliXml.md index 064eba51c672..0eab495a17c1 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/ConvertFrom-CliXml.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/ConvertFrom-CliXml.md @@ -26,7 +26,7 @@ Infrastructure (CLI) XML to a custom **PSObject**. This command is similar to `I it doesn't read from a file. Instead, it takes a string as input. The newly deserialized objects aren't live objects. They're a snapshot of the objects at the time of -serialization. The deserialized objects include properties but no methods. The **PSTypeNames** +serialization. The deserialized objects include properties but no methods. The **pstypenames** property contains the original type name prefixed with `Deserialized`. This cmdlet was introduced in PowerShell 7.5-preview.4. @@ -36,13 +36,13 @@ This cmdlet was introduced in PowerShell 7.5-preview.4. ### Example 1 - Convert a process object to CliXml and back This example shows the result of converting a process object to CliXml and back. First, the current -process is stored in the variable `$process`. The **PSTypeNames** property of the process object +process is stored in the variable `$process`. The **pstypenames** property of the process object shows that the object is of type **System.Diagnostics.Process**. The next command displays the count for each type of member in the process object. ```powershell $process = Get-Process -Id $PID -$process.PSTypeNames +$process.pstypenames ``` ```Output @@ -72,7 +72,7 @@ Event 4 ```powershell $xml = $process | ConvertTo-CliXml $fromXML = ConvertFrom-CliXml $xml -$fromXML.PSTypeNames +$fromXML.pstypenames ``` ```Output diff --git a/reference/7.6/Microsoft.PowerShell.Utility/ConvertTo-CliXml.md b/reference/7.6/Microsoft.PowerShell.Utility/ConvertTo-CliXml.md index 99d7eac25d24..b41d0e1e9386 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/ConvertTo-CliXml.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/ConvertTo-CliXml.md @@ -32,13 +32,13 @@ This cmdlet was introduced in PowerShell 7.5-preview.4. ### Example 1 - Convert a process object to CliXml and back This example shows the result of converting a process object to CliXml and back. First, the current -process is stored in the variable `$process`. The **PSTypeNames** property of the process object +process is stored in the variable `$process`. The **pstypenames** property of the process object shows that the object is of type **System.Diagnostics.Process**. The next command displays the count for each type of member in the process object. ```powershell $process = Get-Process -Id $PID -$process.PSTypeNames +$process.pstypenames ``` ```Output @@ -68,7 +68,7 @@ Event 4 ```powershell $xml = $process | ConvertTo-CliXml $fromXML = ConvertFrom-CliXml $xml -$fromXML.PSTypeNames +$fromXML.pstypenames ``` ```Output