Skip to content

Commit cd5a1f0

Browse files
author
Sean Wheeler
authored
Merging latest changes to Live (#1898)
* Update the example of `Where-Object -IsNot` (#1841) * Update Example 5 in Group-Object.md (#1845) * removing @{Text=} tags * fixing UTF8 characters * removed empty H3 * added H3 for input and output types * removed mangled UTF8 character * updating Out-* commands with -NoNewLine per Issue 1739 * Fix the example of `Format-Table -DisplayError` (#1848) The example is a `-DisplayError` parameter example. But it uses `-ShowError` parameter. * Fix the example of `Format-Wide -DisplayError` (#1850) * Fix the example of `Format-Custom -DisplayError` (#1849) The example is a -DisplayError parameter example. But it uses -ShowError parameter. * updating set-acl docs per PR#901 * using semantic link breaks * Fix the example of `Format-Wide -ShowError` (#1851) * Fixed Test-ScriptFileInfo example (#1852) * fixing issue 1768 * Formatting, example fix for Body parameter (#1847) 1. Replaced variable names with PascalCase convention and for consistency 2. Removed directory information [c:\] in the examples 3. Put powershell keyword for formatting examples 4. Replaced Invoke-RestMethod with Invoke-WebRequest in the Body example, added method Post 5. Removed InformationAction and InformationVariable parameters, which were mistakenly a copy of Body, included already in CommonVariables part * fixing style consistency across articles * Fix example numbers in Resume-Job.md (#1857) Example 4 is duplicated. * Fixes typo $WebSiteName in separatingEnvData.md (#1856) - Adds the website name to common node property inside configuration data. - Also, it is now referenced (e.g. $Node.WebSiteName) in the DSC configuration document in MyWebApp.ps1. * Updates configurations.md (#1855) Two set of changes made. - Example scripts e.g. MyDscConfiguration.ps1 define the configuration inside them and call the configuration at the end line. Removed the call to the configuration at the end. Since the article demonstrates dot-sourcing the file and calling the configuration explicitly. - Fixed typo in the file name (TEST-PC1.mof to localhost.mof ), since the ComputerName was not specified it should default to using 'localhost' as the default argument for it. P.S. - There is a comment on the web-page regarding the fixes made * Fix typo in comment (#1854) * Updating the help content for v6. (#1853) * Updating the help content for v6. * Address code review comments * Fix broken links * Fix example numbers in about_Transactions.md (#1859) Example number '7' is duplicated. * Update Alias-Provider.md (#1831) 1. Removed statement that an alias is to an executable, the definition cotnains the path. It may - but does not need to be. For example: Try Set-Alias np Notepad then look at the definition. 2. Clarified that an alias can also be to a powershell script (ps1 file). 3. Tidied up the language removing multiple 'And,' clauses to improve readability. * Add documentation of new -AsHashtable switch for ConvertFrom-Json introduced by PR #5043 (#1858) * add documentation of new -AsHashTable switch for ConvertFrom-Json and also document the behaviour in case of duplicate strings. * correct casing of -AsHashtable switch. * Address PR comments about -AsHashtable switch for ConvertFrom-Json.md * Accept pipeline input: False for -AsHashtable switch in ConvertFrom-Json.md * Revert "Accept pipeline input: False for -AsHashtable switch in ConvertFrom-Json.md" Accidentally change the wrong field. This reverts commit 6e76191. * Accept pipeline input: False for -AsHashtable switch in ConvertFrom-Json.md * Fix example numbers in Invoke-WebRequest.md (#1862) Example number '4' is duplicated. * reformatting and integrating changes from PR#1831 (#1860) * Fix example numbers in Get-Help.md (#1869) Example number 12 and 13 are missing. * Fix example numbers in Import-Module.md (#1868) Example number '10' is duplicated. * Fix example number in ConvertTo-Html.html (#1867) Example number '10' is duplicated. * Update dscCiCd.md (#1865) Missing a period on line 378. Should be `$(Build.ArtifactStagingDirectory)\` not `$(BuildArtifactStagingDirectory)\`. * Web Cmdlets 6.0.0 Documentation Refresh (#1870) * Web Cmdlets 6.0.0 Documentation Refresh * Address PR Feedback * Merge Example 4 and 5 in Get-Member.md (#1874) Example 4 and 5 in Get-Member.md v3.0 and v4.0 are almost the same. They should be merged as with v5.0. * Remove hash algorithms unsupported in v6.0 (#1873) MACTripleDES and RIPEMD160 are no longer supported in v6.0. * Update outputs of Get-Verb (#1872) Since v6.0, `Get-Verb` returns not MemberDefinition but VerbInfo that has Verb and Group properties. * Fix typo in ConvertTo-Html.md (UTF-x) (#1879) * Fix "Accept wildcard characters" in Get-Service.md v6 (#1878) * Fixed "False" -> "True" (`DisplayName`, `Exclude`, `Include`, and `Name`) * Removed `InformationAction` and `InformationVariable` * Fixed Get-WindowsFeature cmdlet HyperLink (#1877) * Fixed Get-WindowsFeature cmdlet HyperLink Minor edit. Update Get-WindowsFeature cmdlet HyperLink to https://technet.microsoft.com/library/jj205469(v=wps.630).aspx * Changed URL to new docs.microsoft.com location The TechNet URL did not work. TechNet and MSDN are being retired. * Update Get-WinEvent.md (#1876) Removed future tense in a couple of places to improve readability. Minor edit. * Update Example 8 in Get-Process.md (find the owner of a process) (#1875) * Update Example 8 in Get-Process.md (Find the owner of a process) * Update to attempt to avoid build errors It seems that the build system does not accept multiple script blocks per one Example header. * updated localmachine\Root to LocalMachine\My (#1880) The example where we import the PFX on the target node should import the cert into Personal store and not root. * Update Group property example in Get-Verb.md (#1881) * adding missing space (#1885) * removing stray character (#1886) * Update Example 9 in Get-Process.md (#1888) * powershell -> pwsh (only v6.0) * Windows PowerShell -> PowerShell * Remove "About ISE" files of v6.0 (#1891) * Remove "About ISE" files of v6.0 ISE is no longer bundled with PowerShell 6.0. * Remove links for "About ISE" files of v6.0 * Update Get-Process.md (#1890) Fixed name parameter details to show it accepts wildcards in the name * Update productincompat.md (#1892) The list of compatible systems should include Skype For Business Server 2015 and Lync Server 2013. * Update unapproved verbs examples in Get-Verb.md (#1896) * Updated Example 4 * Removed Example 5 * Removing extra space in the Example 5A script (#1894) It was highlighting as string in the documentation, I was trying to remove all the extra space. * fixing merge conflict
1 parent 60c6f9d commit cd5a1f0

File tree

27 files changed

+500
-995
lines changed

27 files changed

+500
-995
lines changed

dsc/secureMOF.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ Import-Certificate -FilePath "$env:temp\DscPublicKey.cer" -CertStoreLocation Cer
217217
```powershell
218218
# Import to the root store so that it is trusted
219219
$mypwd = ConvertTo-SecureString -String "YOUR_PFX_PASSWD" -Force -AsPlainText
220-
Import-PfxCertificate -FilePath "$env:temp\DscPrivateKey.pfx" -CertStoreLocation Cert:\LocalMachine\Root -Password $mypwd > $null
220+
Import-PfxCertificate -FilePath "$env:temp\DscPrivateKey.pfx" -CertStoreLocation Cert:\LocalMachine\My -Password $mypwd > $null
221221
```
222222

223223
## Configuration data

dsc/windowsfeatureResource.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ WindowsFeature [string] #ResourceName
3131

3232
| Property | Description |
3333
|---|---|
34-
| Name| Indicates the name of the role or feature that you want to ensure is added or removed. This is the same as the __Name__ property from the [Get-WindowsFeature](https://technet.microsoft.com/en-us/library/jj205469.aspx) cmdlet, and not the display name of the role or feature.|
34+
| Name| Indicates the name of the role or feature that you want to ensure is added or removed. This is the same as the __Name__ property from the [Get-WindowsFeature](/powershell/module/servermanager/Get-WindowsFeature) cmdlet, and not the display name of the role or feature.|
3535
| Credential| Indicates the credentials to use to add or remove the role or feature.|
3636
| Ensure| Indicates if the role or feature is added. To ensure that the role or feature is added, set this property to "Present" To ensure that the role or feature is removed, set the property to "Absent".|
3737
| IncludeAllSubFeature| Set this property to __$true__ to ensure the state of all required subfeatures with the state of the feature you specify with the __Name__ property.|

reference/3.0/Microsoft.PowerShell.Core/Functions/Get-Verb.md

Lines changed: 17 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -68,60 +68,32 @@ Description
6868
This command gets all approved verbs that begin with "un".
6969

7070
### Example 3
71+
```powershell
72+
PS C:\> Get-Verb | Where-Object Group -EQ Security
73+
74+
Verb Group
75+
---- -----
76+
Block Security
77+
Grant Security
78+
Protect Security
79+
Revoke Security
80+
Unblock Security
81+
Unprotect Security
7182
```
72-
get-verb | where-object {$_.Group -eq "Security"}
73-
74-
Verb Group
75-
---- -----
76-
Block Security
77-
Grant Security
78-
Protect Security
79-
Revoke Security
80-
Unblock Security
81-
Unprotect Security
82-
```
83-
84-
Description
85-
86-
-----------
8783

8884
This command gets all approved verbs in the Security group.
8985

9086
### Example 4
87+
```powershell
88+
Get-Command -Module Microsoft.PowerShell.Utility | where Verb -NotIn (Get-Verb).Verb
89+
# CommandType Name Version Source
90+
# ----------- ---- ------- ------
91+
# Cmdlet Sort-Object 3.1.0.0 Microsoft.PowerShell.Utility
92+
# Cmdlet Tee-Object 3.1.0.0 Microsoft.PowerShell.Utility
9193
```
92-
get-command -module MyModule | where { (get-verb $_.Verb) -eq $null }
93-
```
94-
95-
Description
96-
97-
-----------
9894

9995
This command finds all commands in a module that have unapproved verbs.
10096

101-
### Example 5
102-
```
103-
$approvedVerbs = get-verb | foreach {$_.verb}
104-
105-
C:\PS> $myVerbs = get-command -module MyModule | foreach {$_.verb}
106-
107-
# Does MyModule export functions with unapproved verbs?
108-
C:\PS> ($myVerbs | foreach {$approvedVerbs -contains $_}) -contains $false
109-
True
110-
111-
# Which unapproved verbs are used in MyModule?
112-
C:\PS> ($myverbs | where {$approvedVerbs -notcontains $_})
113-
ForEach
114-
Sort
115-
Tee
116-
Where
117-
```
118-
119-
Description
120-
121-
-----------
122-
123-
These commands detect unapproved verbs in a module and tell which unapproved verbs were detected in the module.
124-
12597
## PARAMETERS
12698

12799
### -verb

reference/3.0/Microsoft.PowerShell.Management/Get-Process.md

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,10 @@ This command gets the modules for the processes that have names that begin with
114114

115115
To run this command on Windows Vista (and later versions of Windows) with processes that you do not own, you must start Windows PowerShell with the "Run as administrator" option.
116116
### Example 8
117-
```
118-
PS C:\> $p = get-wmiobject win32_process -filter "name='powershell.exe'"
119-
PS C:\> $p.getowner()
117+
```powershell
118+
PS C:\> $p = Get-WmiObject Win32_Process -Filter "name='powershell.exe'"
119+
PS C:\> $p.GetOwner()
120+
120121
121122
__GENUS : 2
122123
__CLASS : __PARAMETERS
@@ -134,33 +135,38 @@ User : user01
134135
```
135136

136137
This command shows how to find the owner of a process.
137-
Because the System.Diagnostics.Process object that Get-Process returns does not have a property or method that returns the process owner, the command uses
138-
139-
the Get-WmiObject cmdlet to get a Win32_Process object that represents the same process.
138+
Because the System.Diagnostics.Process object that `Get-Process` returns does not have a property or method that returns the process owner, the command uses the `Get-WmiObject` cmdlet to get a Win32_Process object that represents the same process.
140139

141-
The first command uses Get-WmiObject to get the PowerShell process.
140+
The first command uses `Get-WmiObject` to get the PowerShell process.
142141
It saves it in the $p variable.
143142

144143
The second command uses the GetOwner method to get the owner of the process in $p.
145-
The command reveals that the owner is Domain01\user01.
144+
The output reveals that the owner is Domain01\user01.
145+
146146
### Example 9
147-
```
148-
PS C:\> get-process powershell
147+
```powershell
148+
PS C:\> Get-Process powershell
149149
150150
Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName
151151
------- ------ ----- ----- ----- ------ -- -----------
152-
308 26 52308 61780 567 3.18 5632 powershell
153-
377 26 62676 63384 575 3.88 5888 powershell PS C:\> get-process -id $pid
152+
308 26 52308 61780 567 3.18 5632 powershell
153+
377 26 62676 63384 575 3.88 5888 powershell
154+
155+
156+
PS C:\> Get-Process -Id $PID
157+
154158
Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName
155159
------- ------ ----- ----- ----- ------ -- -----------
156-
396 26 56488 57236 575 3.90 5888 powershell
160+
396 26 56488 57236 575 3.90 5888 powershell
157161
```
158162

159-
These commands show how to use the $pid automatic variable to identify the process that is hosting the current Windows PowerShell session.
160-
You can use this method to distinguish the host process from other Windows PowerShell processes that you might want to stop or close.
161-
The first command gets all of the Windows PowerShell processes in the current session.
163+
These commands show how to use the $PID automatic variable to identify the process that is hosting the current PowerShell session.
164+
You can use this method to distinguish the host process from other PowerShell processes that you might want to stop or close.
165+
166+
The first command gets all of the PowerShell processes in the current session.
167+
168+
The second command gets the PowerShell process that is hosting the current session.
162169

163-
The second command gets the Windows PowerShell process that is hosting the current session.
164170
### Example 10
165171
```
166172
PS C:\> get-process | where {$_.mainWindowTitle} | format-table id, name, mainwindowtitle -autosize

reference/3.0/Microsoft.PowerShell.Utility/Get-Member.md

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -102,33 +102,22 @@ This command gets the methods and properties of service objects that were extend
102102
The Get-Member command uses the View parameter to get only the extended members of the service objects.
103103
In this case, the extended member is the Name property, which is an alias property of the ServiceName property.
104104
### Example 4
105-
```
106-
PS C:\> get-eventlog -log system | gm -membertype scriptproperty
107-
TypeName: System.Diagnostics.EventLogEntry
105+
```powershell
106+
PS C:\> Get-EventLog -Log System | Get-Member -MemberType ScriptProperty
108107
109-
Name MemberType Definition
110-
---- ---------- ----------
111-
EventID ScriptProperty System.Object EventID {get=$this.get_EventID() -band 0xFFFF;}
112-
```
113108
114-
This command gets the script properties of event log objects in the System log in Event Viewer.
115-
In this case, the only script property is the EventID.
116-
### Example 5
117-
```
118-
PS C:\> get-eventlog -log system | get-member -membertype scriptproperty
119-
TypeName: System.Diagnostics.EventLogEntry
109+
TypeName: System.Diagnostics.EventLogEntry
120110
121111
Name MemberType Definition
122112
---- ---------- ----------
123113
EventID ScriptProperty System.Object EventID {get=$this.get_EventID() -band 0xFFFF;}
124114
```
125115

126116
This command gets the script properties of event log objects in the System log in Event Viewer.
117+
The command uses the **MemberType** parameter to get only objects with a value of ScriptProperty for their MemberType property.
118+
The command returns the EventID property of the **EventLog** object.
127119

128-
The command uses the MemberType parameter to get only objects with a value of AliasProperty for their MemberType property.
129-
130-
The command returns the EventID property of the EventLog object.
131-
### Example 6
120+
### Example 5
132121
```
133122
PS C:\> $a = "get-process", "get-service", "get-culture", "get-psdrive", "get-executionpolicy"
134123
PS C:\> foreach ($cmdlet in $a) {invoke-command $cmdlet | get-member -name machinename}
@@ -152,7 +141,7 @@ The first command stores the names of several cmdlets in the $a variable.
152141
The second command uses a ForEach statement to invoke each command, send the results to Get-Member, and limit the results from Get-Member to members that have the name "MachineName."
153142

154143
The results show that only process objects (System.Diagnostics.Process) and service objects (System.ServiceProcess.ServiceController) have a MachineName property.
155-
### Example 7
144+
### Example 6
156145
```
157146
PS C:\> $a = get-member -inputobject @(1)
158147
PS C:\> $a.count
@@ -179,7 +168,7 @@ In this case, the array contains only one object, the integer 1.
179168
The third command uses the Get-Member cmdlet to get the properties and methods of an array of integers, and the command saves them in the $a variable.
180169

181170
The fourth command uses the Count property of the array to find the number of objects in the $a variable.
182-
### Example 8
171+
### Example 7
183172
```
184173
PS C:\> $file = get-item c:\test\textFile.txt
185174
PS C:\> $file.psobject.properties | where-object {$_.issettable} | format-table -property name
@@ -212,7 +201,7 @@ The first command uses the Get-Item cmdlet to get a text file, and then it saves
212201
The second command gets all of the changeable properties of the file object in the $file variable and displays the names of the properties in a table.
213202

214203
The third command gets the changeable properties of all objects in your Windows PowerShell session.
215-
### Example 9
204+
### Example 8
216205
```
217206
PS C:\> $s = get-service
218207
PS C:\> $s | get-member

reference/4.0/Microsoft.PowerShell.Core/Functions/Get-Verb.md

Lines changed: 17 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -68,60 +68,32 @@ Description
6868
This command gets all approved verbs that begin with "un".
6969

7070
### Example 3
71+
```powershell
72+
PS C:\> Get-Verb | Where-Object Group -EQ Security
73+
74+
Verb Group
75+
---- -----
76+
Block Security
77+
Grant Security
78+
Protect Security
79+
Revoke Security
80+
Unblock Security
81+
Unprotect Security
7182
```
72-
get-verb | where-object {$_.Group -eq "Security"}
73-
74-
Verb Group
75-
---- -----
76-
Block Security
77-
Grant Security
78-
Protect Security
79-
Revoke Security
80-
Unblock Security
81-
Unprotect Security
82-
```
83-
84-
Description
85-
86-
-----------
8783

8884
This command gets all approved verbs in the Security group.
8985

9086
### Example 4
87+
```powershell
88+
Get-Command -Module Microsoft.PowerShell.Utility | where Verb -NotIn (Get-Verb).Verb
89+
# CommandType Name Version Source
90+
# ----------- ---- ------- ------
91+
# Cmdlet Sort-Object 3.1.0.0 Microsoft.PowerShell.Utility
92+
# Cmdlet Tee-Object 3.1.0.0 Microsoft.PowerShell.Utility
9193
```
92-
get-command -module MyModule | where { (get-verb $_.Verb) -eq $null }
93-
```
94-
95-
Description
96-
97-
-----------
9894

9995
This command finds all commands in a module that have unapproved verbs.
10096

101-
### Example 5
102-
```
103-
$approvedVerbs = get-verb | foreach {$_.verb}
104-
105-
C:\PS> $myVerbs = get-command -module MyModule | foreach {$_.verb}
106-
107-
# Does MyModule export functions with unapproved verbs?
108-
C:\PS> ($myVerbs | foreach {$approvedVerbs -contains $_}) -contains $false
109-
True
110-
111-
# Which unapproved verbs are used in MyModule?
112-
C:\PS> ($myverbs | where {$approvedVerbs -notcontains $_})
113-
ForEach
114-
Sort
115-
Tee
116-
Where
117-
```
118-
119-
Description
120-
121-
-----------
122-
123-
These commands detect unapproved verbs in a module and tell which unapproved verbs were detected in the module.
124-
12597
## PARAMETERS
12698

12799
### -verb

reference/4.0/Microsoft.PowerShell.Management/Get-Process.md

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,16 @@ This command gets the modules for the processes that have names that begin with
139139
To run this command on Windows Vista (and later versions of Windows) with processes that you do not own, you must start Windows PowerShell with the "Run as administrator" option.
140140

141141
### Example 8
142-
```
143-
PS C:\> $p = get-wmiobject win32_process -filter "name='powershell.exe'"
144-
PS C:\> $p.getowner()
142+
```powershell
143+
PS C:\> Get-Process powershell -IncludeUserName
144+
145+
Handles WS(K) CPU(s) Id UserName ProcessName
146+
------- ----- ------ -- -------- -----------
147+
782 132080 2.08 2188 DOMAIN01\user01 powershell
148+
149+
PS C:\> $p = Get-WmiObject Win32_Process -Filter "name='powershell.exe'"
150+
PS C:\> $p.GetOwner()
151+
145152
146153
__GENUS : 2
147154
__CLASS : __PARAMETERS
@@ -158,35 +165,41 @@ ReturnValue : 0
158165
User : user01
159166
```
160167

161-
This command shows how to find the owner of a process.
162-
Because the System.Diagnostics.Process object that Get-Process returns does not have a property or method that returns the process owner, the command uses
168+
The first command shows how to find the owner of a process.
169+
The **IncludeUserName** parameter requires elevated user rights (Run as Administrator).
170+
The output reveals that the owner is Domain01\user01.
163171

164-
the Get-WmiObject cmdlet to get a Win32_Process object that represents the same process.
172+
The second and third command are another way to find the owner of a process.
165173

166-
The first command uses Get-WmiObject to get the PowerShell process.
174+
The second command uses `Get-WmiObject` to get the PowerShell process.
167175
It saves it in the $p variable.
168176

169-
The second command uses the GetOwner method to get the owner of the process in $p.
170-
The command reveals that the owner is Domain01\user01.
177+
The third command uses the GetOwner method to get the owner of the process in $p.
178+
The output reveals that the owner is Domain01\user01.
171179

172180
### Example 9
173-
```
174-
PS C:\> get-process powershell
181+
```powershell
182+
PS C:\> Get-Process powershell
175183
176184
Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName
177185
------- ------ ----- ----- ----- ------ -- -----------
178-
308 26 52308 61780 567 3.18 5632 powershell
179-
377 26 62676 63384 575 3.88 5888 powershell PS C:\> get-process -id $pid
186+
308 26 52308 61780 567 3.18 5632 powershell
187+
377 26 62676 63384 575 3.88 5888 powershell
188+
189+
190+
PS C:\> Get-Process -Id $PID
191+
180192
Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName
181193
------- ------ ----- ----- ----- ------ -- -----------
182-
396 26 56488 57236 575 3.90 5888 powershell
194+
396 26 56488 57236 575 3.90 5888 powershell
183195
```
184196

185-
These commands show how to use the $pid automatic variable to identify the process that is hosting the current Windows PowerShell session.
186-
You can use this method to distinguish the host process from other Windows PowerShell processes that you might want to stop or close.
187-
The first command gets all of the Windows PowerShell processes in the current session.
197+
These commands show how to use the $PID automatic variable to identify the process that is hosting the current PowerShell session.
198+
You can use this method to distinguish the host process from other PowerShell processes that you might want to stop or close.
199+
200+
The first command gets all of the PowerShell processes in the current session.
188201

189-
The second command gets the Windows PowerShell process that is hosting the current session.
202+
The second command gets the PowerShell process that is hosting the current session.
190203

191204
### Example 10
192205
```

0 commit comments

Comments
 (0)