diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_Methods.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_Methods.md index 9350c6d7358d..d567a10e3f33 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_Methods.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_Methods.md @@ -1,11 +1,10 @@ ---- +--- ms.date: 06/09/2017 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet title: about_Methods --- - # About methods ## SHORT DESCRIPTION @@ -30,7 +29,7 @@ To get the methods of any object, use the `Get-Member` cmdlet. Use its the methods of process objects. ```powershell -PS C:\> Get-Process | Get-Member -MemberType Method +PS> Get-Process | Get-Member -MemberType Method ``` ```output @@ -68,8 +67,8 @@ takes a delimiter character argument that tells the method where to split the string. ```powershell -PS C:\> $a = "Try-Catch-Finally" -PS C:\> $a.Split("-") +PS> $a = "Try-Catch-Finally" +PS> $a.Split("-") Try Catch Finally @@ -155,15 +154,15 @@ command uses the `Get-Process` command to get all three instance of the Notepad process and save them in the \$p variable. ```powershell -PS C:\> Notepad; Notepad; Notepad -PS C:\> $p = Get-Process Notepad +PS> Notepad; Notepad; Notepad +PS> $p = Get-Process Notepad ``` The third command uses the Count property of all collections to verify that there are three processes in the \$p variable. ```powershell -PS C:\> $p.Count +PS> $p.Count 3 ``` @@ -174,18 +173,18 @@ This command works even though a collection of processes does not have a `Kill` method. ``` -PS C:\> $p.Kill() +PS> $p.Kill() ``` The fifth command uses the Get-Process command to confirm that the `Kill` command worked. ```powershell -PS C:\> Get-Process Notepad +PS> Get-Process Notepad Get-Process : Cannot find a process with the name "notepad". Verify the proc ess name and call the cmdlet again. At line:1 char:12 -+ get-process <<<< notepad ++ Get-Process <<<< notepad + CategoryInfo : ObjectNotFound: (notepad:String) [Get-Process] , ProcessCommandException + FullyQualifiedErrorId : NoProcessFoundForGivenName,Microsoft.PowerShel @@ -196,7 +195,7 @@ To perform the same task on PowerShell 2.0, use the `Foreach-Object` cmdlet to run the method on each object in the collection. ```powershell -PS C:\> $p | Foreach-Object {$_.Kill()} +PS> $p | ForEach-Object {$_.Kill()} ``` ## SEE ALSO diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_Modules.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_Modules.md index 46e665267afe..e96678b30d74 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_Modules.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_Modules.md @@ -1,11 +1,10 @@ ---- +--- ms.date: 11/29/2017 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet title: about_Modules --- - # About Modules ## Short Description @@ -43,6 +42,7 @@ gets all commands in all installed modules, even if they are not yet in the session, so you can find a command and use it without importing. Any of the following commands will import a module into your session. + ### Run the Command ```powershell @@ -486,17 +486,17 @@ NOTE: Remote sessions, including sessions that are started by using the commands are packaged in snap-ins. The following modules (or snap-ins) are installed with PowerShell. -* Microsoft.PowerShell.Core -* Microsoft.PowerShell.Diagnostics -* Microsoft.PowerShell.Host -* Microsoft.PowerShell.Management -* Microsoft.PowerShell.Security -* Microsoft.PowerShell.Utility -* Microsoft.WSMan.Management -* PSScheduledJob -* PSWorkflow -* PSWorkflowUtility -* ISE +- Microsoft.PowerShell.Core +- Microsoft.PowerShell.Diagnostics +- Microsoft.PowerShell.Host +- Microsoft.PowerShell.Management +- Microsoft.PowerShell.Security +- Microsoft.PowerShell.Utility +- Microsoft.WSMan.Management +- PSScheduledJob +- PSWorkflow +- PSWorkflowUtility +- ISE ## Logging Module Events diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_Object_Creation.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_Object_Creation.md index 29c9ae7663fc..98fbf4f7799e 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_Object_Creation.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_Object_Creation.md @@ -1,11 +1,10 @@ ---- +--- ms.date: 11/30/2017 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet title: about_Object_Creation --- - # About Object Creation ## SHORT DESCRIPTION @@ -43,8 +42,8 @@ ProgID of a COM object. For example, the following command creates a Version object. ```powershell -PS C:\> $v = New-Object -TypeName System.Version -ArgumentList 2.0.0.1 -PS C:\> $v +PS> $v = New-Object -TypeName System.Version -ArgumentList 2.0.0.1 +PS> $v ``` ```Output @@ -54,7 +53,7 @@ Major Minor Build Revision ``` ```powershell -PS C:\> $v | Get-Member +PS> $v | Get-Member TypeName: System.Version ``` @@ -118,7 +117,7 @@ The output of this function is a collection of custom objects formatted as a table by default. ```powershell -PS C:\> Test-Object +PS> Test-Object ModuleName UICulture Version --------- --------- ------- @@ -130,7 +129,7 @@ Users can manage the properties of the custom objects just as they do with standard objects. ```powershell -PS C:\> (Test-Object).ModuleName +PS> (Test-Object).ModuleName PSScheduledJob PSWorkflow ``` @@ -202,8 +201,8 @@ AssetID, Name, OS, Department ``` ```powershell -PS C:\> $a = Import-Csv Servers.csv -PS C:\> $a +PS> $a = Import-Csv Servers.csv +PS> $a AssetID Name OS Department ------- ---- -- ---------- @@ -215,7 +214,7 @@ AssetID Name OS Department Use the Get-Member cmdlet to confirm the object type. ```powershell -PS C:\> $a | Get-Member +PS> $a | Get-Member ``` ```Output @@ -236,7 +235,7 @@ OS NoteProperty System.String OS=Windows Server 2012 You can use the custom objects just as you would standard objects. ```powershell -PS C:\> $a | where {$_.OS -eq "Windows 8"} +PS> $a | Where-Object {$_.OS -eq "Windows 8"} ``` ```output diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_Objects.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_Objects.md index ad7b6fce21a8..8b992bfda1b1 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_Objects.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_Objects.md @@ -1,11 +1,10 @@ ---- +--- ms.date: 11/30/2017 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet title: about_Objects --- - # About Objects ## Short Description @@ -49,7 +48,7 @@ The following example demonstrates how objects are passed from one command to the next: ```powershell -Get-ChildItem C: | where { $_.PsIsContainer -eq $false } | Format-List +Get-ChildItem C: | Where-Object { $_.PsIsContainer -eq $false } | Format-List ``` The first command `Get-ChildItem C:` returns a file or directory object diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md index da59b03104b7..ad34beb99f94 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md @@ -1,11 +1,10 @@ ---- +--- ms.date: 11/30/2017 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet title: about_Operator_Precedence --- - # About Operator Precedence ## SHORT DESCRIPTION @@ -91,10 +90,10 @@ using parentheses to force PowerShell to evaluate the enclosed part of the expression first. ```powershell -C:\PS> 2 + 3 * 4 +PS> 2 + 3 * 4 14 -C:\PS> (2 + 3) * 4 +PS> (2 + 3) * 4 20 ``` @@ -102,12 +101,13 @@ The following example gets the read-only text files from the local directory and saves them in the `$read_only` variable. ```powershell -$read_only = get-childitem *.txt | where-object {$_.isReadOnly} +$read_only = Get-ChildItem *.txt | Where-Object {$_.isReadOnly} ``` + It is equivalent to the following example. ```powershell -$read_only = ( get-childitem *.txt | where-object {$_.isReadOnly} ) +$read_only = ( Get-ChildItem *.txt | Where-Object {$_.isReadOnly} ) ``` Because the pipeline operator (|) has a higher precedence than the assignment @@ -124,7 +124,7 @@ which is the first string. Finally, it casts the selected object as a string. In this case, the cast has no effect. ```powershell -C:\PS> [string]@('Windows','PowerShell','2.0')[0] +PS> [string]@('Windows','PowerShell','2.0')[0] Windows ``` @@ -134,7 +134,7 @@ before the index selection. As a result, the entire array is cast as a array, which is the first character. ```powershell -C:\PS> ([string]@('Windows','PowerShell','2.0'))[0] +PS> ([string]@('Windows','PowerShell','2.0'))[0] W ``` @@ -143,21 +143,21 @@ precedence than the -and (logical AND) operator, the result of the expression is FALSE. ```powershell -C:\PS> 2 -gt 4 -and 1 +PS> 2 -gt 4 -and 1 False ``` It is equivalent to the following expression. ```powershell -C:\PS> (2 -gt 4) -and 1 +PS> (2 -gt 4) -and 1 False ``` If the -and operator had higher precedence, the answer would be TRUE. ```powershell -C:\PS> 2 -gt (4 -and 1) +PS> 2 -gt (4 -and 1) True ``` diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_Operators.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_Operators.md index ef067bf32d11..e703fca0a81a 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_Operators.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_Operators.md @@ -1,11 +1,10 @@ ---- +--- ms.date: 06/09/2017 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet title: about_Operators --- - # About Operators ## SHORT DESCRIPTION @@ -113,7 +112,7 @@ Returns the result of one or more statements as an array. If there is only one item, the array has only one member. ```powershell -@(Get-WMIObject win32_logicalDisk) +@(Get-WmiObject win32_logicalDisk) ``` `&` Call operator @@ -209,7 +208,7 @@ $a[-1] ``` ```powershell -(get-hotfix | sort installedOn)[-1] +(Get-HotFix | Sort-Object installedOn)[-1] ``` ```powershell @@ -235,8 +234,8 @@ that follows it. When the output includes more than one object (a "collection"), the pipeline operator sends the objects one at a time. ```powershell -get-process | get-member -get-pssnapin | where {$_.vendor -ne "Microsoft"} +Get-Process | Get-Member +Get-PSSnapin | Where-Object {$_.vendor -ne "Microsoft"} ``` `.` Property dereference operator @@ -245,7 +244,7 @@ Accesses the properties and methods of an object. ```powershell $myProcess.peakWorkingSet -(get-process PowerShell).kill() +(Get-Process PowerShell).kill() ``` `..` Range operator @@ -256,7 +255,7 @@ lower boundary. ```powershell 1..10 10..1 -foreach ($a in 1..$max) {write-host $a} +foreach ($a in 1..$max) {Write-Host $a} ``` `::` Static member operator @@ -276,7 +275,7 @@ a scalar. For multiple results, returns an array. ```powershell $($x * 23) -$(Get-WMIObject win32_Directory) +$(Get-WmiObject win32_Directory) ``` ## SEE ALSO diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_PSSession_Details.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_PSSession_Details.md index ec35fe1a8f05..36c4e898444b 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_PSSession_Details.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_PSSession_Details.md @@ -1,11 +1,10 @@ ---- +--- ms.date: 06/09/2017 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet title: about_PSSession_Details --- - # About PSSession Details ## Short Description diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_PSSessions.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_PSSessions.md index 73030eed6e2f..c1debfd07619 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_PSSessions.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_PSSessions.md @@ -1,11 +1,10 @@ ---- +--- ms.date: 01/03/2018 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet title: about_PSSessions --- - # About PSSessions ## Short Description diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_PSSnapins.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_PSSnapins.md index 81c279d63a03..f10d5eb337c5 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_PSSnapins.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_PSSnapins.md @@ -1,11 +1,10 @@ ---- +--- ms.date: 01/03/2018 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet title: about_PSSnapins --- - # About PSSnapins ## SHORT DESCRIPTION @@ -41,19 +40,19 @@ in the MSDN library. To get a list of the Windows PowerShell snap-ins on your computer, type: ```powershell -get-pssnapin +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 a list of the cmdlets in a Windows PowerShell snap-in, type: ```powershell -get-command -module +Get-Command -Module ``` ### INSTALLING A SNAP-IN @@ -79,7 +78,7 @@ 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 ``` ### ADDING THE SNAP-IN TO THE CURRENT SESSION @@ -89,7 +88,7 @@ cmdlet. For example, to add the Microsoft SQL Server snap-in to the session, type: ```powershell -add-pssnapin sql +Add-PSSnapin sql ``` After the command is completed, the providers and cmdlets in the snap-in are @@ -116,7 +115,7 @@ session configuration to the NewConsole.psc1 file in the current directory, type: ```powershell -export-console NewConsole +Export-Console NewConsole ``` For more information, see Export-Console. @@ -142,7 +141,7 @@ Remove-PsSnapin cmdlet. For example, to remove the SQL Server snap-in from the current session, type: ```powershell -remove-pssnapin sql +Remove-PSSnapin sql ``` This cmdlet removes the snap-in from the session. The snap-in is still loaded, diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_Parameters.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_Parameters.md index c69c6289a369..972adee38a73 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_Parameters.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_Parameters.md @@ -1,11 +1,10 @@ ---- +--- ms.date: 01/03/2018 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet title: about_Parameters --- - # About Parameters ## SHORT DESCRIPTION @@ -140,10 +139,10 @@ you can use any of the following commands: ```powershell -Get-ChildItem -path c:\techdocs -exclude *.ppt -Get-ChildItem c:\techdocs -exclude *.ppt -Get-ChildItem -exclude *.ppt -path c:\techdocs -Get-ChildItem -exclude *.ppt c:\techdocs +Get-ChildItem -Path c:\techdocs -Exclude *.ppt +Get-ChildItem c:\techdocs -Exclude *.ppt +Get-ChildItem -Exclude *.ppt -Path c:\techdocs +Get-ChildItem -Exclude *.ppt c:\techdocs ``` If you were to include another positional parameter without including the @@ -178,12 +177,12 @@ For example, the ServiceName parameter of the Get-Service cmdlet accepts multiple values. The following commands are both valid: ```powershell -get-service -servicename winrm, netlogon +Get-Service -servicename winrm, netlogon ``` ```powershell $s = "winrm", "netlogon" -get-service -servicename $s +Get-Service -servicename $s ``` #### Accepts Pipeline Input? diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_Parameters_Default_Values.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_Parameters_Default_Values.md index fee48e6edea7..c41435058230 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_Parameters_Default_Values.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_Parameters_Default_Values.md @@ -1,11 +1,10 @@ ---- +--- ms.date: 11/30/2017 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet title: about_Parameters_Default_Values --- - # About Parameters Default Values ## SHORT DESCRIPTION @@ -142,7 +141,7 @@ braces, the enclosed script block is passed to the `Invoke-Command` cmdlet. ```powershell $PSDefaultParameterValues=@{ - "Invoke-Command:ScriptBlock"={{Get-EventLog -Log System}} + "Invoke-Command:ScriptBlock"={{Get-EventLog -LogName System}} } ``` @@ -173,7 +172,7 @@ For example, the first command sets the value of \$PSDefaultParameterValues. The second command gets the value of \$PSDefaultParameterValues. ```powershell -PS C:\> $PSDefaultParameterValues = @{ +PS> $PSDefaultParameterValues = @{ "Send-MailMessage:SmtpServer"="Server01AB234x5" "Get-WinEvent:LogName"="Microsoft-Windows-PrintService/Operational" "Get-*:Verbose"=$true @@ -181,7 +180,7 @@ PS C:\> $PSDefaultParameterValues = @{ ``` ```powershell -PS C:\> $PSDefaultParameterValues +PS> $PSDefaultParameterValues Name Value ---- ----- @@ -200,7 +199,7 @@ $PSDefaultParameterValues[""] For example: ```powershell -PS C:\> $PSDefaultParameterValues["Send-MailMessage:SmtpServer"] +PS> $PSDefaultParameterValues["Send-MailMessage:SmtpServer"] Server01AB234x5 ``` @@ -241,7 +240,7 @@ $PSDefaultParameterValues.Add("Get-Process:Name", "PowerShell") The following example shows the effect of this command. ```powershell -PS C:\> $PSDefaultParameterValues +PS> $PSDefaultParameterValues Name Value ---- ----- @@ -251,11 +250,11 @@ Get*:Verbose True ``` ```powershell -PS C:\> $PSDefaultParameterValues.Add("Get-Process:Name", "PowerShell") +PS> $PSDefaultParameterValues.Add("Get-Process:Name", "PowerShell") ``` ```powershell -PS C:\> $PSDefaultParameterValues +PS> $PSDefaultParameterValues Name Value ---- ----- @@ -293,7 +292,7 @@ $PSDefaultParameterValues.Remove("Get-Process:Name") The following example shows the effect of this command. ```powershell -PS C:\> $PSDefaultParameterValues +PS> $PSDefaultParameterValues Name Value ---- ----- @@ -304,11 +303,11 @@ Get*:Verbose True ``` ```powershell -PS C:\> $PSDefaultParameterValues.Remove("Get-Process:Name") +PS> $PSDefaultParameterValues.Remove("Get-Process:Name") ``` ```powershell -PS C:\> $PSDefaultParameterValues +PS> $PSDefaultParameterValues Name Value ---- ----- @@ -377,7 +376,7 @@ The other values in \$PSDefaultParameterValues are preserved, but not effective. ```powershell -PS C:\> $PSDefaultParameterValues +PS> $PSDefaultParameterValues Name Value ---- ----- diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_Parsing.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_Parsing.md index 5fd8e10debf5..1e83a3c9a007 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_Parsing.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_Parsing.md @@ -1,11 +1,10 @@ ---- +--- ms.date: 06/09/2017 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet title: about_Parsing --- - # About Parsing ## SHORT DESCRIPTION diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_Path_Syntax.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_Path_Syntax.md index 1ce18117d707..037d9a817f1a 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_Path_Syntax.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_Path_Syntax.md @@ -1,11 +1,10 @@ ---- +--- ms.date: 06/09/2017 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet title: about_Path_Syntax --- - # About Path Syntax ## SHORT DESCRIPTION diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_PowerShell_Ise_exe.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_PowerShell_Ise_exe.md index 30d0834662b6..80a3daa15f17 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_PowerShell_Ise_exe.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_PowerShell_Ise_exe.md @@ -1,12 +1,12 @@ ---- +--- ms.date: 06/09/2017 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet title: about_PowerShell_Ise_exe --- - # About PowerShell Ise.exe + ## about_PowerShell_Ise.exe @@ -74,6 +74,7 @@ and can be used interchangeably. PS C:> PowerShell_ISE.exe PS C:> PowerShell_ISE + # PS C:>ISE diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_PowerShell_exe.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_PowerShell_exe.md index eaf5edd1ea0f..30c587a98c4b 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_PowerShell_exe.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_PowerShell_exe.md @@ -1,3 +1,4 @@ + --- ms.date: 01/03/2018 schema: 2.0.0 @@ -5,7 +6,6 @@ locale: en-us keywords: powershell,cmdlet title: about_PowerShell_exe --- - # About PowerShell.exe ## SHORT DESCRIPTION diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_Preference_Variables.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_Preference_Variables.md index f171a5281f94..c1c59e0dd71a 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_Preference_Variables.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_Preference_Variables.md @@ -1,11 +1,10 @@ ---- +--- ms.date: 12/21/2017 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet title: about_Preference_Variables --- - # About Preference Variables ## SHORT DESCRIPTION @@ -206,6 +205,7 @@ PS> ``` #### \$DebugPreference + Determines how PowerShell responds to debugging messages generated by a script, cmdlet or provider, or by a Write-Debug command at the command line. @@ -284,15 +284,15 @@ single command. ```powershell PS> $debugpreference = "Stop" #Change the value to "Stop" -PS> write-debug "Hello, World" +PS> Write-Debug "Hello, World" DEBUG: Hello, World Write-Debug : Command execution stopped because the shell variable "Debug Preference" is set to Stop. At line:1 char:12 -+ write-debug <<<< "Hello, World" ++ Write-Debug <<<< "Hello, World" PS> # Use the Debug parameter with $false -PS> write-debug "Hello, World" -Debug:$false +PS> Write-Debug "Hello, World" -Debug:$false PS> # The debug message is not displayed and processing is not stopped. ``` @@ -378,14 +378,14 @@ PS> # Change the value of the preference. PS> $ErrorActionPreference = "SilentlyContinue" PS> # Generate an error message. -PS> write-error "Hello, World" +PS> Write-Error "Hello, World" PS> # Error message is suppressed. PS> # Use the ErrorAction parameter with a value of "Continue". -PS> write-error "Hello, World" -erroraction:continue +PS> Write-Error "Hello, World" -erroraction:continue PS> # The error message is displayed and execution continues. -write-error "Hello, World" -erroraction:continue : Hello, World +Write-Error "Hello, World" -erroraction:continue : Hello, World ``` This example shows the effect of a real error. In this case, the command gets @@ -396,24 +396,24 @@ parameter to override the preference. PS> $erroractionpreference SilentlyContinue # Display the value of the preference. -PS> get-childitem -path nofile.txt +PS> Get-ChildItem -path nofile.txt PS> # Error message is suppressed. PS> # Change the value to Continue. PS> $ErrorActionPreference = "Continue" -PS> get-childitem -path nofile.txt +PS> Get-ChildItem -path nofile.txt Get-ChildItem : Cannot find path 'C:\nofile.txt' because it does not exist. At line:1 char:4 -+ get-childitem <<<< nofile.txt ++ Get-ChildItem <<<< nofile.txt PS> # Use the ErrorAction parameter -PS> get-childitem -path nofile.txt -erroraction SilentlyContinue +PS> Get-ChildItem -path nofile.txt -erroraction SilentlyContinue PS> # Error message is suppressed. PS> # Change the value to Inquire. PS> $ErrorActionPreference = "Inquire" -PS> get-childitem -path nofile.txt +PS> Get-ChildItem -path nofile.txt Confirm Cannot find path 'C:\nofile.txt' because it does not exist. @@ -422,7 +422,7 @@ Cannot find path 'C:\nofile.txt' because it does not exist. Get-ChildItem : Cannot find path 'C:\nofile.txt' because it does not exist. At line:1 char:4 -+ get-childitem <<<< nofile.txt ++ Get-ChildItem <<<< nofile.txt PS> # Change the value to Continue. PS> $ErrorActionPreference = "Continue" @@ -465,10 +465,10 @@ non-existent file. PS> $ErrorView # Verify the value. NormalView -PS> get-childitem nofile.txt # Find a non-existent file. +PS> Get-ChildItem nofile.txt # Find a non-existent file. Get-ChildItem : Cannot find path 'C:\nofile.txt' because it does not exist. At line:1 char:14 -+ get-childitem <<<< nofile.txt ++ Get-ChildItem <<<< nofile.txt ``` This example shows how the same error appears when the value of @@ -493,7 +493,7 @@ error in the error array (element 0) and formats all of the properties of the error object in a list. ```powershell -PS> $error[0] | format-list -property * -force +PS> $error[0] | Format-List -Property * -force Exception : System.Management.Automation.ItemNotFoundException: Cannot find path 'C:\nofile.txt' because it does not exist. @@ -551,7 +551,7 @@ PS> $formatenumerationlimit # Find the current value 4 PS> # List all services grouped by status -PS> get-service | group-object -property status +PS> get-service | Group-Object -Property status Count Name Group ----- ---- ----- @@ -561,7 +561,7 @@ PS> # The list is truncated after 4 items. PS> # Increase the limit to 1000. PS> $formatenumerationlimit = 1000 -PS> get-service | group-object -property status +PS> get-service | Group-Object -Property status Count Name Group ----- ---- ----- @@ -569,7 +569,7 @@ Count Name Group 41 Stopped {Alerter, AppMgmt, aspnet_state, ATI Smart, Browser, CiSvc... PS> # Add the Wrap parameter. -PS> get-service | group-object -property status | format-table -wrap +PS> get-service | Group-Object -Property status | Format-Table -wrap Count Name Group ----- ---- ----- @@ -683,7 +683,7 @@ Default: 4096 To count the aliases on your system, type: ```powershell -(get-alias).count +(Get-Alias).count ``` #### \$MaximumDriveCount @@ -699,7 +699,7 @@ Default: 4096 To count the aliases on your system, type: ```powershell -(get-psdrive).count +(Get-PSDrive).count ``` #### \$MaximumErrorCount @@ -738,7 +738,7 @@ $Error[($Error.Count -1] To display the properties of the ErrorRecord object, type: ```powershell -$Error[0] | format-list -property * -force +$Error[0] | Format-List -Property * -force ``` In this command, the Force parameter overrides the special formatting of @@ -777,13 +777,13 @@ the Function provider, type "get-help function"). To list the functions in the current session, type: ```powershell -get-childitem function: +Get-ChildItem function: ``` To count the functions in the current session, type: ```powershell -(get-childitem function:).count +(Get-ChildItem function:).count ``` #### \$MaximumHistoryCount @@ -799,7 +799,7 @@ To determine the number of commands current saved in the command history, type: ```powershell -(get-history).count +(Get-History).count ``` To see the command saved in your session history, use the Get-History @@ -823,7 +823,7 @@ variable". To find the current number of variables on the system, type: ```powershell -(get-variable).count +(Get-Variable).count ``` #### \$OFS @@ -961,6 +961,7 @@ PS> # Set the value equal to the OutputEncoding property of the console. PS> $OutputEncoding.EncodingName OEM United States ``` + As a result of this change, the FINDSTR command finds the characters. ```powershell @@ -1306,12 +1307,12 @@ PS> Write-Warning "This action can delete data." PS> # Write a warning message. PS> # Use the WarningAction to stop when a warning is generated. -PS> Write-Warning "This step can delete data." -warningaction stop +PS> Write-Warning "This step can delete data." -WarningAction stop WARNING: This action can delete data. Write-Warning : Command execution stopped because the shell variable "WarningPreference" is set to Stop. At line:1 char:14 -+ Write-Warning <<<< "This action can delete data." -warningaction stop ++ Write-Warning <<<< "This action can delete data." -WarningAction stop ``` This example shows the effect of the Inquire value. @@ -1402,18 +1403,18 @@ PS> $whatifpreference 0 # Check the current value. PS> # Verify that the file exists. -PS> get-childitem test.txt | format-list FullName +PS> Get-ChildItem test.txt | Format-List FullName FullName : C:\test.txt PS> remove-item test.txt PS> # Delete the file. PS> # Verify that the file is deleted. -PS> get-childitem test.txt | format-list -property FullName +PS> Get-ChildItem test.txt | Format-List -Property FullName Get-ChildItem : Cannot find path 'C:\test.txt' because it does not exist. At line:1 char:14 -+ get-childitem <<<< test.txt | format-list fullname ++ Get-ChildItem <<<< test.txt | Format-List fullname ``` This example shows the effect of using the WhatIf parameter when the value @@ -1421,7 +1422,7 @@ of \$WhatIfPreference is 0. ```powershell PS> # Verify that the file exists. -PS> get-childitem test2.txt | format-list -property FullName +PS> get-childitem test2.txt | Format-List -Property FullName FullName : C:\test2.txt PS> # Use the WhatIf parameter @@ -1429,7 +1430,7 @@ PS> remove-item test2.txt -whatif What if: Performing operation "Remove File" on Target "C:\test2.txt". PS> # Verify that the file was not deleted -PS> get-childitem test2.txt | format-list -property FullName +PS> get-childitem test2.txt | Format-List -Property FullName FullName : C:\test2.txt ``` @@ -1447,7 +1448,7 @@ PS> remove-item test.txt What if: Performing operation "Remove File" on Target "C:\test.txt". PS> # Verify that the file exists. -PS> get-childitem test.txt | format-list FullName +PS> get-childitem test.txt | Format-List FullName FullName : C:\test.txt ``` @@ -1470,7 +1471,7 @@ a value of \$false. PS> # Change the value to 1. PS> $whatifpreference = 1 -PS> get-process winword +PS> Get-Process winword A Get-Process command completes. Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName @@ -1485,11 +1486,11 @@ PS> stop-process -name winword -whatif:$false PS> # WhatIf:$false overrides the preference. PS> # Verify that the process is stopped. -PS> get-process winword +PS> Get-Process winword Get-Process : Cannot find a process with the name 'winword'. Verify the process name and call the cmdlet again. At line:1 char:12 -+ get-process <<<< winword ++ Get-Process <<<< winword ``` ## SEE ALSO diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_Prompts.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_Prompts.md index c1e6a23471f2..ce2ef0c8cfcb 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_Prompts.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_Prompts.md @@ -1,11 +1,10 @@ ---- +--- ms.date: 11/30/2017 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet title: about_Prompts --- - # About Prompts ## SHORT DESCRIPTION @@ -19,7 +18,7 @@ The PowerShell command prompt indicates that PowerShell is ready to run a command: ``` -PS C:\> +PS> ``` The PowerShell prompt is determined by the built-in Prompt function. You can @@ -46,7 +45,7 @@ For example, the following prompt function returns a "Hello, World" string followed by a caret (>). ```powershell -PS C:\> function prompt {"Hello, World > "} +PS> function prompt {"Hello, World > "} Hello, World > ``` @@ -58,7 +57,7 @@ cmdlet in the Function drive. For example: ```powershell -PS C:\> Get-Command Prompt +PS> Get-Command Prompt CommandType Name ModuleName ----------- ---- ---------- @@ -71,7 +70,7 @@ the ScriptBlock property of the Prompt function. For example: ```powershell -PS C:\> (Get-Command Prompt).ScriptBlock +PS> (Get-Command Prompt).ScriptBlock "PS $($executionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPr omptLevel + 1)) " @@ -103,7 +102,7 @@ For example, the following command sets the Prompt function to $null, which is invalid. As a result, the default prompt appears. ```powershell -PS C:\> function prompt {$null} +PS> function prompt {$null} PS> ``` @@ -116,7 +115,7 @@ PowerShell includes a built-in prompt function. ```powershell function prompt { - $(if (test-path variable:/PSDebugContext) { '[DBG]: ' } + $(if (Test-Path variable:/PSDebugContext) { '[DBG]: ' } else { '' }) + 'PS ' + $(Get-Location) ` + $(if ($nestedpromptlevel -ge 1) { '>>' }) + '> ' } @@ -199,7 +198,7 @@ PS [Server01] > The following prompt function includes the current date and time: ```powershell -function prompt {"$(get-date)> "} +function prompt {"$(Get-Date)> "} ``` The prompt resembles the following prompt: @@ -219,7 +218,7 @@ function prompt { $identity = [Security.Principal.WindowsIdentity]::GetCurrent() $principal = [Security.Principal.WindowsPrincipal] $identity - $(if (test-path variable:/PSDebugContext) { '[DBG]: ' } + $(if (Test-Path variable:/PSDebugContext) { '[DBG]: ' } elseif($principal.IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { "[ADMIN]: " } else { '' } @@ -241,7 +240,7 @@ view the command history, use the `Get-History` cmdlet. ```powershell function prompt { # The at sign creates an array in case only one history item exists. - $history = @(get-history) + $history = @(Get-History) if($history.Count -gt 0) { $lastItem = $history[$history.Count - 1] @@ -249,7 +248,7 @@ function prompt { } $nextCommand = $lastId + 1 - $currentDirectory = get-location + $currentDirectory = Get-Location "PS: $nextCommand $currentDirectory >" } ``` @@ -261,8 +260,8 @@ Return statement. Without it, PowerShell uses the default prompt, "PS>". ```powershell function prompt { - $color = Get-Random -Min 1 -Max 16 - Write-Host ("PS " + $(Get-Location) +">") -NoNewLine ` + $color = Get-Random -Minimum 1 -Maximum 16 + Write-Host ("PS " + $(Get-Location) +">") -NoNewline ` -ForegroundColor $Color return " " } diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_Properties.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_Properties.md index f868429fc8b3..7adb1c15a0ad 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_Properties.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_Properties.md @@ -1,11 +1,10 @@ ---- +--- ms.date: 12/01/2017 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet title: about_Properties --- - # About Properties ## SHORT DESCRIPTION @@ -102,7 +101,7 @@ are accessed. The `Get-ChildItem` command is followed by a dot and the name of the CreationTime property, as follows: ```powershell -C:\PS> (Get-ChildItem $pshome\PowerShell.exe).creationtime +PS> (Get-ChildItem $pshome\PowerShell.exe).creationtime Tuesday, March 18, 2008 12:07:52 AM ``` @@ -110,8 +109,8 @@ You can also save an object in a variable and then get its properties by using the dot method, as shown in the following example: ```powershell -C:\PS> $a = Get-ChildItem $pshome\PowerShell.exe -C:\PS> $a.CreationTime +PS> $a = Get-ChildItem $pshome\PowerShell.exe +PS> $a.CreationTime Tuesday, March 18, 2008 12:07:52 AM ``` @@ -125,7 +124,7 @@ For example, the following command displays the values of all the properties of the PowerShell.exe file. ```powershell -C:\PS> Get-ChildItem $pshome\PowerShell.exe | Format-List -property * +PS> Get-ChildItem $pshome\PowerShell.exe | Format-List -Property * ``` ```Output @@ -248,7 +247,7 @@ For example, each service has a DisplayName property. The following command gets the value of the DisplayName property of the Audiosrv service. ```powershell -PS C:\> (Get-Service Audiosrv).DisplayName +PS> (Get-Service Audiosrv).DisplayName Windows Audio ``` @@ -257,15 +256,15 @@ The following command tries to get the DisplayName property of all services in PowerShell 2.0. ```powershell -PS C:\> (Get-Service).DisplayName -PS C:\> +PS> (Get-Service).DisplayName +PS> ``` Beginning in PowerShell 3.0, the same command returns the value of the **DisplayName** property of every service that `Get-Service` returns. ```powershell -PS C:\> (Get-Service).DisplayName +PS> (Get-Service).DisplayName Application Experience Application Layer Gateway Service Windows All-User Install Agent @@ -278,7 +277,7 @@ Conversely, a collection of two or more services has a **Count** property, which contains the number of objects in the collection. ```powershell -PS C:\> (Get-Service).Count +PS> (Get-Service).Count 176 ``` @@ -286,14 +285,14 @@ Individual services do not have a Count or Length property, as shown in this command in PowerShell 2.0. ```powershell -PS C:\> (Get-Service Audiosrv).Count -PS C:\> +PS> (Get-Service Audiosrv).Count +PS> ``` Beginning in PowerShell 3.0, the command returns the correct Count value. ```powershell -PS C:\> (Get-Service Audiosrv).Count +PS> (Get-Service Audiosrv).Count 1 ``` diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_Providers.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_Providers.md index eb657df5b593..90dc0de3f896 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_Providers.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_Providers.md @@ -1,11 +1,10 @@ ---- +--- ms.date: 01/03/2018 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet title: about_Providers --- - # About Providers ## SHORT DESCRIPTION @@ -81,7 +80,7 @@ longer available in that session. To view the Windows PowerShell providers on your computer, type: ```powershell -get-psprovider +Get-PSProvider ``` The output lists the built-in providers and the providers that you added to @@ -191,7 +190,7 @@ cmdlets. Type the drive name followed by a colon (:). For example, to view the contents of the Alias: drive, type: ```powershell -get-item alias: +Get-Item alias: ``` You can view and manage the data in any drive from another drive by @@ -199,7 +198,7 @@ including the drive name in the path. For example, to view the HKLM\Software registry key in the HKLM: drive from another drive, type: ```powershell -get-childitem hklm:\software +Get-ChildItem hklm:\software ``` To open the drive, use the Set-Location cmdlet. Remember the colon @@ -207,13 +206,13 @@ when you specify the drive path. For example, to change your location to the root directory of the Cert: drive, type: ```powershell -set-location cert: +Set-Location cert: ``` Then, to view the contents of the Cert: drive, type: ```powershell -get-childitem +Get-ChildItem ``` ## MOVING THROUGH HIERARCHICAL DATA @@ -230,7 +229,7 @@ For example, to change your location to the HKLM\Software registry key, type a Set-Location command, such as: ```powershell -set-location hklm:\software +Set-Location hklm:\software ``` You can also use relative references to locations. A dot (.) represents the @@ -239,7 +238,7 @@ registry key, and you want to list the registry subkeys in the HKLM:\Software\Microsoft\PowerShell key, type the following command: ```powershell -get-childitem .\PowerShell +Get-ChildItem .\PowerShell ``` ## FINDING DYNAMIC PARAMETERS @@ -262,7 +261,7 @@ get-help For example: ```powershell -get-help certificate +Get-Help certificate ``` ## LEARNING ABOUT PROVIDERS @@ -281,13 +280,13 @@ get-help For example: ```powershell -get-help registry +Get-Help registry ``` For a list of Help topics about the providers, type: ```powershell -get-help * -category provider +Get-Help * -Category provider ``` ## SEE ALSO diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md index c7366b99753f..a67475efa242 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md @@ -1,11 +1,10 @@ ---- +--- ms.date: 01/03/2018 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet title: about_Quoting_Rules --- - # About Quoting Rules ## SHORT DESCRIPTION @@ -175,7 +174,7 @@ PowerShell does not recognize the escape character. Instead, it interprets the second quotation mark as the end of the string. ```output -PS C:\> 'Use a quotation mark (`') to begin a string.' +PS> 'Use a quotation mark (`') to begin a string.' Unexpected token ')' in expression or statement. At line:1 char:27 + 'Use a quotation mark (`') <<<< to begin a string.' @@ -214,6 +213,7 @@ Double-quotes: ``` Single-quotes: + ``` @' [string] ... diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_Redirection.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_Redirection.md index 79fc8f560417..79cbd190020e 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_Redirection.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_Redirection.md @@ -1,11 +1,10 @@ ---- +--- ms.date: 12/01/2017 schema: 2.0.0 locale: en-us keywords: PowerShell,cmdlet title: about_Redirection --- - # About Redirection ## SHORT DESCRIPTION @@ -38,7 +37,7 @@ The PowerShell redirection operators use the following characters to represent each output type: ``` -* All output +- All output 1 Success output 2 Errors 3 Warning messages diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_Ref.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_Ref.md index 56388029b6c9..8b169d8e9c14 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_Ref.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_Ref.md @@ -1,11 +1,10 @@ ---- +--- ms.date: 06/09/2017 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet title: about_Ref --- - # About Ref ## SHORT DESCRIPTION @@ -52,8 +51,8 @@ PS C:\ps-test> function double >> param ([ref]$x) $x.value = $x.value * 2 >> } -PS C:> $number = 8 -PS C:> $number +PS> $number = 8 +PS> $number 8 PS C> double ([ref]$number) PS C> $number diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_Regular_Expressions.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_Regular_Expressions.md index 8ead15af0db0..d886c35307ab 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_Regular_Expressions.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_Regular_Expressions.md @@ -1,11 +1,10 @@ ---- +--- ms.date: 12/01/2017 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet title: about_Regular_Expressions --- - # About Regular Expressions ## SHORT DESCRIPTION @@ -106,6 +105,7 @@ Logic: Matches any nondigit. Equivalent to \P{Nd} for Unicode and [^0-9] for non-Unicode behavior. Example: "abcd" -match "\D+" ``` + Windows PowerShell supports the quantifiers available in .NET Framework regular expressions. The following are some examples of quantifiers. diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_pipelines.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_pipelines.md index 1e43cd547d40..695d1b545b34 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_pipelines.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_pipelines.md @@ -1,11 +1,10 @@ ---- +--- ms.date: 02/14/2018 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet title: about_pipelines --- - # About Pipelines ## Short Description @@ -42,6 +41,7 @@ Here is a simple example. The following command gets the Notepad process and then stops it. For example, + ```powershell Get-Process notepad | Stop-Process ``` @@ -130,6 +130,7 @@ be restarted in this way). This command pipeline starts the WMI service on the computer: For example, + ```powershell Get-Service wmi | Start-Service ``` @@ -143,6 +144,7 @@ This command adds a new registry entry, NoOfEmployees, with a value of 8124, to the MyCompany registry key. For example, + ```powershell Get-Item -Path HKLM:\Software\MyCompany | New-ItemProperty -Name NoOfEmployees -Value 8124 @@ -519,14 +521,15 @@ For example, ```powershell Get-Item -Path HKLM:\software\mycompany\design | -Move-ItemProperty -Dest HKLM:\software\mycompany\sales -Name product +Move-ItemProperty -Destination HKLM:\software\mycompany\sales -Name product ``` To verify that the command worked, use a `Get-ItemProperty` command: For example, + ```powershell -Get-Itemproperty HKLM:\software\mycompany\sales +Get-ItemProperty HKLM:\software\mycompany\sales ``` The results show that the Product registry entry was moved to the Sales key. diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_profiles.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_profiles.md index 42a69462d3ce..304967e524db 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_profiles.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_profiles.md @@ -1,10 +1,9 @@ ---- +--- ms.date: 11/30/2017 schema: 2.0.0 keywords: powershell,cmdlet title: about_Profiles --- - # About Profiles ## SHORT DESCRIPTION @@ -98,7 +97,7 @@ in each PowerShell host application that you use. To see the current values of the `$Profile` variable, type: ```powershell -$profile | Get-Member -Type NoteProperty +$profile | Get-Member -MemberType NoteProperty ``` You can use the `$Profile` variable in many commands. For example, the @@ -214,6 +213,7 @@ function Pro {notepad $profile.CurrentUserAllHosts} ``` ### Add a function that opens PowerShell Help in a compiled HTML + Help file (.chm) ```powershell