diff --git a/gallery/psgallery/psgallery_items_tab.md b/gallery/psgallery/psgallery_items_tab.md index 427fd211948d..e72a6326ef7d 100644 --- a/gallery/psgallery/psgallery_items_tab.md +++ b/gallery/psgallery/psgallery_items_tab.md @@ -6,40 +6,50 @@ keywords: gallery,powershell,cmdlet,psgallery title: psgallery_items_tab --- -Items Tab -========== +# Items Tab -The Items Tab displays all available items in the PowerShell Gallery. - -To see only Modules in the PowerShell Gallery, click Modules in the Items Tab drop down. Similarly, to see only Scripts in the PowerShell Gallery, click Scripts in the Items Tab drop down. +The [Items tab](https://www.powershellgallery.com/items) displays all available items in the PowerShell Gallery. +There are several ways to filter, sort, and search the items. To see more details about a particular item, click the item. -There are several ways to sort the items: +## Filter By + +The drop-down under "Filter By" allows users to filter the results by: +* Include Prerelease +* Stable Only + +For information about "Prerelease" and "Stable", see [Prerelease Versioning Added to PowerShellGet and PowerShell Gallery](https://blogs.msdn.microsoft.com/powershell/2017/12/05/prerelease-versioning-added-to-powershellget-and-powershell-gallery/) in the PowerShell Team Blog. + +The checkboxes under the drop-down allow users to filter the results by: +* Item Types + - Module + - Script +* Categories + - Cmdlet + - DSC Resource + - Function + - Role Capability + - Workflow -##Filter By## -The Filter By section allows users to filter the results by: -* Item Type: - * Modules - * Scripts -* Category: - * Cmdlet - * DSC Resource - * Function - * Workflow +To see only modules in the PowerShell Gallery, check Module in the Item Types. +Similarly, to see only scripts in the PowerShell Gallery, check Script in the Item Types. -Note: Filters are inclusive. -Example: An item containing both Cmdlets and Functions will appear if either Cmdlet or Function (or both) are checked. If neither are selected, the item will not appear. -Similarly, if all categories are selected, only items containing one of those categories will appear. **Items that do not belong to any of those categories will not appear.** +> [!NOTE] +> Filters are inclusive. +> Example: An item containing both cmdlets and functions will appear if either Cmdlet or Function (or both) are checked. +> If neither are selected, the item will not appear. +> Similarly, if all categories are selected, only items containing one of those categories will appear. +> **Items that do not belong to any of those categories will not appear.** -##Sort By## -The Sort By drop down allows users to sort the results by: -* Popularity - Popularity is determined by Download Count. -* A-Z - Alphabetically by item name. -* Recent - Items appear in order of publish date. +## Sort By +The Sort By drop-down allows users to sort the results by: +* Popularity - Popularity is determined by Download Count +* A-Z - Alphabetically by item name +* Recent - Items appear in order of publish date -##Search Box## -The Search Box allows users to search the items on keywords. -See [Search Syntax](./psgallery_search_syntax.md) for more details. +## Search Box +The Search Box allows users to search the items on keywords. +For more information, see [Gallery Search Syntax](psgallery_search_syntax.md). diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md index a08a495cb977..e43e89a58ad6 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md @@ -501,8 +501,8 @@ right operand determine how many bits of the left operand are shifted. |`21 -shr 31` | 0 | 0000 0000 | 0x00 | |`21 -shr 32` | 21 | 0001 0101 | 0x15 | |`21 -shr 64` | 21 | 0001 0101 | 0x15 | -|`21 -shr 65` | 10 | 0000 1010 | 0x15 | -|`21 -shr 66` | 5 | 0000 0101 | 0x15 | +|`21 -shr 65` | 10 | 0000 1010 | 0x0A | +|`21 -shr 66` | 5 | 0000 0101 | 0x05 | |`[int]::MaxValue -shr 1`| 1073741823 | | 0x3FFFFFFF | |`[int]::MinValue -shr 1`| -1073741824| | 0xC0000000 | |`-1 -shr 1` | -1 | | 0xFFFFFFFF | diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_Arrays.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_Arrays.md index ae4224cc1336..385ad7e9e732 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_Arrays.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_Arrays.md @@ -617,8 +617,8 @@ $a[-1] ``` ```output -0 -0 +1 +1 4 4 ``` diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_Split.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_Split.md index 98b97dd2dab7..523bd6d4e3cd 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_Split.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_Split.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-12-01 +ms.date: 2017-12-20 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -35,11 +35,10 @@ The following diagram shows the syntax for the -split operator. The parameter names do not appear in the command. Include only the parameter values. The values must appear in the order specified in the syntax diagram. -```powershell +``` -Split - +-Split () -Split [,[,""]] - -Split {} [,] ``` @@ -51,14 +50,14 @@ are applied. ## PARAMETERS -### \ +### \ or \ Specifies one or more strings to be split. If you submit multiple strings, all the strings are split using the same delimiter rules. Example: -```powershell +``` -split "red yellow blue green" red yellow @@ -73,7 +72,7 @@ whitespace, including spaces and non-printable characters, such as newline (\`n) and tab (\`t). When the strings are split, the delimiter is omitted from all the substrings. Example: -```powershell +``` "Lastname:FirstName:Address" -split ":" Lastname FirstName @@ -90,7 +89,7 @@ as a split. Examples: -```powershell +``` "Lastname:FirstName:Address" -split "(:)" Lastname : @@ -139,6 +138,9 @@ Example: ```powershell $c = "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" $c -split ",", 5 +``` + +```Output Mercury Venus Earth @@ -156,6 +158,9 @@ Example: ```powershell $c = "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" $c -split {$_ -eq "e" -or $_ -eq "p"} +``` + +```Output M rcury,V nus, @@ -173,7 +178,7 @@ Enclose the option name in quotation marks. Options are valid only when the The syntax for the Options parameter is: -```powershell +``` "SimpleMatch [,IgnoreCase]" "[RegexMatch] [,IgnoreCase] [,CultureInvariant] @@ -214,13 +219,16 @@ The unary split operator (`-split `) has higher precedence than a comma. As a result, if you submit a comma-separated list of strings to the unary split operator, only the first string (before the first comma) is split. -To split more than one string, use the binary split operator ( -split -). Enclose all the strings in parentheses, or store the strings in -a variable, and then submit the variable to the split operator. +Use one of the following patterns to split more than one string: + +- Use the binary split operator (\ -split \) +- Enclose all the strings in parentheses +- Store the strings in a variable then submit the variable to the split + operator Consider the following example: -```powershell +``` PS > -split "1 2", "a b" 1 2 @@ -251,7 +259,11 @@ b The following statement splits the string at whitespace. ```powershell -PS > -split "Windows PowerShell 2.0`nWindows PowerShell with remoting" +-split "Windows PowerShell 2.0`nWindows PowerShell with remoting" +``` + +```Output + Windows PowerShell 2.0 @@ -264,7 +276,10 @@ remoting The following statement splits the string at any comma. ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split ',' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split ',' +``` + +```Output Mercury Venus Earth @@ -278,7 +293,10 @@ Neptune The following statement splits the string at the pattern "er". ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split 'er' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split 'er' +``` + +```Output M cury,Venus,Earth,Mars,Jupit ,Saturn,Uranus,Neptune @@ -287,7 +305,10 @@ cury,Venus,Earth,Mars,Jupit The following statement performs a case-sensitive split at the letter "N". ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -cSplit 'N' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -cSplit 'N' +``` + +```Output Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus, eptune ``` @@ -295,7 +316,10 @@ eptune The following statement splits the string at "e" and "t". ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[et]' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[et]' +``` + +```Output M rcury,V nus, @@ -312,8 +336,10 @@ The following statement splits the string at "e" and "r", but limits the resulting substrings to six substrings. ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" ` - -split '[er]', 6 +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[er]', 6 +``` + +```Output M cu @@ -325,7 +351,10 @@ arth,Mars,Jupiter,Saturn,Uranus,Neptune The following statement splits a string into three substrings. ```powershell -PS > "a,b,c,d,e,f,g,h" -split ",", 3 +"a,b,c,d,e,f,g,h" -split ",", 3 +``` + +```Output a b c,d,e,f,g,h @@ -335,7 +364,10 @@ The following statement splits two strings into three substrings. (The limit is applied to each string independently.) ```powershell -PS > "a,b,c,d", "e,f,g,h" -split ",", 3 +"a,b,c,d", "e,f,g,h" -split ",", 3 +``` + +```Output a b c,d @@ -353,13 +385,15 @@ can use options, such as Multiline, only when the Max-substrings value is specified. ```powershell -PS > $a = @' +$a = @' 1The first line. 2The second line. 3The third of three lines. '@ +$a -split "^\d", 0, "multiline" +``` -PS > $a -split "^\d", 0, "multiline" +```Output The first line. @@ -381,8 +415,10 @@ can use options, such as SimpleMatch, only when the Max-substrings value is specified. ```powershell -PS > "This.is.a.test" -split ".", 0, "simplematch" +"This.is.a.test" -split ".", 0, "simplematch" +``` +```Output This is a @@ -393,10 +429,12 @@ The following statement splits the string at one of two delimiters, depending on the value of a variable. ```powershell -PS > $i = 1 -PS > $c = "LastName, FirstName; Address, City, State, Zip" -PS > $c -split {if ($i -lt 1) {$-eq ","} else {$-eq ";"}} +$i = 1 +$c = "LastName, FirstName; Address, City, State, Zip" +$c -split {if ($i -lt 1) {$-eq ","} else {$-eq ";"}} +``` +```Output LastName, FirstName Address, City, State, Zip ``` diff --git a/reference/3.0/Microsoft.PowerShell.Core/New-PSSession.md b/reference/3.0/Microsoft.PowerShell.Core/New-PSSession.md index 13d86433fef5..0bc93758b2c5 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/New-PSSession.md +++ b/reference/3.0/Microsoft.PowerShell.Core/New-PSSession.md @@ -541,7 +541,7 @@ You can pipe a computer name (string), ConnectionURI (URI), or session (PSSessio ### System.Management.Automation.Runspaces.PSSession ## NOTES -* This cmdlet uses the Windows PowerShell remoting infrastructure. To use this cmdlet, the local computer and any remote computers must be configured for Windows PowerShell remoting. For more information, see about_Remote_Requirements (http://go.microsoft.com/fwlink/?LinkID=135187). +* This cmdlet uses the Windows PowerShell remoting infrastructure. To use this cmdlet, the local computer and any remote computers must be configured for Windows PowerShell remoting. For more information, see [about_Remote_Requirements](About/about_Remote_Requirements.md). * To create a PSSession on the local computer, start Windows PowerShell with the "Run as administrator" option. * When you are finished with the PSSession, use the Remove-PSSession cmdlet to delete the PSSession and release its resources. diff --git a/reference/3.0/Microsoft.PowerShell.Management/Get-Content.md b/reference/3.0/Microsoft.PowerShell.Management/Get-Content.md index 04238e93f1d4..8d68eac2331a 100644 --- a/reference/3.0/Microsoft.PowerShell.Management/Get-Content.md +++ b/reference/3.0/Microsoft.PowerShell.Management/Get-Content.md @@ -14,19 +14,23 @@ Gets the content of the item at the specified location. ## SYNTAX ### Path (Default) -``` -Get-Content [-ReadCount ] [-TotalCount ] [-Tail ] [-Path] [-Filter ] - [-Include ] [-Exclude ] [-Force] [-Credential ] [-UseTransaction] - [-Delimiter ] [-Wait] [-Raw] [-Encoding ] [-Stream ] +```powershell +Get-Content [-Path] [-ReadCount ] [-TotalCount ] + [-Tail ] [-Filter ] [-Include ] [-Exclude ] + [-Force] [-Credential ] [-UseTransaction] + [-Delimiter ] [-Wait] [-Raw] + [-Encoding ] [-Stream ] [] ``` ### LiteralPath -``` -Get-Content [-ReadCount ] [-TotalCount ] [-Tail ] -LiteralPath - [-Filter ] [-Include ] [-Exclude ] [-Force] [-Credential ] - [-UseTransaction] [-Delimiter ] [-Wait] [-Raw] [-Encoding ] - [-Stream ] [] +```powershell +Get-Content -LiteralPath [-ReadCount ] [-TotalCount ] + [-Tail ] [-Filter ] [-Include ] [-Exclude ] + [-Force] [-Credential ] [-UseTransaction] + [-Delimiter ] [-Wait] [-Raw] + [-Encoding ] [-Stream ] + [] ``` ## DESCRIPTION @@ -311,7 +315,7 @@ Parameter Sets: Path Aliases: Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: True diff --git a/reference/3.0/Microsoft.PowerShell.Management/Get-Item.md b/reference/3.0/Microsoft.PowerShell.Management/Get-Item.md index 0c5f056c8b0f..959e487fd07f 100644 --- a/reference/3.0/Microsoft.PowerShell.Management/Get-Item.md +++ b/reference/3.0/Microsoft.PowerShell.Management/Get-Item.md @@ -107,10 +107,11 @@ Gets the specified alternate NTFS file stream from the file. Enter the stream na Stream is a dynamic parameter that the FileSystem provider adds to the Get-Item cmdlet. This parameter works only in file system drives. -This parameter is introduced in Windows PowerShell 3.0.```yaml +This parameter is introduced in Windows PowerShell 3.0. +```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -131,7 +132,7 @@ This parameter is not supported by any providers installed with Windows PowerShe ```yaml Type: PSCredential Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -151,7 +152,7 @@ The Exclude parameter is effective only when the command includes the contents o ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -169,7 +170,7 @@ Filters are more efficient than other parameters, because the provider applies t ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -187,7 +188,7 @@ Even using the Force parameter, the cmdlet cannot override security restrictions ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -207,7 +208,7 @@ The Include parameter is effective only when the command includes the contents o ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -247,7 +248,7 @@ Use the wildcard character (*) to specify all the items in the current location. ```yaml Type: String[] Parameter Sets: Path -Aliases: +Aliases: Required: True Position: 1 @@ -297,7 +298,6 @@ The registry values are considered to be properties of the registry key. To list the providers available in your session, type "Get-PsProvider". For more information, see about_Providers. -* ## RELATED LINKS [Clear-Item](Clear-Item.md) diff --git a/reference/3.0/Microsoft.PowerShell.Management/Restart-Computer.md b/reference/3.0/Microsoft.PowerShell.Management/Restart-Computer.md index 8a1fc41671dd..ddc7cdee315d 100644 --- a/reference/3.0/Microsoft.PowerShell.Management/Restart-Computer.md +++ b/reference/3.0/Microsoft.PowerShell.Management/Restart-Computer.md @@ -110,7 +110,7 @@ These settings are designed for enterprises in which DCOM-based restarts fail be Runs the command as a background job. Note: To use this parameter, the local and remote computers must be configured for remoting and, on Windows Vista and later versions of Windows, you must open Windows PowerShell with the "Run as administrator" option. -For more information, see about_Remote_Requirements (http://go.microsoft.com/fwlink/?LinkID=135187). +For more information, see [about_Remote_Requirements](../Microsoft.PowerShell.Core/About/about_Remote_Requirements.md). When you use the **AsJob** parameter, the command immediately returns an object that represents the background job. You can continue to work in the session while the job completes. diff --git a/reference/3.0/Microsoft.PowerShell.Management/Stop-Computer.md b/reference/3.0/Microsoft.PowerShell.Management/Stop-Computer.md index 0ee9543c18f1..9d19e39af832 100644 --- a/reference/3.0/Microsoft.PowerShell.Management/Stop-Computer.md +++ b/reference/3.0/Microsoft.PowerShell.Management/Stop-Computer.md @@ -87,7 +87,7 @@ It also uses the ThrottleLimit parameter to limit the command to 10 concurrent c Runs the command as a background job. Note: To use this parameter, the local and remote computers must be configured for remoting and, on Windows Vista and later versions of Windows, you must open Windows PowerShell with the "Run as administrator" option. -For more information, see about_Remote_Requirements". +For more information, see [about_Remote_Requirements](../Microsoft.PowerShell.Core/About/about_Remote_Requirements.md). When you use the AsJob parameter, the command immediately returns an object that represents the background job. You can continue to work in the session while the job completes. diff --git a/reference/3.0/Microsoft.PowerShell.Utility/Get-Member.md b/reference/3.0/Microsoft.PowerShell.Utility/Get-Member.md index 954078f45989..d364f15c5e28 100644 --- a/reference/3.0/Microsoft.PowerShell.Utility/Get-Member.md +++ b/reference/3.0/Microsoft.PowerShell.Utility/Get-Member.md @@ -13,9 +13,10 @@ title: Get-Member Gets the properties and methods of objects. ## SYNTAX -``` -Get-Member [-InputObject ] [[-Name] ] [-MemberType ] - [-View ] [-Static] [-Force] [] +```powershell +Get-Member [[-Name] ] [-InputObject ] + [-MemberType ] [-View ] [-Static] [-Force] + [] ``` ## DESCRIPTION @@ -332,7 +333,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 1 +Position: 0 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/reference/3.0/Microsoft.PowerShell.Utility/Group-Object.md b/reference/3.0/Microsoft.PowerShell.Utility/Group-Object.md index 21ab7f95fcd4..a9b3bf78c886 100644 --- a/reference/3.0/Microsoft.PowerShell.Utility/Group-Object.md +++ b/reference/3.0/Microsoft.PowerShell.Utility/Group-Object.md @@ -11,11 +11,13 @@ title: Group-Object # Group-Object ## SYNOPSIS Groups objects that contain the same value for specified properties. + ## SYNTAX ``` -Group-Object [-NoElement] [-AsHashTable] [-AsString] [-InputObject ] [[-Property] ] - [-Culture ] [-CaseSensitive] [] +Group-Object [[-Property] ] [-NoElement] [-AsHashTable] [-AsString] + [-InputObject ] [-Culture ] [-CaseSensitive] + [] ``` ## DESCRIPTION @@ -325,7 +327,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 1 +Position: 0 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/reference/3.0/Microsoft.PowerShell.Utility/Select-String.md b/reference/3.0/Microsoft.PowerShell.Utility/Select-String.md index 9852bad4959d..0934d20f8654 100644 --- a/reference/3.0/Microsoft.PowerShell.Utility/Select-String.md +++ b/reference/3.0/Microsoft.PowerShell.Utility/Select-String.md @@ -192,7 +192,7 @@ When Select-String finds more than one match in a line of text, it still emits o ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -208,7 +208,7 @@ By default, matches are not case-sensitive. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -239,7 +239,7 @@ When the context includes a match, the MatchInfo object for each match includes ```yaml Type: Int32[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -259,7 +259,7 @@ Valid values are "UTF7", "UTF8", "UTF32", "ASCII", "Unicode", "BigEndianUnicode" ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -277,7 +277,7 @@ Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -295,7 +295,7 @@ Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -317,7 +317,7 @@ The differences are as follows: ```yaml Type: PSObject Parameter Sets: Object -Aliases: +Aliases: Required: True Position: Named @@ -333,7 +333,7 @@ By default, Select-String returns a MatchInfo object for each match it finds. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -348,7 +348,7 @@ Finds text that does not match the specified pattern. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -368,7 +368,7 @@ If you specify only a directory, the command fails. ```yaml Type: String[] Parameter Sets: File -Aliases: +Aliases: Required: True Position: 2 @@ -387,7 +387,7 @@ To learn about regular expressions, see about_Regular_Expressions. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: True Position: 1 @@ -403,7 +403,7 @@ The value is "true" if the pattern is found; otherwise, the value is "false". ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -420,7 +420,7 @@ It does not interpret the value of the Pattern parameter as a regular expression ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -461,7 +461,7 @@ By default, the output is a set of MatchInfo objects, one for each match found. If you use the Quiet parameter, the output is a Boolean value indicating whether the pattern was found. ## NOTES * Select-String is like the Grep command in UNIX and the FindStr command in Windows. -* The "sst" alias for the Select-String cmdlet was introduced in Windows PowerShell 3.0. +* The **sst** alias for the Select-String cmdlet was introduced in Windows PowerShell 3.0. * To use Select-String, type the text that you want to find as the value of the Pattern parameter. To specify the text to be searched, do the following: diff --git a/reference/3.0/Microsoft.PowerShell.Utility/Tee-Object.md b/reference/3.0/Microsoft.PowerShell.Utility/Tee-Object.md index b6ed18f3dece..2001579b157d 100644 --- a/reference/3.0/Microsoft.PowerShell.Utility/Tee-Object.md +++ b/reference/3.0/Microsoft.PowerShell.Utility/Tee-Object.md @@ -15,17 +15,20 @@ Saves command output in a file or variable and also sends it down the pipeline. ### File (Default) ``` -Tee-Object [-InputObject ] [-FilePath] [-Append] [] +Tee-Object [-FilePath] [-InputObject ] [-Append] + [] ``` ### LiteralFile ``` -Tee-Object [-InputObject ] -LiteralPath [] +Tee-Object -LiteralPath [-InputObject ] + [] ``` ### Variable ``` -Tee-Object [-InputObject ] -Variable [] +Tee-Object -Variable [-InputObject ] + [] ``` ## DESCRIPTION @@ -103,7 +106,7 @@ Parameter Sets: File Aliases: Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: False Accept wildcard characters: True diff --git a/reference/3.0/Microsoft.PowerShell.Utility/Update-TypeData.md b/reference/3.0/Microsoft.PowerShell.Utility/Update-TypeData.md index 844cffefac78..c1ecd88f89ad 100644 --- a/reference/3.0/Microsoft.PowerShell.Utility/Update-TypeData.md +++ b/reference/3.0/Microsoft.PowerShell.Utility/Update-TypeData.md @@ -59,7 +59,8 @@ If you are getting .NET Framework properties, you can work around the suppressio Note that method syntax can only be used with .NET Framework properties. Properties that are added by running the Update-TypeData cmdlet cannot use method syntax. -For more information about the *types.ps1xml files in Windows PowerShell, see about_Types.ps1xml (http://go.microsoft.com/fwlink/?LinkID=113274). +For more information about the *types.ps1xml files in PowerShell, see [about_Types.ps1xml](../Microsoft.PowerShell.Core/About/about_Types.ps1xml.md). + ## EXAMPLES ### Example 1 diff --git a/reference/3.0/PSWorkflow/New-PSWorkflowExecutionOption.md b/reference/3.0/PSWorkflow/New-PSWorkflowExecutionOption.md index 32ef132f0e59..a2303245b219 100644 --- a/reference/3.0/PSWorkflow/New-PSWorkflowExecutionOption.md +++ b/reference/3.0/PSWorkflow/New-PSWorkflowExecutionOption.md @@ -34,7 +34,7 @@ If you omit a parameter, the cmdlet creates the object with a default value for The **New-PSWorkflowExecutionOption** cmdlet is part of the Windows PowerShell Workflow feature. You can also add workflow common parameters to this command. -For more information about workflow common parameters, see about_WorkflowCommonParametershttp://technet.microsoft.com/library/jj129719(v=wps.620).aspx. +For more information about workflow common parameters, see [about_WorkflowCommonParameters](About/about_WorkflowCommonParameters.md). This cmdlet is introduced in Windows PowerShell 3.0. ## EXAMPLES diff --git a/reference/4.0/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md b/reference/4.0/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md index a08a495cb977..e43e89a58ad6 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md +++ b/reference/4.0/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md @@ -501,8 +501,8 @@ right operand determine how many bits of the left operand are shifted. |`21 -shr 31` | 0 | 0000 0000 | 0x00 | |`21 -shr 32` | 21 | 0001 0101 | 0x15 | |`21 -shr 64` | 21 | 0001 0101 | 0x15 | -|`21 -shr 65` | 10 | 0000 1010 | 0x15 | -|`21 -shr 66` | 5 | 0000 0101 | 0x15 | +|`21 -shr 65` | 10 | 0000 1010 | 0x0A | +|`21 -shr 66` | 5 | 0000 0101 | 0x05 | |`[int]::MaxValue -shr 1`| 1073741823 | | 0x3FFFFFFF | |`[int]::MinValue -shr 1`| -1073741824| | 0xC0000000 | |`-1 -shr 1` | -1 | | 0xFFFFFFFF | diff --git a/reference/4.0/Microsoft.PowerShell.Core/About/about_Arrays.md b/reference/4.0/Microsoft.PowerShell.Core/About/about_Arrays.md index ae4224cc1336..385ad7e9e732 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/About/about_Arrays.md +++ b/reference/4.0/Microsoft.PowerShell.Core/About/about_Arrays.md @@ -617,8 +617,8 @@ $a[-1] ``` ```output -0 -0 +1 +1 4 4 ``` diff --git a/reference/4.0/Microsoft.PowerShell.Core/About/about_Split.md b/reference/4.0/Microsoft.PowerShell.Core/About/about_Split.md index 98b97dd2dab7..523bd6d4e3cd 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/About/about_Split.md +++ b/reference/4.0/Microsoft.PowerShell.Core/About/about_Split.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-12-01 +ms.date: 2017-12-20 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -35,11 +35,10 @@ The following diagram shows the syntax for the -split operator. The parameter names do not appear in the command. Include only the parameter values. The values must appear in the order specified in the syntax diagram. -```powershell +``` -Split - +-Split () -Split [,[,""]] - -Split {} [,] ``` @@ -51,14 +50,14 @@ are applied. ## PARAMETERS -### \ +### \ or \ Specifies one or more strings to be split. If you submit multiple strings, all the strings are split using the same delimiter rules. Example: -```powershell +``` -split "red yellow blue green" red yellow @@ -73,7 +72,7 @@ whitespace, including spaces and non-printable characters, such as newline (\`n) and tab (\`t). When the strings are split, the delimiter is omitted from all the substrings. Example: -```powershell +``` "Lastname:FirstName:Address" -split ":" Lastname FirstName @@ -90,7 +89,7 @@ as a split. Examples: -```powershell +``` "Lastname:FirstName:Address" -split "(:)" Lastname : @@ -139,6 +138,9 @@ Example: ```powershell $c = "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" $c -split ",", 5 +``` + +```Output Mercury Venus Earth @@ -156,6 +158,9 @@ Example: ```powershell $c = "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" $c -split {$_ -eq "e" -or $_ -eq "p"} +``` + +```Output M rcury,V nus, @@ -173,7 +178,7 @@ Enclose the option name in quotation marks. Options are valid only when the The syntax for the Options parameter is: -```powershell +``` "SimpleMatch [,IgnoreCase]" "[RegexMatch] [,IgnoreCase] [,CultureInvariant] @@ -214,13 +219,16 @@ The unary split operator (`-split `) has higher precedence than a comma. As a result, if you submit a comma-separated list of strings to the unary split operator, only the first string (before the first comma) is split. -To split more than one string, use the binary split operator ( -split -). Enclose all the strings in parentheses, or store the strings in -a variable, and then submit the variable to the split operator. +Use one of the following patterns to split more than one string: + +- Use the binary split operator (\ -split \) +- Enclose all the strings in parentheses +- Store the strings in a variable then submit the variable to the split + operator Consider the following example: -```powershell +``` PS > -split "1 2", "a b" 1 2 @@ -251,7 +259,11 @@ b The following statement splits the string at whitespace. ```powershell -PS > -split "Windows PowerShell 2.0`nWindows PowerShell with remoting" +-split "Windows PowerShell 2.0`nWindows PowerShell with remoting" +``` + +```Output + Windows PowerShell 2.0 @@ -264,7 +276,10 @@ remoting The following statement splits the string at any comma. ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split ',' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split ',' +``` + +```Output Mercury Venus Earth @@ -278,7 +293,10 @@ Neptune The following statement splits the string at the pattern "er". ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split 'er' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split 'er' +``` + +```Output M cury,Venus,Earth,Mars,Jupit ,Saturn,Uranus,Neptune @@ -287,7 +305,10 @@ cury,Venus,Earth,Mars,Jupit The following statement performs a case-sensitive split at the letter "N". ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -cSplit 'N' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -cSplit 'N' +``` + +```Output Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus, eptune ``` @@ -295,7 +316,10 @@ eptune The following statement splits the string at "e" and "t". ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[et]' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[et]' +``` + +```Output M rcury,V nus, @@ -312,8 +336,10 @@ The following statement splits the string at "e" and "r", but limits the resulting substrings to six substrings. ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" ` - -split '[er]', 6 +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[er]', 6 +``` + +```Output M cu @@ -325,7 +351,10 @@ arth,Mars,Jupiter,Saturn,Uranus,Neptune The following statement splits a string into three substrings. ```powershell -PS > "a,b,c,d,e,f,g,h" -split ",", 3 +"a,b,c,d,e,f,g,h" -split ",", 3 +``` + +```Output a b c,d,e,f,g,h @@ -335,7 +364,10 @@ The following statement splits two strings into three substrings. (The limit is applied to each string independently.) ```powershell -PS > "a,b,c,d", "e,f,g,h" -split ",", 3 +"a,b,c,d", "e,f,g,h" -split ",", 3 +``` + +```Output a b c,d @@ -353,13 +385,15 @@ can use options, such as Multiline, only when the Max-substrings value is specified. ```powershell -PS > $a = @' +$a = @' 1The first line. 2The second line. 3The third of three lines. '@ +$a -split "^\d", 0, "multiline" +``` -PS > $a -split "^\d", 0, "multiline" +```Output The first line. @@ -381,8 +415,10 @@ can use options, such as SimpleMatch, only when the Max-substrings value is specified. ```powershell -PS > "This.is.a.test" -split ".", 0, "simplematch" +"This.is.a.test" -split ".", 0, "simplematch" +``` +```Output This is a @@ -393,10 +429,12 @@ The following statement splits the string at one of two delimiters, depending on the value of a variable. ```powershell -PS > $i = 1 -PS > $c = "LastName, FirstName; Address, City, State, Zip" -PS > $c -split {if ($i -lt 1) {$-eq ","} else {$-eq ";"}} +$i = 1 +$c = "LastName, FirstName; Address, City, State, Zip" +$c -split {if ($i -lt 1) {$-eq ","} else {$-eq ";"}} +``` +```Output LastName, FirstName Address, City, State, Zip ``` diff --git a/reference/4.0/Microsoft.PowerShell.Core/New-PSSession.md b/reference/4.0/Microsoft.PowerShell.Core/New-PSSession.md index 2668bd38063c..9fa265db2749 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/New-PSSession.md +++ b/reference/4.0/Microsoft.PowerShell.Core/New-PSSession.md @@ -557,7 +557,7 @@ You can pipe a computer name (string), ConnectionURI (URI), or session (PSSessio ### System.Management.Automation.Runspaces.PSSession ## NOTES -* This cmdlet uses the Windows PowerShell remoting infrastructure. To use this cmdlet, the local computer and any remote computers must be configured for Windows PowerShell remoting. For more information, see about_Remote_Requirements (http://go.microsoft.com/fwlink/?LinkID=135187). +* This cmdlet uses the Windows PowerShell remoting infrastructure. To use this cmdlet, the local computer and any remote computers must be configured for Windows PowerShell remoting. For more information, see [about_Remote_Requirements](About/about_Remote_Requirements.md). * To create a PSSession on the local computer, start Windows PowerShell with the "Run as administrator" option. * When you are finished with the PSSession, use the Remove-PSSession cmdlet to delete the PSSession and release its resources. diff --git a/reference/4.0/Microsoft.PowerShell.Management/Get-Content.md b/reference/4.0/Microsoft.PowerShell.Management/Get-Content.md index f800a5413a72..f68c52f161b7 100644 --- a/reference/4.0/Microsoft.PowerShell.Management/Get-Content.md +++ b/reference/4.0/Microsoft.PowerShell.Management/Get-Content.md @@ -16,19 +16,23 @@ Gets the content of the item at the specified location. ## SYNTAX ### Path (Default) -``` -Get-Content [-ReadCount ] [-TotalCount ] [-Tail ] [-Path] [-Filter ] - [-Include ] [-Exclude ] [-Force] [-Credential ] [-UseTransaction] - [-Delimiter ] [-Wait] [-Raw] [-Encoding ] [-Stream ] +```powershell +Get-Content [-Path] [-ReadCount ] [-TotalCount ] + [-Tail ] [-Filter ] [-Include ] [-Exclude ] + [-Force] [-Credential ] [-UseTransaction] + [-Delimiter ] [-Wait] [-Raw] + [-Encoding ] [-Stream ] [] ``` ### LiteralPath -``` -Get-Content [-ReadCount ] [-TotalCount ] [-Tail ] -LiteralPath - [-Filter ] [-Include ] [-Exclude ] [-Force] [-Credential ] - [-UseTransaction] [-Delimiter ] [-Wait] [-Raw] [-Encoding ] - [-Stream ] [] +```powershell +Get-Content -LiteralPath [-ReadCount ] [-TotalCount ] + [-Tail ] [-Filter ] [-Include ] [-Exclude ] + [-Force] [-Credential ] [-UseTransaction] + [-Delimiter ] [-Wait] [-Raw] + [-Encoding ] [-Stream ] + [] ``` ## DESCRIPTION @@ -198,7 +202,7 @@ Parameter Sets: Path Aliases: Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: True diff --git a/reference/4.0/Microsoft.PowerShell.Management/Get-Item.md b/reference/4.0/Microsoft.PowerShell.Management/Get-Item.md index 236073b41147..d42b12ee02bb 100644 --- a/reference/4.0/Microsoft.PowerShell.Management/Get-Item.md +++ b/reference/4.0/Microsoft.PowerShell.Management/Get-Item.md @@ -124,7 +124,7 @@ This parameter is not supported by any providers installed with Windows PowerShe ```yaml Type: PSCredential Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -144,7 +144,7 @@ The Exclude parameter is effective only when the command includes the contents o ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -162,7 +162,7 @@ Filters are more efficient than other parameters, because the provider applies t ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -180,7 +180,7 @@ Even using the Force parameter, the cmdlet cannot override security restrictions ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -200,7 +200,7 @@ The Include parameter is effective only when the command includes the contents o ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -240,7 +240,7 @@ Use the wildcard character (*) to specify all the items in the current location. ```yaml Type: String[] Parameter Sets: Path -Aliases: +Aliases: Required: True Position: 1 @@ -288,7 +288,7 @@ This parameter was introduced in Windows PowerShell 3.0. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -324,8 +324,6 @@ The registry values are considered to be properties of the registry key. To list the providers available in your session, type "Get-PsProvider". For more information, see about_Providers. -* - ## RELATED LINKS [Clear-Item](Clear-Item.md) diff --git a/reference/4.0/Microsoft.PowerShell.Management/Restart-Computer.md b/reference/4.0/Microsoft.PowerShell.Management/Restart-Computer.md index 2a8c51709c7e..3f3082be3057 100644 --- a/reference/4.0/Microsoft.PowerShell.Management/Restart-Computer.md +++ b/reference/4.0/Microsoft.PowerShell.Management/Restart-Computer.md @@ -120,7 +120,7 @@ These settings are designed for enterprises in which DCOM-based restarts fail be Runs the command as a background job. Note: To use this parameter, the local and remote computers must be configured for remoting and, on Windows Vista and later versions of Windows, you must open Windows PowerShell with the "Run as administrator" option. -For more information, see about_Remote_Requirements (http://go.microsoft.com/fwlink/?LinkID=135187). +For more information, see [about_Remote_Requirements](../Microsoft.PowerShell.Core/About/about_Remote_Requirements.md). When you use the **AsJob** parameter, the command immediately returns an object that represents the background job. You can continue to work in the session while the job completes. diff --git a/reference/4.0/Microsoft.PowerShell.Management/Stop-Computer.md b/reference/4.0/Microsoft.PowerShell.Management/Stop-Computer.md index 59e473c19536..b6a19dea2805 100644 --- a/reference/4.0/Microsoft.PowerShell.Management/Stop-Computer.md +++ b/reference/4.0/Microsoft.PowerShell.Management/Stop-Computer.md @@ -95,7 +95,7 @@ It also uses the ThrottleLimit parameter to limit the command to 10 concurrent c Runs the command as a background job. Note: To use this parameter, the local and remote computers must be configured for remoting and, on Windows Vista and later versions of Windows, you must open Windows PowerShell with the "Run as administrator" option. -For more information, see about_Remote_Requirements". +For more information, see [about_Remote_Requirements](../Microsoft.PowerShell.Core/About/about_Remote_Requirements.md). When you use the AsJob parameter, the command immediately returns an object that represents the background job. You can continue to work in the session while the job completes. diff --git a/reference/4.0/Microsoft.PowerShell.Utility/Get-FileHash.md b/reference/4.0/Microsoft.PowerShell.Utility/Get-FileHash.md index 63d52939a386..76ec8806cbff 100644 --- a/reference/4.0/Microsoft.PowerShell.Utility/Get-FileHash.md +++ b/reference/4.0/Microsoft.PowerShell.Utility/Get-FileHash.md @@ -75,46 +75,44 @@ The output is piped to the Format-List cmdlet to format the output as a list. ### Example 3: Compute the hash value of a stream and compare the procedure with getting the hash from the file directly ```powershell -PS C:> $testfile = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" - -## open $testfile as a stream -$testfilestream = [System.IO.File]::Open( - $testfile, - [System.IO.FileMode]::Open, - [System.IO.FileAccess]::Read) - -$hashFromStream = Get-FileHash -InputStream $testfilestream -Algorithm MD5 - -$testfilestream.Close() - -$hashFromFile = Get-FileHash -Path $testfile -Algorithm MD5 - -## check both hashes are the same -if(($hashFromStream.Hash) -ne ($hashFromFile.Hash)) { - Write-Error "Get-FileHash results are inconsistent!!" -} -else { - Write-Output "Results from File:" - Write-Output "==================" - $hashFromFile | Format-List - Write-Output " " - Write-Output "Results from Stream:" - Write-Output "====================" - $hashFromStream | Format-List +# Path of Microsoft.PowerShell.Utility.psd1 +$file = (Get-Module Microsoft.PowerShell.Utility).Path + +$hashFromFile = Get-FileHash -Path $file -Algorithm MD5 + +# Open $file as a stream +$stream = [System.IO.File]::OpenRead($file) +$hashFromStream = Get-FileHash -InputStream $stream -Algorithm MD5 +$stream.Close() + +Write-Host '### Hash from File ###' -NoNewline +$hashFromFile | Format-List +Write-Host '### Hash from Stream ###' -NoNewline +$hashFromStream | Format-List + +# Check both hashes are the same +if ($hashFromFile.Hash -eq $hashFromStream.Hash) { + Write-Host 'Get-FileHash results are consistent' -ForegroundColor Green +} else { + Write-Host 'Get-FileHash results are inconsistent!!' -ForegroundColor Red } +``` +```output +### Hash from File ### -Results from File: -================== Algorithm : MD5 -Hash : 097CE5761C89434367598B34FE32893B -Path : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe +Hash : 593D6592BD9B7F9174711AB136F5E751 +Path : C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\Microsoft.Powe + rShell.Utility\Microsoft.PowerShell.Utility.psd1 + +### Hash from Stream ### -Results from Stream: -==================== Algorithm : MD5 -Hash : 097CE5761C89434367598B34FE32893B +Hash : 593D6592BD9B7F9174711AB136F5E751 Path : + +Get-FileHash results are consistent ``` ## PARAMETERS diff --git a/reference/4.0/Microsoft.PowerShell.Utility/Get-Member.md b/reference/4.0/Microsoft.PowerShell.Utility/Get-Member.md index 48eb34b9689e..03013d53f605 100644 --- a/reference/4.0/Microsoft.PowerShell.Utility/Get-Member.md +++ b/reference/4.0/Microsoft.PowerShell.Utility/Get-Member.md @@ -15,9 +15,10 @@ Gets the properties and methods of objects. ## SYNTAX -``` -Get-Member [-InputObject ] [[-Name] ] [-MemberType ] - [-View ] [-Static] [-Force] [] +```powershell +Get-Member [[-Name] ] [-InputObject ] + [-MemberType ] [-View ] [-Static] [-Force] + [] ``` ## DESCRIPTION @@ -342,7 +343,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 1 +Position: 0 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/reference/4.0/Microsoft.PowerShell.Utility/Group-Object.md b/reference/4.0/Microsoft.PowerShell.Utility/Group-Object.md index d504fce222a0..e5225ee55e0e 100644 --- a/reference/4.0/Microsoft.PowerShell.Utility/Group-Object.md +++ b/reference/4.0/Microsoft.PowerShell.Utility/Group-Object.md @@ -16,8 +16,9 @@ Groups objects that contain the same value for specified properties. ## SYNTAX ``` -Group-Object [-NoElement] [-AsHashTable] [-AsString] [-InputObject ] [[-Property] ] - [-Culture ] [-CaseSensitive] [] +Group-Object [[-Property] ] [-NoElement] [-AsHashTable] [-AsString] + [-InputObject ] [-Culture ] [-CaseSensitive] + [] ``` ## DESCRIPTION @@ -337,7 +338,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 1 +Position: 0 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/reference/4.0/Microsoft.PowerShell.Utility/Select-String.md b/reference/4.0/Microsoft.PowerShell.Utility/Select-String.md index c1b6c5b49ab6..099569e2c325 100644 --- a/reference/4.0/Microsoft.PowerShell.Utility/Select-String.md +++ b/reference/4.0/Microsoft.PowerShell.Utility/Select-String.md @@ -204,7 +204,7 @@ When Select-String finds more than one match in a line of text, it still emits o ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -220,7 +220,7 @@ By default, matches are not case-sensitive. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -251,7 +251,7 @@ When the context includes a match, the MatchInfo object for each match includes ```yaml Type: Int32[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -271,7 +271,7 @@ Valid values are "UTF7", "UTF8", "UTF32", "ASCII", "Unicode", "BigEndianUnicode" ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -289,7 +289,7 @@ Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -307,7 +307,7 @@ Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -329,7 +329,7 @@ The differences are as follows: ```yaml Type: PSObject Parameter Sets: Object -Aliases: +Aliases: Required: True Position: Named @@ -345,7 +345,7 @@ By default, Select-String returns a MatchInfo object for each match it finds. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -360,7 +360,7 @@ Finds text that does not match the specified pattern. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -380,7 +380,7 @@ If you specify only a directory, the command fails. ```yaml Type: String[] Parameter Sets: File -Aliases: +Aliases: Required: True Position: 2 @@ -399,7 +399,7 @@ To learn about regular expressions, see about_Regular_Expressions. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: True Position: 1 @@ -415,7 +415,7 @@ The value is "true" if the pattern is found; otherwise, the value is "false". ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -432,7 +432,7 @@ It does not interpret the value of the Pattern parameter as a regular expression ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -476,7 +476,7 @@ If you use the Quiet parameter, the output is a Boolean value indicating whether ## NOTES * Select-String is like the Grep command in UNIX and the FindStr command in Windows. -* The "sst" alias for the Select-String cmdlet was introduced in Windows PowerShell 3.0. +* The **sst** alias for the Select-String cmdlet was introduced in Windows PowerShell 3.0. * To use Select-String, type the text that you want to find as the value of the Pattern parameter. To specify the text to be searched, do the following: diff --git a/reference/4.0/Microsoft.PowerShell.Utility/Tee-Object.md b/reference/4.0/Microsoft.PowerShell.Utility/Tee-Object.md index 10f7c6aa5b9e..9c8de6ab12bd 100644 --- a/reference/4.0/Microsoft.PowerShell.Utility/Tee-Object.md +++ b/reference/4.0/Microsoft.PowerShell.Utility/Tee-Object.md @@ -17,17 +17,20 @@ Saves command output in a file or variable and also sends it down the pipeline. ### File (Default) ``` -Tee-Object [-InputObject ] [-FilePath] [-Append] [] +Tee-Object [-FilePath] [-InputObject ] [-Append] + [] ``` ### LiteralFile ``` -Tee-Object [-InputObject ] -LiteralPath [] +Tee-Object -LiteralPath [-InputObject ] + [] ``` ### Variable ``` -Tee-Object [-InputObject ] -Variable [] +Tee-Object -Variable [-InputObject ] + [] ``` ## DESCRIPTION @@ -109,7 +112,7 @@ Parameter Sets: File Aliases: Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: False Accept wildcard characters: True diff --git a/reference/4.0/Microsoft.PowerShell.Utility/Update-TypeData.md b/reference/4.0/Microsoft.PowerShell.Utility/Update-TypeData.md index 2feec400b9c5..04dc761b9bd0 100644 --- a/reference/4.0/Microsoft.PowerShell.Utility/Update-TypeData.md +++ b/reference/4.0/Microsoft.PowerShell.Utility/Update-TypeData.md @@ -61,7 +61,7 @@ If you are getting .NET Framework properties, you can work around the suppressio Note that method syntax can only be used with .NET Framework properties. Properties that are added by running the Update-TypeData cmdlet cannot use method syntax. -For more information about the *types.ps1xml files in Windows PowerShell, see about_Types.ps1xml (..\Microsoft.PowerShell.Core\About\about_Types.ps1xml.md). +For more information about the *types.ps1xml files in PowerShell, see [about_Types.ps1xml](../Microsoft.PowerShell.Core/About/about_Types.ps1xml.md). ## EXAMPLES diff --git a/reference/4.0/PSWorkflow/New-PSWorkflowExecutionOption.md b/reference/4.0/PSWorkflow/New-PSWorkflowExecutionOption.md index 5af451b1aa8d..aed6220891ee 100644 --- a/reference/4.0/PSWorkflow/New-PSWorkflowExecutionOption.md +++ b/reference/4.0/PSWorkflow/New-PSWorkflowExecutionOption.md @@ -36,7 +36,7 @@ If you omit a parameter, the cmdlet creates the object with a default value for The **New-PSWorkflowExecutionOption** cmdlet is part of the Windows PowerShell Workflow feature. You can also add workflow common parameters to this command. -For more information about workflow common parameters, see about_WorkflowCommonParametershttp://technet.microsoft.com/library/jj129719(v=wps.630).aspx. +For more information about workflow common parameters, see [about_WorkflowCommonParameters](About/about_WorkflowCommonParameters.md). This cmdlet is introduced in Windows PowerShell 3.0. diff --git a/reference/5.0/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md b/reference/5.0/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md index a08a495cb977..e43e89a58ad6 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md +++ b/reference/5.0/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md @@ -501,8 +501,8 @@ right operand determine how many bits of the left operand are shifted. |`21 -shr 31` | 0 | 0000 0000 | 0x00 | |`21 -shr 32` | 21 | 0001 0101 | 0x15 | |`21 -shr 64` | 21 | 0001 0101 | 0x15 | -|`21 -shr 65` | 10 | 0000 1010 | 0x15 | -|`21 -shr 66` | 5 | 0000 0101 | 0x15 | +|`21 -shr 65` | 10 | 0000 1010 | 0x0A | +|`21 -shr 66` | 5 | 0000 0101 | 0x05 | |`[int]::MaxValue -shr 1`| 1073741823 | | 0x3FFFFFFF | |`[int]::MinValue -shr 1`| -1073741824| | 0xC0000000 | |`-1 -shr 1` | -1 | | 0xFFFFFFFF | diff --git a/reference/5.0/Microsoft.PowerShell.Core/About/about_Arrays.md b/reference/5.0/Microsoft.PowerShell.Core/About/about_Arrays.md index ae4224cc1336..385ad7e9e732 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/About/about_Arrays.md +++ b/reference/5.0/Microsoft.PowerShell.Core/About/about_Arrays.md @@ -617,8 +617,8 @@ $a[-1] ``` ```output -0 -0 +1 +1 4 4 ``` diff --git a/reference/5.0/Microsoft.PowerShell.Core/About/about_Split.md b/reference/5.0/Microsoft.PowerShell.Core/About/about_Split.md index 98b97dd2dab7..523bd6d4e3cd 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/About/about_Split.md +++ b/reference/5.0/Microsoft.PowerShell.Core/About/about_Split.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-12-01 +ms.date: 2017-12-20 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -35,11 +35,10 @@ The following diagram shows the syntax for the -split operator. The parameter names do not appear in the command. Include only the parameter values. The values must appear in the order specified in the syntax diagram. -```powershell +``` -Split - +-Split () -Split [,[,""]] - -Split {} [,] ``` @@ -51,14 +50,14 @@ are applied. ## PARAMETERS -### \ +### \ or \ Specifies one or more strings to be split. If you submit multiple strings, all the strings are split using the same delimiter rules. Example: -```powershell +``` -split "red yellow blue green" red yellow @@ -73,7 +72,7 @@ whitespace, including spaces and non-printable characters, such as newline (\`n) and tab (\`t). When the strings are split, the delimiter is omitted from all the substrings. Example: -```powershell +``` "Lastname:FirstName:Address" -split ":" Lastname FirstName @@ -90,7 +89,7 @@ as a split. Examples: -```powershell +``` "Lastname:FirstName:Address" -split "(:)" Lastname : @@ -139,6 +138,9 @@ Example: ```powershell $c = "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" $c -split ",", 5 +``` + +```Output Mercury Venus Earth @@ -156,6 +158,9 @@ Example: ```powershell $c = "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" $c -split {$_ -eq "e" -or $_ -eq "p"} +``` + +```Output M rcury,V nus, @@ -173,7 +178,7 @@ Enclose the option name in quotation marks. Options are valid only when the The syntax for the Options parameter is: -```powershell +``` "SimpleMatch [,IgnoreCase]" "[RegexMatch] [,IgnoreCase] [,CultureInvariant] @@ -214,13 +219,16 @@ The unary split operator (`-split `) has higher precedence than a comma. As a result, if you submit a comma-separated list of strings to the unary split operator, only the first string (before the first comma) is split. -To split more than one string, use the binary split operator ( -split -). Enclose all the strings in parentheses, or store the strings in -a variable, and then submit the variable to the split operator. +Use one of the following patterns to split more than one string: + +- Use the binary split operator (\ -split \) +- Enclose all the strings in parentheses +- Store the strings in a variable then submit the variable to the split + operator Consider the following example: -```powershell +``` PS > -split "1 2", "a b" 1 2 @@ -251,7 +259,11 @@ b The following statement splits the string at whitespace. ```powershell -PS > -split "Windows PowerShell 2.0`nWindows PowerShell with remoting" +-split "Windows PowerShell 2.0`nWindows PowerShell with remoting" +``` + +```Output + Windows PowerShell 2.0 @@ -264,7 +276,10 @@ remoting The following statement splits the string at any comma. ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split ',' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split ',' +``` + +```Output Mercury Venus Earth @@ -278,7 +293,10 @@ Neptune The following statement splits the string at the pattern "er". ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split 'er' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split 'er' +``` + +```Output M cury,Venus,Earth,Mars,Jupit ,Saturn,Uranus,Neptune @@ -287,7 +305,10 @@ cury,Venus,Earth,Mars,Jupit The following statement performs a case-sensitive split at the letter "N". ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -cSplit 'N' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -cSplit 'N' +``` + +```Output Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus, eptune ``` @@ -295,7 +316,10 @@ eptune The following statement splits the string at "e" and "t". ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[et]' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[et]' +``` + +```Output M rcury,V nus, @@ -312,8 +336,10 @@ The following statement splits the string at "e" and "r", but limits the resulting substrings to six substrings. ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" ` - -split '[er]', 6 +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[er]', 6 +``` + +```Output M cu @@ -325,7 +351,10 @@ arth,Mars,Jupiter,Saturn,Uranus,Neptune The following statement splits a string into three substrings. ```powershell -PS > "a,b,c,d,e,f,g,h" -split ",", 3 +"a,b,c,d,e,f,g,h" -split ",", 3 +``` + +```Output a b c,d,e,f,g,h @@ -335,7 +364,10 @@ The following statement splits two strings into three substrings. (The limit is applied to each string independently.) ```powershell -PS > "a,b,c,d", "e,f,g,h" -split ",", 3 +"a,b,c,d", "e,f,g,h" -split ",", 3 +``` + +```Output a b c,d @@ -353,13 +385,15 @@ can use options, such as Multiline, only when the Max-substrings value is specified. ```powershell -PS > $a = @' +$a = @' 1The first line. 2The second line. 3The third of three lines. '@ +$a -split "^\d", 0, "multiline" +``` -PS > $a -split "^\d", 0, "multiline" +```Output The first line. @@ -381,8 +415,10 @@ can use options, such as SimpleMatch, only when the Max-substrings value is specified. ```powershell -PS > "This.is.a.test" -split ".", 0, "simplematch" +"This.is.a.test" -split ".", 0, "simplematch" +``` +```Output This is a @@ -393,10 +429,12 @@ The following statement splits the string at one of two delimiters, depending on the value of a variable. ```powershell -PS > $i = 1 -PS > $c = "LastName, FirstName; Address, City, State, Zip" -PS > $c -split {if ($i -lt 1) {$-eq ","} else {$-eq ";"}} +$i = 1 +$c = "LastName, FirstName; Address, City, State, Zip" +$c -split {if ($i -lt 1) {$-eq ","} else {$-eq ";"}} +``` +```Output LastName, FirstName Address, City, State, Zip ``` diff --git a/reference/5.0/Microsoft.PowerShell.Core/New-PSSession.md b/reference/5.0/Microsoft.PowerShell.Core/New-PSSession.md index 3e114fc85451..d9783d2476d3 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/New-PSSession.md +++ b/reference/5.0/Microsoft.PowerShell.Core/New-PSSession.md @@ -567,7 +567,7 @@ You can pipe a string, URI, or session object to this cmdlet. ### System.Management.Automation.Runspaces.PSSession ## NOTES -* This cmdlet uses the Windows PowerShell remoting infrastructure. To use this cmdlet, the local computer and any remote computers must be configured for Windows PowerShell remoting. For more information, see about_Remote_Requirements (http://go.microsoft.com/fwlink/?LinkID=135187). +* This cmdlet uses the Windows PowerShell remoting infrastructure. To use this cmdlet, the local computer and any remote computers must be configured for Windows PowerShell remoting. For more information, see [about_Remote_Requirements](About/about_Remote_Requirements.md). * To create a **PSSession** on the local computer, start Windows PowerShell with the Run as administrator option. * When you are finished with the **PSSession**, use the Remove-PSSession cmdlet to delete the **PSSession** and release its resources. diff --git a/reference/5.0/Microsoft.PowerShell.Management/Get-Content.md b/reference/5.0/Microsoft.PowerShell.Management/Get-Content.md index 2e35c6b18336..3c363fae179e 100644 --- a/reference/5.0/Microsoft.PowerShell.Management/Get-Content.md +++ b/reference/5.0/Microsoft.PowerShell.Management/Get-Content.md @@ -16,19 +16,23 @@ Gets the content of the item at the specified location. ## SYNTAX ### Path (Default) -``` -Get-Content [-ReadCount ] [-TotalCount ] [-Tail ] [-Path] [-Filter ] - [-Include ] [-Exclude ] [-Force] [-Credential ] [-UseTransaction] - [-Delimiter ] [-Wait] [-Raw] [-Encoding ] [-Stream ] +```powershell +Get-Content [-Path] [-ReadCount ] [-TotalCount ] + [-Tail ] [-Filter ] [-Include ] [-Exclude ] + [-Force] [-Credential ] [-UseTransaction] + [-Delimiter ] [-Wait] [-Raw] + [-Encoding ] [-Stream ] [] ``` ### LiteralPath -``` -Get-Content [-ReadCount ] [-TotalCount ] [-Tail ] -LiteralPath - [-Filter ] [-Include ] [-Exclude ] [-Force] [-Credential ] - [-UseTransaction] [-Delimiter ] [-Wait] [-Raw] [-Encoding ] - [-Stream ] [] +```powershell +Get-Content -LiteralPath [-ReadCount ] [-TotalCount ] + [-Tail ] [-Filter ] [-Include ] [-Exclude ] + [-Force] [-Credential ] [-UseTransaction] + [-Delimiter ] [-Wait] [-Raw] + [-Encoding ] [-Stream ] + [] ``` ## DESCRIPTION diff --git a/reference/5.0/Microsoft.PowerShell.Management/Get-Item.md b/reference/5.0/Microsoft.PowerShell.Management/Get-Item.md index a3c15c3316aa..1964d31f0ac9 100644 --- a/reference/5.0/Microsoft.PowerShell.Management/Get-Item.md +++ b/reference/5.0/Microsoft.PowerShell.Management/Get-Item.md @@ -39,11 +39,7 @@ This cmdlet is used by Windows PowerShell providers to navigate through differen ``` PS C:\> Get-Item . - - - - -Directory: C:\ +Directory: C:\ Mode LastWriteTime Length Name ---- ------------- ------ ---- d---- 7/26/2006 10:01 AM ps-test @@ -56,16 +52,6 @@ The dot (.) represents the item at the current location (not its contents). ``` PS C:\> Get-Item * - - - - - - - - - - Directory: C:\ps-test Mode LastWriteTime Length Name ---- ------------- ------ ---- @@ -138,7 +124,7 @@ This parameter is not supported by any providers installed with Windows PowerShe ```yaml Type: PSCredential Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -158,7 +144,7 @@ The *Exclude* parameter is effective only when the command includes the contents ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -176,7 +162,7 @@ Filters are more efficient than other parameters, because the provider applies t ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -194,7 +180,7 @@ Even using the *Force* parameter, the cmdlet cannot override security restrictio ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -214,7 +200,7 @@ The *Include* parameter is effective only when the command includes the contents ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -254,13 +240,13 @@ Use the wildcard character (*) to specify all the items in the current location. ```yaml Type: String[] Parameter Sets: Path -Aliases: +Aliases: Required: True Position: 0 Default value: None Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False +Accept wildcard characters: True ``` ### -Stream @@ -283,7 +269,7 @@ This parameter was introduced in Windows PowerShell 3.0. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -338,8 +324,6 @@ The registry values are considered to be properties of the registry key. To list the providers available in your session, type `Get-PsProvider`. For more information, see about_Providers. -* - ## RELATED LINKS [Clear-Item](Clear-Item.md) diff --git a/reference/5.0/Microsoft.PowerShell.Management/Restart-Computer.md b/reference/5.0/Microsoft.PowerShell.Management/Restart-Computer.md index 01e756d47fde..0fa793265e8c 100644 --- a/reference/5.0/Microsoft.PowerShell.Management/Restart-Computer.md +++ b/reference/5.0/Microsoft.PowerShell.Management/Restart-Computer.md @@ -119,7 +119,7 @@ These settings are designed for enterprises in which DCOM-based restarts fail be Indicates that this cmdlet runs as a background job. To use this parameter, the local and remote computers must be configured for remoting and, on Windows Vista and later versions of the Windows operating system, you must open Windows PowerShell by using the Run as administrator option. -For more information, see about_Remote_Requirements (http://go.microsoft.com/fwlink/?LinkID=135187). +For more information, see [about_Remote_Requirements](../Microsoft.PowerShell.Core/About/about_Remote_Requirements.md). When you specify the *AsJob* parameter, the command immediately returns an object that represents the background job. You can continue to work in the session while the job finishes. diff --git a/reference/5.0/Microsoft.PowerShell.Utility/Get-FileHash.md b/reference/5.0/Microsoft.PowerShell.Utility/Get-FileHash.md index 0dd967722ecb..8723a9cab1dd 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/Get-FileHash.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/Get-FileHash.md @@ -74,46 +74,44 @@ The output is piped to the Format-List cmdlet to format the output as a list. ### Example 3: Compute the hash value of a stream and compare the procedure with getting the hash from the file directly ```powershell -PS C:\> $testfile = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" - -## open $testfile as a stream -$testfilestream = [System.IO.File]::Open( - $testfile, - [System.IO.FileMode]::Open, - [System.IO.FileAccess]::Read) - -$hashFromStream = Get-FileHash -InputStream $testfilestream -Algorithm MD5 - -$testfilestream.Close() - -$hashFromFile = Get-FileHash -Path $testfile -Algorithm MD5 - -## check both hashes are the same -if(($hashFromStream.Hash) -ne ($hashFromFile.Hash)) { - Write-Error "Get-FileHash results are inconsistent!!" -} -else { - Write-Output "Results from File:" - Write-Output "==================" - $hashFromFile | Format-List - Write-Output " " - Write-Output "Results from Stream:" - Write-Output "====================" - $hashFromStream | Format-List +# Path of Microsoft.PowerShell.Utility.psd1 +$file = (Get-Module Microsoft.PowerShell.Utility).Path + +$hashFromFile = Get-FileHash -Path $file -Algorithm MD5 + +# Open $file as a stream +$stream = [System.IO.File]::OpenRead($file) +$hashFromStream = Get-FileHash -InputStream $stream -Algorithm MD5 +$stream.Close() + +Write-Host '### Hash from File ###' -NoNewline +$hashFromFile | Format-List +Write-Host '### Hash from Stream ###' -NoNewline +$hashFromStream | Format-List + +# Check both hashes are the same +if ($hashFromFile.Hash -eq $hashFromStream.Hash) { + Write-Host 'Get-FileHash results are consistent' -ForegroundColor Green +} else { + Write-Host 'Get-FileHash results are inconsistent!!' -ForegroundColor Red } +``` +```output +### Hash from File ### -Results from File: -================== Algorithm : MD5 -Hash : 097CE5761C89434367598B34FE32893B -Path : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe +Hash : 593D6592BD9B7F9174711AB136F5E751 +Path : C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\Microsoft.Powe + rShell.Utility\Microsoft.PowerShell.Utility.psd1 + +### Hash from Stream ### -Results from Stream: -==================== Algorithm : MD5 -Hash : 097CE5761C89434367598B34FE32893B +Hash : 593D6592BD9B7F9174711AB136F5E751 Path : + +Get-FileHash results are consistent ``` ## PARAMETERS diff --git a/reference/5.0/Microsoft.PowerShell.Utility/Get-Member.md b/reference/5.0/Microsoft.PowerShell.Utility/Get-Member.md index 420debf1684a..fc77c370bcb4 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/Get-Member.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/Get-Member.md @@ -15,9 +15,10 @@ Gets the properties and methods of objects. ## SYNTAX -``` -Get-Member [-InputObject ] [[-Name] ] [-MemberType ] - [-View ] [-Static] [-Force] [] +```powershell +Get-Member [[-Name] ] [-InputObject ] + [-MemberType ] [-View ] [-Static] [-Force] + [] ``` ## DESCRIPTION diff --git a/reference/5.0/Microsoft.PowerShell.Utility/Group-Object.md b/reference/5.0/Microsoft.PowerShell.Utility/Group-Object.md index 1dc7b6a684c2..a3bde2c8b12c 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/Group-Object.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/Group-Object.md @@ -16,8 +16,9 @@ Groups objects that contain the same value for specified properties. ## SYNTAX ``` -Group-Object [-NoElement] [-AsHashTable] [-AsString] [-InputObject ] [[-Property] ] - [-Culture ] [-CaseSensitive] [] +Group-Object [[-Property] ] [-NoElement] [-AsHashTable] [-AsString] + [-InputObject ] [-Culture ] [-CaseSensitive] + [] ``` ## DESCRIPTION diff --git a/reference/5.0/Microsoft.PowerShell.Utility/Select-String.md b/reference/5.0/Microsoft.PowerShell.Utility/Select-String.md index e255f4c64a7a..ffdfd934d2c1 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/Select-String.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/Select-String.md @@ -200,7 +200,7 @@ When **Select-String** finds more than one match in a line of text, it still emi ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -216,7 +216,7 @@ By default, matches are not case-sensitive. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -247,7 +247,7 @@ When the context includes a match, the **MatchInfo** object for each match inclu ```yaml Type: Int32[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -277,7 +277,7 @@ OEM is the current original equipment manufacturer code page identifier for the ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Accepted values: unicode, utf7, utf8, utf32, ascii, bigendianunicode, default, oem Required: False @@ -296,7 +296,7 @@ Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -314,7 +314,7 @@ Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -336,7 +336,7 @@ The differences are as follows: ```yaml Type: PSObject Parameter Sets: Object -Aliases: +Aliases: Required: True Position: Named @@ -352,7 +352,7 @@ By default, **Select-String** returns a **MatchInfo** object for each match it f ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -386,7 +386,7 @@ Indicates that the cmdlet finds text that does not match the specified pattern. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -406,7 +406,7 @@ If you specify only a directory, the command fails. ```yaml Type: String[] Parameter Sets: File -Aliases: +Aliases: Required: True Position: 1 @@ -425,7 +425,7 @@ To learn about regular expressions, see about_Regular_Expressions. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: True Position: 0 @@ -441,7 +441,7 @@ The value is True if the pattern is found; otherwise, the value is False. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -458,7 +458,7 @@ It does not interpret the value of the *Pattern* parameter as a regular expressi ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -483,7 +483,7 @@ If you use the *Quiet* parameter, the output is a Boolean value indicating wheth ## NOTES * **Select-String** is like the Grep command in UNIX and the FindStr command in Windows. -* The **sst** alias for the **Select-String** cmdlet was introduced in Windows PowerShell 3.0. +* The **sls** alias for the **Select-String** cmdlet was introduced in Windows PowerShell 3.0. * To use **Select-String**, type the text that you want to find as the value of the *Pattern* parameter. To specify the text to be searched, do the following: diff --git a/reference/5.0/Microsoft.PowerShell.Utility/Tee-Object.md b/reference/5.0/Microsoft.PowerShell.Utility/Tee-Object.md index 64bd44ead3ba..772546e26984 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/Tee-Object.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/Tee-Object.md @@ -17,17 +17,20 @@ Saves command output in a file or variable and also sends it down the pipeline. ### File (Default) ``` -Tee-Object [-InputObject ] [-FilePath] [-Append] [] +Tee-Object [-FilePath] [-InputObject ] [-Append] + [] ``` ### LiteralFile ``` -Tee-Object [-InputObject ] -LiteralPath [] +Tee-Object -LiteralPath [-InputObject ] + [] ``` ### Variable ``` -Tee-Object [-InputObject ] -Variable [] +Tee-Object -Variable [-InputObject ] + [] ``` ## DESCRIPTION diff --git a/reference/5.0/Microsoft.PowerShell.Utility/Update-TypeData.md b/reference/5.0/Microsoft.PowerShell.Utility/Update-TypeData.md index b9277d09b46b..0e3c0ac548db 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/Update-TypeData.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/Update-TypeData.md @@ -61,7 +61,7 @@ If you are getting .NET Framework properties, you can work around the suppressio Note that method syntax can only be used with .NET Framework properties. Properties that are added by running the **Update-TypeData** cmdlet cannot use method syntax. -For more information about the *types.ps1xml files in Windows PowerShell, see about_Types.ps1xml (..\Microsoft.PowerShell.Core\About\about_Types.ps1xml.md). +For more information about the *types.ps1xml files in PowerShell, see [about_Types.ps1xml](../Microsoft.PowerShell.Core/About/about_Types.ps1xml.md). ## EXAMPLES diff --git a/reference/5.0/PSDesiredStateConfiguration/Disable-DscDebug.md b/reference/5.0/PSDesiredStateConfiguration/Disable-DscDebug.md index b07bfe49f555..e4b413daf3aa 100644 --- a/reference/5.0/PSDesiredStateConfiguration/Disable-DscDebug.md +++ b/reference/5.0/PSDesiredStateConfiguration/Disable-DscDebug.md @@ -52,7 +52,7 @@ To manage the job, use the Job cmdlets. To get the job results, use the Receive-Job cmdlet. To use this parameter, the local and remote computers must be configured for remoting, and on Windows Vista and later versions of the Windows operating system, you must open Windows PowerShell with the Run as administrator option. -For more information, see about_Remote_Requirementshttp://go.microsoft.com/fwlink/?LinkId=623526 (http://go.microsoft.com/fwlink/?LinkId=623526). +For more information, see [about_Remote_Requirements](../Microsoft.PowerShell.Core/About/about_Remote_Requirements.md). For more information about Windows PowerShell background jobs, see [about_Jobs](../Microsoft.PowerShell.Core/About/about_Jobs.md) and [about_Remote_Jobs](../Microsoft.PowerShell.Core/About/about_Remote_Jobs.md). diff --git a/reference/5.0/PSDesiredStateConfiguration/Enable-DscDebug.md b/reference/5.0/PSDesiredStateConfiguration/Enable-DscDebug.md index 9519c1bfa181..4c15d38e03a0 100644 --- a/reference/5.0/PSDesiredStateConfiguration/Enable-DscDebug.md +++ b/reference/5.0/PSDesiredStateConfiguration/Enable-DscDebug.md @@ -53,7 +53,7 @@ To manage the job, use the Job cmdlets. To get the job results, use the Receive-Job cmdlet. To use this parameter, the local and remote computers must be configured for remoting, and on Windows Vista and later versions of the Windows operating system, you must open Windows PowerShell with the Run as administrator option. -For more information, see about_Remote_Requirementshttp://go.microsoft.com/fwlink/?LinkId=623526 (http://go.microsoft.com/fwlink/?LinkId=623526). +For more information, see [about_Remote_Requirements](../Microsoft.PowerShell.Core/About/about_Remote_Requirements.md). For more information about Windows PowerShell background jobs, see [about_Jobs](../Microsoft.PowerShell.Core/About/about_Jobs.md) and [about_Remote_Jobs](../Microsoft.PowerShell.Core/About/about_Remote_Jobs.md). diff --git a/reference/5.0/PSDesiredStateConfiguration/Get-DscConfiguration.md b/reference/5.0/PSDesiredStateConfiguration/Get-DscConfiguration.md index 2a7b24fee892..d394eaab616a 100644 --- a/reference/5.0/PSDesiredStateConfiguration/Get-DscConfiguration.md +++ b/reference/5.0/PSDesiredStateConfiguration/Get-DscConfiguration.md @@ -61,7 +61,7 @@ To manage the job, use the Job cmdlets. To get the job results, use the Receive-Job cmdlet. To use this parameter, the local and remote computers must be configured for remoting, and on Windows Vista and later versions of the Windows operating system, you must open Windows PowerShell with the Run as administrator option. -For more information, see about_Remote_Requirementshttp://go.microsoft.com/fwlink/?LinkId=623526 (http://go.microsoft.com/fwlink/?LinkId=623526). +For more information, see [about_Remote_Requirements](../Microsoft.PowerShell.Core/About/about_Remote_Requirements.md). For more information about Windows PowerShell background jobs, see [about_Jobs](../Microsoft.PowerShell.Core/About/about_Jobs.md) and [about_Remote_Jobs](../Microsoft.PowerShell.Core/About/about_Remote_Jobs.md). diff --git a/reference/5.0/PSDesiredStateConfiguration/Get-DscConfigurationStatus.md b/reference/5.0/PSDesiredStateConfiguration/Get-DscConfigurationStatus.md index d05b7d341421..57af1f96c59f 100644 --- a/reference/5.0/PSDesiredStateConfiguration/Get-DscConfigurationStatus.md +++ b/reference/5.0/PSDesiredStateConfiguration/Get-DscConfigurationStatus.md @@ -76,7 +76,7 @@ To manage the job, use the Job cmdlets. To get the job results, use the Receive-Job cmdlet. To use this parameter, the local and remote computers must be configured for remoting, and on Windows Vista and later versions of the Windows operating system, you must open Windows PowerShell with the Run as administrator option. -For more information, see about_Remote_Requirementshttp://go.microsoft.com/fwlink/?LinkId=623526 (http://go.microsoft.com/fwlink/?LinkId=623526). +For more information, see [about_Remote_Requirements](../Microsoft.PowerShell.Core/About/about_Remote_Requirements.md). For more information about Windows PowerShell background jobs, see [about_Jobs](../Microsoft.PowerShell.Core/About/about_Jobs.md) and [about_Remote_Jobs](../Microsoft.PowerShell.Core/About/about_Remote_Jobs.md). diff --git a/reference/5.0/PSDesiredStateConfiguration/Get-DscLocalConfigurationManager.md b/reference/5.0/PSDesiredStateConfiguration/Get-DscLocalConfigurationManager.md index fab2e62d3f9b..cff12ebd393d 100644 --- a/reference/5.0/PSDesiredStateConfiguration/Get-DscLocalConfigurationManager.md +++ b/reference/5.0/PSDesiredStateConfiguration/Get-DscLocalConfigurationManager.md @@ -62,7 +62,7 @@ To manage the job, use the Job cmdlets. To get the job results, use the Receive-Job cmdlet. To use this parameter, the local and remote computers must be configured for remoting, and on Windows Vista and later versions of the Windows operating system, you must open Windows PowerShell with the Run as administrator option. -For more information, see about_Remote_Requirementshttp://go.microsoft.com/fwlink/?LinkId=623526 (http://go.microsoft.com/fwlink/?LinkId=623526). +For more information, see [about_Remote_Requirements](../Microsoft.PowerShell.Core/About/about_Remote_Requirements.md). For more information about Windows PowerShell background jobs, see [about_Jobs](../Microsoft.PowerShell.Core/About/about_Jobs.md) and [about_Remote_Jobs](../Microsoft.PowerShell.Core/About/about_Remote_Jobs.md). diff --git a/reference/5.0/PSDesiredStateConfiguration/Remove-DscConfigurationDocument.md b/reference/5.0/PSDesiredStateConfiguration/Remove-DscConfigurationDocument.md index ba5274ed6aa5..1f384839360e 100644 --- a/reference/5.0/PSDesiredStateConfiguration/Remove-DscConfigurationDocument.md +++ b/reference/5.0/PSDesiredStateConfiguration/Remove-DscConfigurationDocument.md @@ -54,7 +54,7 @@ To manage the job, use the Job cmdlets. To get the job results, use the Receive-Job cmdlet. To use this parameter, the local and remote computers must be configured for remoting, and on Windows Vista and later versions of the Windows operating system, you must open Windows PowerShell with the Run as administrator option. -For more information, see about_Remote_Requirementshttp://go.microsoft.com/fwlink/?LinkId=623526 (http://go.microsoft.com/fwlink/?LinkId=623526). +For more information, see [about_Remote_Requirements](../Microsoft.PowerShell.Core/About/about_Remote_Requirements.md). For more information about Windows PowerShell background jobs, see [about_Jobs](../Microsoft.PowerShell.Core/About/about_Jobs.md) and [about_Remote_Jobs](../Microsoft.PowerShell.Core/About/about_Remote_Jobs.md). diff --git a/reference/5.0/PSDesiredStateConfiguration/Restore-DscConfiguration.md b/reference/5.0/PSDesiredStateConfiguration/Restore-DscConfiguration.md index 98babda9bb03..c9f7f29c0eae 100644 --- a/reference/5.0/PSDesiredStateConfiguration/Restore-DscConfiguration.md +++ b/reference/5.0/PSDesiredStateConfiguration/Restore-DscConfiguration.md @@ -65,7 +65,7 @@ To manage the job, use the Job cmdlets. To get the job results, use the Receive-Job cmdlet. To use this parameter, the local and remote computers must be configured for remoting, and on Windows Vista and later versions of the Windows operating system, you must open Windows PowerShell with the Run as administrator option. -For more information, see about_Remote_Requirementshttp://go.microsoft.com/fwlink/?LinkId=623526 (http://go.microsoft.com/fwlink/?LinkId=623526). +For more information, see [about_Remote_Requirements](../Microsoft.PowerShell.Core/About/about_Remote_Requirements.md). For more information about Windows PowerShell background jobs, see [about_Jobs](../Microsoft.PowerShell.Core/About/about_Jobs.md) and [about_Remote_Jobs](../Microsoft.PowerShell.Core/About/about_Remote_Jobs.md). diff --git a/reference/5.0/PSDesiredStateConfiguration/Stop-DscConfiguration.md b/reference/5.0/PSDesiredStateConfiguration/Stop-DscConfiguration.md index fff26c6b5a22..22f5ad386761 100644 --- a/reference/5.0/PSDesiredStateConfiguration/Stop-DscConfiguration.md +++ b/reference/5.0/PSDesiredStateConfiguration/Stop-DscConfiguration.md @@ -56,7 +56,7 @@ To manage the job, use the Job cmdlets. To get the job results, use the Receive-Job cmdlet. To use this parameter, the local and remote computers must be configured for remoting, and on Windows Vista and later versions of the Windows operating system, you must open Windows PowerShell with the Run as administrator option. -For more information, see about_Remote_Requirementshttp://go.microsoft.com/fwlink/?LinkId=623526 (http://go.microsoft.com/fwlink/?LinkId=623526). +For more information, see [about_Remote_Requirements](../Microsoft.PowerShell.Core/About/about_Remote_Requirements.md). For more information about Windows PowerShell background jobs, see [about_Jobs](../Microsoft.PowerShell.Core/About/about_Jobs.md) and [about_Remote_Jobs](../Microsoft.PowerShell.Core/About/about_Remote_Jobs.md). diff --git a/reference/5.0/PSDesiredStateConfiguration/Test-DscConfiguration.md b/reference/5.0/PSDesiredStateConfiguration/Test-DscConfiguration.md index 4fa7dbdfa609..e0ce6c4455ca 100644 --- a/reference/5.0/PSDesiredStateConfiguration/Test-DscConfiguration.md +++ b/reference/5.0/PSDesiredStateConfiguration/Test-DscConfiguration.md @@ -118,7 +118,7 @@ To manage the job, use the Job cmdlets. To get the job results, use the Receive-Job cmdlet. To use this parameter, the local and remote computers must be configured for remoting, and on Windows Vista and later versions of the Windows operating system, you must open Windows PowerShell with the Run as administrator option. -For more information, see about_Remote_Requirementshttp://go.microsoft.com/fwlink/?LinkId=623526 (http://go.microsoft.com/fwlink/?LinkId=623526). +For more information, see [about_Remote_Requirements](../Microsoft.PowerShell.Core/About/about_Remote_Requirements.md). For more information about Windows PowerShell background jobs, see [about_Jobs](../Microsoft.PowerShell.Core/About/about_Jobs.md) and [about_Remote_Jobs](../Microsoft.PowerShell.Core/About/about_Remote_Jobs.md). diff --git a/reference/5.0/PSWorkflow/New-PSWorkflowExecutionOption.md b/reference/5.0/PSWorkflow/New-PSWorkflowExecutionOption.md index 706681305c09..8ac686ea2fa5 100644 --- a/reference/5.0/PSWorkflow/New-PSWorkflowExecutionOption.md +++ b/reference/5.0/PSWorkflow/New-PSWorkflowExecutionOption.md @@ -36,7 +36,7 @@ If you do not specify a parameter, the cmdlet creates the object that has a defa The **New-PSWorkflowExecutionOption** cmdlet is part of the Windows PowerShell Workflow feature. You can also add workflow common parameters to this command. -For more information about workflow common parameters, see about_WorkflowCommonParameters. +For more information about workflow common parameters, see [about_WorkflowCommonParameters](About/about_WorkflowCommonParameters.md). This cmdlet was introduced in Windows PowerShell 3.0. diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md index a08a495cb977..e43e89a58ad6 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md @@ -501,8 +501,8 @@ right operand determine how many bits of the left operand are shifted. |`21 -shr 31` | 0 | 0000 0000 | 0x00 | |`21 -shr 32` | 21 | 0001 0101 | 0x15 | |`21 -shr 64` | 21 | 0001 0101 | 0x15 | -|`21 -shr 65` | 10 | 0000 1010 | 0x15 | -|`21 -shr 66` | 5 | 0000 0101 | 0x15 | +|`21 -shr 65` | 10 | 0000 1010 | 0x0A | +|`21 -shr 66` | 5 | 0000 0101 | 0x05 | |`[int]::MaxValue -shr 1`| 1073741823 | | 0x3FFFFFFF | |`[int]::MinValue -shr 1`| -1073741824| | 0xC0000000 | |`-1 -shr 1` | -1 | | 0xFFFFFFFF | diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Arrays.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Arrays.md index ae4224cc1336..385ad7e9e732 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Arrays.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Arrays.md @@ -617,8 +617,8 @@ $a[-1] ``` ```output -0 -0 +1 +1 4 4 ``` diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Split.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Split.md index 98b97dd2dab7..523bd6d4e3cd 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Split.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Split.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-12-01 +ms.date: 2017-12-20 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -35,11 +35,10 @@ The following diagram shows the syntax for the -split operator. The parameter names do not appear in the command. Include only the parameter values. The values must appear in the order specified in the syntax diagram. -```powershell +``` -Split - +-Split () -Split [,[,""]] - -Split {} [,] ``` @@ -51,14 +50,14 @@ are applied. ## PARAMETERS -### \ +### \ or \ Specifies one or more strings to be split. If you submit multiple strings, all the strings are split using the same delimiter rules. Example: -```powershell +``` -split "red yellow blue green" red yellow @@ -73,7 +72,7 @@ whitespace, including spaces and non-printable characters, such as newline (\`n) and tab (\`t). When the strings are split, the delimiter is omitted from all the substrings. Example: -```powershell +``` "Lastname:FirstName:Address" -split ":" Lastname FirstName @@ -90,7 +89,7 @@ as a split. Examples: -```powershell +``` "Lastname:FirstName:Address" -split "(:)" Lastname : @@ -139,6 +138,9 @@ Example: ```powershell $c = "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" $c -split ",", 5 +``` + +```Output Mercury Venus Earth @@ -156,6 +158,9 @@ Example: ```powershell $c = "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" $c -split {$_ -eq "e" -or $_ -eq "p"} +``` + +```Output M rcury,V nus, @@ -173,7 +178,7 @@ Enclose the option name in quotation marks. Options are valid only when the The syntax for the Options parameter is: -```powershell +``` "SimpleMatch [,IgnoreCase]" "[RegexMatch] [,IgnoreCase] [,CultureInvariant] @@ -214,13 +219,16 @@ The unary split operator (`-split `) has higher precedence than a comma. As a result, if you submit a comma-separated list of strings to the unary split operator, only the first string (before the first comma) is split. -To split more than one string, use the binary split operator ( -split -). Enclose all the strings in parentheses, or store the strings in -a variable, and then submit the variable to the split operator. +Use one of the following patterns to split more than one string: + +- Use the binary split operator (\ -split \) +- Enclose all the strings in parentheses +- Store the strings in a variable then submit the variable to the split + operator Consider the following example: -```powershell +``` PS > -split "1 2", "a b" 1 2 @@ -251,7 +259,11 @@ b The following statement splits the string at whitespace. ```powershell -PS > -split "Windows PowerShell 2.0`nWindows PowerShell with remoting" +-split "Windows PowerShell 2.0`nWindows PowerShell with remoting" +``` + +```Output + Windows PowerShell 2.0 @@ -264,7 +276,10 @@ remoting The following statement splits the string at any comma. ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split ',' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split ',' +``` + +```Output Mercury Venus Earth @@ -278,7 +293,10 @@ Neptune The following statement splits the string at the pattern "er". ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split 'er' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split 'er' +``` + +```Output M cury,Venus,Earth,Mars,Jupit ,Saturn,Uranus,Neptune @@ -287,7 +305,10 @@ cury,Venus,Earth,Mars,Jupit The following statement performs a case-sensitive split at the letter "N". ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -cSplit 'N' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -cSplit 'N' +``` + +```Output Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus, eptune ``` @@ -295,7 +316,10 @@ eptune The following statement splits the string at "e" and "t". ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[et]' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[et]' +``` + +```Output M rcury,V nus, @@ -312,8 +336,10 @@ The following statement splits the string at "e" and "r", but limits the resulting substrings to six substrings. ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" ` - -split '[er]', 6 +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[er]', 6 +``` + +```Output M cu @@ -325,7 +351,10 @@ arth,Mars,Jupiter,Saturn,Uranus,Neptune The following statement splits a string into three substrings. ```powershell -PS > "a,b,c,d,e,f,g,h" -split ",", 3 +"a,b,c,d,e,f,g,h" -split ",", 3 +``` + +```Output a b c,d,e,f,g,h @@ -335,7 +364,10 @@ The following statement splits two strings into three substrings. (The limit is applied to each string independently.) ```powershell -PS > "a,b,c,d", "e,f,g,h" -split ",", 3 +"a,b,c,d", "e,f,g,h" -split ",", 3 +``` + +```Output a b c,d @@ -353,13 +385,15 @@ can use options, such as Multiline, only when the Max-substrings value is specified. ```powershell -PS > $a = @' +$a = @' 1The first line. 2The second line. 3The third of three lines. '@ +$a -split "^\d", 0, "multiline" +``` -PS > $a -split "^\d", 0, "multiline" +```Output The first line. @@ -381,8 +415,10 @@ can use options, such as SimpleMatch, only when the Max-substrings value is specified. ```powershell -PS > "This.is.a.test" -split ".", 0, "simplematch" +"This.is.a.test" -split ".", 0, "simplematch" +``` +```Output This is a @@ -393,10 +429,12 @@ The following statement splits the string at one of two delimiters, depending on the value of a variable. ```powershell -PS > $i = 1 -PS > $c = "LastName, FirstName; Address, City, State, Zip" -PS > $c -split {if ($i -lt 1) {$-eq ","} else {$-eq ";"}} +$i = 1 +$c = "LastName, FirstName; Address, City, State, Zip" +$c -split {if ($i -lt 1) {$-eq ","} else {$-eq ";"}} +``` +```Output LastName, FirstName Address, City, State, Zip ``` diff --git a/reference/5.1/Microsoft.PowerShell.Core/New-PSSession.md b/reference/5.1/Microsoft.PowerShell.Core/New-PSSession.md index 89fa4d35645b..0bf5a767f4c6 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/New-PSSession.md +++ b/reference/5.1/Microsoft.PowerShell.Core/New-PSSession.md @@ -665,7 +665,7 @@ You can pipe a string, URI, or session object to this cmdlet. ### System.Management.Automation.Runspaces.PSSession ## NOTES -* This cmdlet uses the Windows PowerShell remoting infrastructure. To use this cmdlet, the local computer and any remote computers must be configured for Windows PowerShell remoting. For more information, see about_Remote_Requirements (http://go.microsoft.com/fwlink/?LinkID=135187). +* This cmdlet uses the Windows PowerShell remoting infrastructure. To use this cmdlet, the local computer and any remote computers must be configured for Windows PowerShell remoting. For more information, see [about_Remote_Requirements](About/about_Remote_Requirements.md). * To create a **PSSession** on the local computer, start Windows PowerShell with the Run as administrator option. * When you are finished with the **PSSession**, use the Remove-PSSession cmdlet to delete the **PSSession** and release its resources. diff --git a/reference/5.1/Microsoft.PowerShell.Management/Get-Content.md b/reference/5.1/Microsoft.PowerShell.Management/Get-Content.md index 2e35c6b18336..3c363fae179e 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Get-Content.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Get-Content.md @@ -16,19 +16,23 @@ Gets the content of the item at the specified location. ## SYNTAX ### Path (Default) -``` -Get-Content [-ReadCount ] [-TotalCount ] [-Tail ] [-Path] [-Filter ] - [-Include ] [-Exclude ] [-Force] [-Credential ] [-UseTransaction] - [-Delimiter ] [-Wait] [-Raw] [-Encoding ] [-Stream ] +```powershell +Get-Content [-Path] [-ReadCount ] [-TotalCount ] + [-Tail ] [-Filter ] [-Include ] [-Exclude ] + [-Force] [-Credential ] [-UseTransaction] + [-Delimiter ] [-Wait] [-Raw] + [-Encoding ] [-Stream ] [] ``` ### LiteralPath -``` -Get-Content [-ReadCount ] [-TotalCount ] [-Tail ] -LiteralPath - [-Filter ] [-Include ] [-Exclude ] [-Force] [-Credential ] - [-UseTransaction] [-Delimiter ] [-Wait] [-Raw] [-Encoding ] - [-Stream ] [] +```powershell +Get-Content -LiteralPath [-ReadCount ] [-TotalCount ] + [-Tail ] [-Filter ] [-Include ] [-Exclude ] + [-Force] [-Credential ] [-UseTransaction] + [-Delimiter ] [-Wait] [-Raw] + [-Encoding ] [-Stream ] + [] ``` ## DESCRIPTION diff --git a/reference/5.1/Microsoft.PowerShell.Management/Get-Item.md b/reference/5.1/Microsoft.PowerShell.Management/Get-Item.md index 28e1eed37e7f..2f635f18d85b 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Get-Item.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Get-Item.md @@ -39,7 +39,7 @@ This cmdlet is used by Windows PowerShell providers to navigate through differen ``` PS C:\ps-test> Get-Item . - Directory: C:\ + Directory: C:\ Mode LastWriteTime Length Name @@ -218,7 +218,7 @@ This parameter is not supported by any providers installed with Windows PowerShe ```yaml Type: PSCredential Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -238,7 +238,7 @@ The *Exclude* parameter is effective only when the command includes the contents ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -256,7 +256,7 @@ Filters are more efficient than other parameters, because the provider applies t ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -274,7 +274,7 @@ Even using the *Force* parameter, the cmdlet cannot override security restrictio ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -294,7 +294,7 @@ The *Include* parameter is effective only when the command includes the contents ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -334,13 +334,13 @@ Use the wildcard character (*) to specify all the items in the current location. ```yaml Type: String[] Parameter Sets: Path -Aliases: +Aliases: Required: True Position: 0 Default value: None Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False +Accept wildcard characters: True ``` ### -Stream @@ -363,7 +363,7 @@ This parameter was introduced in Windows PowerShell 3.0. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -418,8 +418,6 @@ The registry values are considered to be properties of the registry key. To list the providers available in your session, type `Get-PsProvider`. For more information, see about_Providers. -* - ## RELATED LINKS [Clear-Item](Clear-Item.md) diff --git a/reference/5.1/Microsoft.PowerShell.Management/Limit-EventLog.md b/reference/5.1/Microsoft.PowerShell.Management/Limit-EventLog.md index 4a7f9c81226b..e91d68026643 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Limit-EventLog.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Limit-EventLog.md @@ -208,7 +208,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS ### None -You cannot pip input to this cmdlet. +You cannot pipe input to this cmdlet. ## OUTPUTS diff --git a/reference/5.1/Microsoft.PowerShell.Management/Restart-Computer.md b/reference/5.1/Microsoft.PowerShell.Management/Restart-Computer.md index 01e756d47fde..0fa793265e8c 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Restart-Computer.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Restart-Computer.md @@ -119,7 +119,7 @@ These settings are designed for enterprises in which DCOM-based restarts fail be Indicates that this cmdlet runs as a background job. To use this parameter, the local and remote computers must be configured for remoting and, on Windows Vista and later versions of the Windows operating system, you must open Windows PowerShell by using the Run as administrator option. -For more information, see about_Remote_Requirements (http://go.microsoft.com/fwlink/?LinkID=135187). +For more information, see [about_Remote_Requirements](../Microsoft.PowerShell.Core/About/about_Remote_Requirements.md). When you specify the *AsJob* parameter, the command immediately returns an object that represents the background job. You can continue to work in the session while the job finishes. diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Get-FileHash.md b/reference/5.1/Microsoft.PowerShell.Utility/Get-FileHash.md index adc69dc47b80..963bd48fb96a 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Get-FileHash.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Get-FileHash.md @@ -74,46 +74,44 @@ The output is piped to the Format-List cmdlet to format the output as a list. ### Example 3: Compute the hash value of a stream and compare the procedure with getting the hash from the file directly ```powershell -PS C:\> $testfile = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" - -## open $testfile as a stream -$testfilestream = [System.IO.File]::Open( - $testfile, - [System.IO.FileMode]::Open, - [System.IO.FileAccess]::Read) - -$hashFromStream = Get-FileHash -InputStream $testfilestream -Algorithm MD5 - -$testfilestream.Close() - -$hashFromFile = Get-FileHash -Path $testfile -Algorithm MD5 - -## check both hashes are the same -if(($hashFromStream.Hash) -ne ($hashFromFile.Hash)) { - Write-Error "Get-FileHash results are inconsistent!!" -} -else { - Write-Output "Results from File:" - Write-Output "==================" - $hashFromFile | Format-List - Write-Output " " - Write-Output "Results from Stream:" - Write-Output "====================" - $hashFromStream | Format-List +# Path of Microsoft.PowerShell.Utility.psd1 +$file = (Get-Module Microsoft.PowerShell.Utility).Path + +$hashFromFile = Get-FileHash -Path $file -Algorithm MD5 + +# Open $file as a stream +$stream = [System.IO.File]::OpenRead($file) +$hashFromStream = Get-FileHash -InputStream $stream -Algorithm MD5 +$stream.Close() + +Write-Host '### Hash from File ###' -NoNewline +$hashFromFile | Format-List +Write-Host '### Hash from Stream ###' -NoNewline +$hashFromStream | Format-List + +# Check both hashes are the same +if ($hashFromFile.Hash -eq $hashFromStream.Hash) { + Write-Host 'Get-FileHash results are consistent' -ForegroundColor Green +} else { + Write-Host 'Get-FileHash results are inconsistent!!' -ForegroundColor Red } +``` +```output +### Hash from File ### -Results from File: -================== Algorithm : MD5 -Hash : 097CE5761C89434367598B34FE32893B -Path : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe +Hash : 593D6592BD9B7F9174711AB136F5E751 +Path : C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\Microsoft.Powe + rShell.Utility\Microsoft.PowerShell.Utility.psd1 + +### Hash from Stream ### -Results from Stream: -==================== Algorithm : MD5 -Hash : 097CE5761C89434367598B34FE32893B +Hash : 593D6592BD9B7F9174711AB136F5E751 Path : + +Get-FileHash results are consistent ``` ## PARAMETERS diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Get-Member.md b/reference/5.1/Microsoft.PowerShell.Utility/Get-Member.md index d2e853f4466e..04e3bdb0df2b 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Get-Member.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Get-Member.md @@ -15,9 +15,10 @@ Gets the properties and methods of objects. ## SYNTAX -``` -Get-Member [-InputObject ] [[-Name] ] [-MemberType ] - [-View ] [-Static] [-Force] [] +```powershell +Get-Member [[-Name] ] [-InputObject ] + [-MemberType ] [-View ] [-Static] [-Force] + [] ``` ## DESCRIPTION diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Group-Object.md b/reference/5.1/Microsoft.PowerShell.Utility/Group-Object.md index 454e3d84d85b..70a564b10018 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Group-Object.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Group-Object.md @@ -16,8 +16,9 @@ Groups objects that contain the same value for specified properties. ## SYNTAX ``` -Group-Object [-NoElement] [-AsHashTable] [-AsString] [-InputObject ] [[-Property] ] - [-Culture ] [-CaseSensitive] [] +Group-Object [[-Property] ] [-NoElement] [-AsHashTable] [-AsString] + [-InputObject ] [-Culture ] [-CaseSensitive] + [] ``` ## DESCRIPTION diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Select-String.md b/reference/5.1/Microsoft.PowerShell.Utility/Select-String.md index f8f5a9a09bbc..94270f8604cd 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Select-String.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Select-String.md @@ -200,7 +200,7 @@ When **Select-String** finds more than one match in a line of text, it still emi ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -216,7 +216,7 @@ By default, matches are not case-sensitive. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -247,7 +247,7 @@ When the context includes a match, the **MatchInfo** object for each match inclu ```yaml Type: Int32[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -277,7 +277,7 @@ OEM is the current original equipment manufacturer code page identifier for the ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Accepted values: unicode, utf7, utf8, utf32, ascii, bigendianunicode, default, oem Required: False @@ -296,7 +296,7 @@ Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -314,7 +314,7 @@ Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -336,7 +336,7 @@ The differences are as follows: ```yaml Type: PSObject Parameter Sets: Object -Aliases: +Aliases: Required: True Position: Named @@ -352,7 +352,7 @@ By default, **Select-String** returns a **MatchInfo** object for each match it f ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -386,7 +386,7 @@ Indicates that the cmdlet finds text that does not match the specified pattern. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -406,7 +406,7 @@ If you specify only a directory, the command fails. ```yaml Type: String[] Parameter Sets: File -Aliases: +Aliases: Required: True Position: 1 @@ -425,7 +425,7 @@ To learn about regular expressions, see about_Regular_Expressions. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: True Position: 0 @@ -441,7 +441,7 @@ The value is True if the pattern is found; otherwise, the value is False. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -458,7 +458,7 @@ It does not interpret the value of the *Pattern* parameter as a regular expressi ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -483,7 +483,7 @@ If you use the *Quiet* parameter, the output is a Boolean value indicating wheth ## NOTES * **Select-String** is like the Grep command in UNIX and the FindStr command in Windows. -* The **sst** alias for the **Select-String** cmdlet was introduced in Windows PowerShell 3.0. +* The **sls** alias for the **Select-String** cmdlet was introduced in Windows PowerShell 3.0. * To use **Select-String**, type the text that you want to find as the value of the *Pattern* parameter. To specify the text to be searched, do the following: diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Tee-Object.md b/reference/5.1/Microsoft.PowerShell.Utility/Tee-Object.md index 203ded45ea4d..423a05416065 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Tee-Object.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Tee-Object.md @@ -17,17 +17,20 @@ Saves command output in a file or variable and also sends it down the pipeline. ### File (Default) ``` -Tee-Object [-InputObject ] [-FilePath] [-Append] [] +Tee-Object [-FilePath] [-InputObject ] [-Append] + [] ``` ### LiteralFile ``` -Tee-Object [-InputObject ] -LiteralPath [] +Tee-Object -LiteralPath [-InputObject ] + [] ``` ### Variable ``` -Tee-Object [-InputObject ] -Variable [] +Tee-Object -Variable [-InputObject ] + [] ``` ## DESCRIPTION diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Update-TypeData.md b/reference/5.1/Microsoft.PowerShell.Utility/Update-TypeData.md index b9277d09b46b..0e3c0ac548db 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Update-TypeData.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Update-TypeData.md @@ -61,7 +61,7 @@ If you are getting .NET Framework properties, you can work around the suppressio Note that method syntax can only be used with .NET Framework properties. Properties that are added by running the **Update-TypeData** cmdlet cannot use method syntax. -For more information about the *types.ps1xml files in Windows PowerShell, see about_Types.ps1xml (..\Microsoft.PowerShell.Core\About\about_Types.ps1xml.md). +For more information about the *types.ps1xml files in PowerShell, see [about_Types.ps1xml](../Microsoft.PowerShell.Core/About/about_Types.ps1xml.md). ## EXAMPLES diff --git a/reference/5.1/PSDesiredStateConfiguration/Test-DscConfiguration.md b/reference/5.1/PSDesiredStateConfiguration/Test-DscConfiguration.md index 418a44a0df63..bad7ab68910b 100644 --- a/reference/5.1/PSDesiredStateConfiguration/Test-DscConfiguration.md +++ b/reference/5.1/PSDesiredStateConfiguration/Test-DscConfiguration.md @@ -118,7 +118,7 @@ To manage the job, use the Job cmdlets. To get the job results, use the Receive-Job cmdlet. To use this parameter, the local and remote computers must be configured for remoting, and on Windows Vista and later versions of the Windows operating system, you must open Windows PowerShell with the Run as administrator option. -For more information, see about_Remote_Requirementshttp://go.microsoft.com/fwlink/?LinkId=623526 (http://go.microsoft.com/fwlink/?LinkId=623526). +For more information, see [about_Remote_Requirements](../Microsoft.PowerShell.Core/About/about_Remote_Requirements.md). For more information about Windows PowerShell background jobs, see [about_Jobs](../Microsoft.PowerShell.Core/About/about_Jobs.md) and [about_Remote_Jobs](../Microsoft.PowerShell.Core/About/about_Remote_Jobs.md). diff --git a/reference/5.1/PSWorkflow/New-PSWorkflowExecutionOption.md b/reference/5.1/PSWorkflow/New-PSWorkflowExecutionOption.md index f05b67d76beb..121ff390a00a 100644 --- a/reference/5.1/PSWorkflow/New-PSWorkflowExecutionOption.md +++ b/reference/5.1/PSWorkflow/New-PSWorkflowExecutionOption.md @@ -36,7 +36,7 @@ If you do not specify a parameter, the cmdlet creates the object that has a defa The **New-PSWorkflowExecutionOption** cmdlet is part of the Windows PowerShell Workflow feature. You can also add workflow common parameters to this command. -For more information about workflow common parameters, see about_WorkflowCommonParameters. +For more information about workflow common parameters, see [about_WorkflowCommonParameters](About/about_WorkflowCommonParameters.md). This cmdlet was introduced in Windows PowerShell 3.0. diff --git a/reference/6/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md b/reference/6/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md index a08a495cb977..e43e89a58ad6 100644 --- a/reference/6/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md +++ b/reference/6/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md @@ -501,8 +501,8 @@ right operand determine how many bits of the left operand are shifted. |`21 -shr 31` | 0 | 0000 0000 | 0x00 | |`21 -shr 32` | 21 | 0001 0101 | 0x15 | |`21 -shr 64` | 21 | 0001 0101 | 0x15 | -|`21 -shr 65` | 10 | 0000 1010 | 0x15 | -|`21 -shr 66` | 5 | 0000 0101 | 0x15 | +|`21 -shr 65` | 10 | 0000 1010 | 0x0A | +|`21 -shr 66` | 5 | 0000 0101 | 0x05 | |`[int]::MaxValue -shr 1`| 1073741823 | | 0x3FFFFFFF | |`[int]::MinValue -shr 1`| -1073741824| | 0xC0000000 | |`-1 -shr 1` | -1 | | 0xFFFFFFFF | diff --git a/reference/6/Microsoft.PowerShell.Core/About/about_Arrays.md b/reference/6/Microsoft.PowerShell.Core/About/about_Arrays.md index ae4224cc1336..385ad7e9e732 100644 --- a/reference/6/Microsoft.PowerShell.Core/About/about_Arrays.md +++ b/reference/6/Microsoft.PowerShell.Core/About/about_Arrays.md @@ -617,8 +617,8 @@ $a[-1] ``` ```output -0 -0 +1 +1 4 4 ``` diff --git a/reference/6/Microsoft.PowerShell.Core/About/about_Split.md b/reference/6/Microsoft.PowerShell.Core/About/about_Split.md index 98b97dd2dab7..523bd6d4e3cd 100644 --- a/reference/6/Microsoft.PowerShell.Core/About/about_Split.md +++ b/reference/6/Microsoft.PowerShell.Core/About/about_Split.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-12-01 +ms.date: 2017-12-20 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -35,11 +35,10 @@ The following diagram shows the syntax for the -split operator. The parameter names do not appear in the command. Include only the parameter values. The values must appear in the order specified in the syntax diagram. -```powershell +``` -Split - +-Split () -Split [,[,""]] - -Split {} [,] ``` @@ -51,14 +50,14 @@ are applied. ## PARAMETERS -### \ +### \ or \ Specifies one or more strings to be split. If you submit multiple strings, all the strings are split using the same delimiter rules. Example: -```powershell +``` -split "red yellow blue green" red yellow @@ -73,7 +72,7 @@ whitespace, including spaces and non-printable characters, such as newline (\`n) and tab (\`t). When the strings are split, the delimiter is omitted from all the substrings. Example: -```powershell +``` "Lastname:FirstName:Address" -split ":" Lastname FirstName @@ -90,7 +89,7 @@ as a split. Examples: -```powershell +``` "Lastname:FirstName:Address" -split "(:)" Lastname : @@ -139,6 +138,9 @@ Example: ```powershell $c = "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" $c -split ",", 5 +``` + +```Output Mercury Venus Earth @@ -156,6 +158,9 @@ Example: ```powershell $c = "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" $c -split {$_ -eq "e" -or $_ -eq "p"} +``` + +```Output M rcury,V nus, @@ -173,7 +178,7 @@ Enclose the option name in quotation marks. Options are valid only when the The syntax for the Options parameter is: -```powershell +``` "SimpleMatch [,IgnoreCase]" "[RegexMatch] [,IgnoreCase] [,CultureInvariant] @@ -214,13 +219,16 @@ The unary split operator (`-split `) has higher precedence than a comma. As a result, if you submit a comma-separated list of strings to the unary split operator, only the first string (before the first comma) is split. -To split more than one string, use the binary split operator ( -split -). Enclose all the strings in parentheses, or store the strings in -a variable, and then submit the variable to the split operator. +Use one of the following patterns to split more than one string: + +- Use the binary split operator (\ -split \) +- Enclose all the strings in parentheses +- Store the strings in a variable then submit the variable to the split + operator Consider the following example: -```powershell +``` PS > -split "1 2", "a b" 1 2 @@ -251,7 +259,11 @@ b The following statement splits the string at whitespace. ```powershell -PS > -split "Windows PowerShell 2.0`nWindows PowerShell with remoting" +-split "Windows PowerShell 2.0`nWindows PowerShell with remoting" +``` + +```Output + Windows PowerShell 2.0 @@ -264,7 +276,10 @@ remoting The following statement splits the string at any comma. ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split ',' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split ',' +``` + +```Output Mercury Venus Earth @@ -278,7 +293,10 @@ Neptune The following statement splits the string at the pattern "er". ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split 'er' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split 'er' +``` + +```Output M cury,Venus,Earth,Mars,Jupit ,Saturn,Uranus,Neptune @@ -287,7 +305,10 @@ cury,Venus,Earth,Mars,Jupit The following statement performs a case-sensitive split at the letter "N". ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -cSplit 'N' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -cSplit 'N' +``` + +```Output Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus, eptune ``` @@ -295,7 +316,10 @@ eptune The following statement splits the string at "e" and "t". ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[et]' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[et]' +``` + +```Output M rcury,V nus, @@ -312,8 +336,10 @@ The following statement splits the string at "e" and "r", but limits the resulting substrings to six substrings. ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" ` - -split '[er]', 6 +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[er]', 6 +``` + +```Output M cu @@ -325,7 +351,10 @@ arth,Mars,Jupiter,Saturn,Uranus,Neptune The following statement splits a string into three substrings. ```powershell -PS > "a,b,c,d,e,f,g,h" -split ",", 3 +"a,b,c,d,e,f,g,h" -split ",", 3 +``` + +```Output a b c,d,e,f,g,h @@ -335,7 +364,10 @@ The following statement splits two strings into three substrings. (The limit is applied to each string independently.) ```powershell -PS > "a,b,c,d", "e,f,g,h" -split ",", 3 +"a,b,c,d", "e,f,g,h" -split ",", 3 +``` + +```Output a b c,d @@ -353,13 +385,15 @@ can use options, such as Multiline, only when the Max-substrings value is specified. ```powershell -PS > $a = @' +$a = @' 1The first line. 2The second line. 3The third of three lines. '@ +$a -split "^\d", 0, "multiline" +``` -PS > $a -split "^\d", 0, "multiline" +```Output The first line. @@ -381,8 +415,10 @@ can use options, such as SimpleMatch, only when the Max-substrings value is specified. ```powershell -PS > "This.is.a.test" -split ".", 0, "simplematch" +"This.is.a.test" -split ".", 0, "simplematch" +``` +```Output This is a @@ -393,10 +429,12 @@ The following statement splits the string at one of two delimiters, depending on the value of a variable. ```powershell -PS > $i = 1 -PS > $c = "LastName, FirstName; Address, City, State, Zip" -PS > $c -split {if ($i -lt 1) {$-eq ","} else {$-eq ";"}} +$i = 1 +$c = "LastName, FirstName; Address, City, State, Zip" +$c -split {if ($i -lt 1) {$-eq ","} else {$-eq ";"}} +``` +```Output LastName, FirstName Address, City, State, Zip ``` diff --git a/reference/6/Microsoft.PowerShell.Core/New-PSSession.md b/reference/6/Microsoft.PowerShell.Core/New-PSSession.md index 22b6b5083c43..fb7d4e88e06d 100644 --- a/reference/6/Microsoft.PowerShell.Core/New-PSSession.md +++ b/reference/6/Microsoft.PowerShell.Core/New-PSSession.md @@ -803,7 +803,7 @@ You can pipe a string, URI, or session object to this cmdlet. ### System.Management.Automation.Runspaces.PSSession ## NOTES -* This cmdlet uses the Windows PowerShell remoting infrastructure. To use this cmdlet, the local computer and any remote computers must be configured for Windows PowerShell remoting. For more information, see about_Remote_Requirements (http://go.microsoft.com/fwlink/?LinkID=135187). +* This cmdlet uses the Windows PowerShell remoting infrastructure. To use this cmdlet, the local computer and any remote computers must be configured for Windows PowerShell remoting. For more information, see [about_Remote_Requirements](About/about_Remote_Requirements.md). * To create a **PSSession** on the local computer, start Windows PowerShell with the Run as administrator option. * When you are finished with the **PSSession**, use the Remove-PSSession cmdlet to delete the **PSSession** and release its resources. * The **HostName** and **SSHConnection** parameter sets were included starting with PowerShell 6.0. They were added to provide PowerShell remoting based on Secure Shell (SSH). Both SSH and PowerShell are supported on multiple platforms (Windows, Linux, macOS) and PowerShell remoting will work over these platforms where PowerShell and SSH are installed and configured. This is separate from the previous Windows only remoting that is based on WinRM and much of the WinRM specific features and limitations do not apply. For example WinRM based quotas, session options, custom endpoint configuration, and disconnect/reconnect features are currently not supported. diff --git a/reference/6/Microsoft.PowerShell.Management/Get-Content.md b/reference/6/Microsoft.PowerShell.Management/Get-Content.md index 3d791cf66471..a1e2150bf7b4 100644 --- a/reference/6/Microsoft.PowerShell.Management/Get-Content.md +++ b/reference/6/Microsoft.PowerShell.Management/Get-Content.md @@ -16,20 +16,22 @@ Gets the content of the item at the specified location. ## SYNTAX ### Path (Default) -``` -Get-Content [-ReadCount ] [-TotalCount ] [-Tail ] [-Path] [-Filter ] - [-Include ] [-Exclude ] [-Force] [-Credential ] - [-InformationAction ] [-InformationVariable ] [-UseTransaction] - [-Delimiter ] [-Wait] [-Raw] [-Encoding ] [-Stream ] +```powershell +Get-Content [-Path] [-ReadCount ] [-TotalCount ] + [-Tail ] [-Filter ] [-Include ] [-Exclude ] + [-Force] [-Credential ] [-UseTransaction] + [-Delimiter ] [-Wait] [-Raw] + [-Encoding ] [-Stream ] [] ``` ### LiteralPath -``` -Get-Content [-ReadCount ] [-TotalCount ] [-Tail ] -LiteralPath - [-Filter ] [-Include ] [-Exclude ] [-Force] [-Credential ] - [-InformationAction ] [-InformationVariable ] [-UseTransaction] - [-Delimiter ] [-Wait] [-Raw] [-Encoding ] [-Stream ] +```powershell +Get-Content -LiteralPath [-ReadCount ] [-TotalCount ] + [-Tail ] [-Filter ] [-Include ] [-Exclude ] + [-Force] [-Credential ] [-UseTransaction] + [-Delimiter ] [-Wait] [-Raw] + [-Encoding ] [-Stream ] [] ``` @@ -263,37 +265,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -InformationAction -Type a user name, such as "User01" or "Domain01\User01", or enter a PSCredential object, such as one generated by the Get-Credential cmdlet. If you type a user name, you will be prompted for a password. - -This parameter is not supported by any providers that are installed with Windows PowerShell.```yaml -Type: ActionPreference -Parameter Sets: (All) -Aliases: infa -Accepted values: SilentlyContinue, Stop, Continue, Inquire, Ignore, Suspend - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InformationVariable -Type a user name, such as "User01" or "Domain01\User01", or enter a PSCredential object, such as one generated by the Get-Credential cmdlet. If you type a user name, you will be prompted for a password. - -This parameter is not supported by any providers that are installed with Windows PowerShell.```yaml -Type: String -Parameter Sets: (All) -Aliases: iv - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -LiteralPath Specifies the path to an item. Unlike the *Path* parameter, the value of *LiteralPath* is used exactly as it is typed. @@ -324,7 +295,7 @@ Parameter Sets: Path Aliases: Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False diff --git a/reference/6/Microsoft.PowerShell.Management/Get-Item.md b/reference/6/Microsoft.PowerShell.Management/Get-Item.md index af028cf5812e..ceae93923bf6 100644 --- a/reference/6/Microsoft.PowerShell.Management/Get-Item.md +++ b/reference/6/Microsoft.PowerShell.Management/Get-Item.md @@ -39,11 +39,8 @@ This cmdlet is used by Windows PowerShell providers to navigate through differen ``` PS C:\> Get-Item . +Directory: C:\ - - - -Directory: C:\ Mode LastWriteTime Length Name ---- ------------- ------ ---- d---- 7/26/2006 10:01 AM ps-test @@ -56,17 +53,8 @@ The dot (.) represents the item at the current location (not its contents). ``` PS C:\> Get-Item * - - - - - - - - - - Directory: C:\ps-test + Mode LastWriteTime Length Name ---- ------------- ------ ---- d---- 7/26/2006 9:29 AM Logs @@ -132,7 +120,7 @@ This parameter is not supported by any providers installed with Windows PowerShe ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -153,7 +141,7 @@ This parameter is not supported by any providers installed with Windows PowerShe ```yaml Type: PSCredential Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -173,7 +161,7 @@ The *Exclude* parameter is effective only when the command includes the contents ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -191,7 +179,7 @@ Filters are more efficient than other parameters, because the provider applies t ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -209,7 +197,7 @@ Even using the *Force* parameter, the cmdlet cannot override security restrictio ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -229,7 +217,7 @@ The *Include* parameter is effective only when the command includes the contents ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -269,13 +257,13 @@ Use the wildcard character (*) to specify all the items in the current location. ```yaml Type: String[] Parameter Sets: Path -Aliases: +Aliases: Required: True Position: 1 Default value: None Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False +Accept wildcard characters: True ``` ### -UseTransaction @@ -324,8 +312,6 @@ The registry values are considered to be properties of the registry key. To list the providers available in your session, type `Get-PsProvider`. For more information, see about_Providers. -* - ## RELATED LINKS [Clear-Item](Clear-Item.md) diff --git a/reference/6/Microsoft.PowerShell.Management/Restart-Computer.md b/reference/6/Microsoft.PowerShell.Management/Restart-Computer.md index e05ecb6aca49..f314824de1c7 100644 --- a/reference/6/Microsoft.PowerShell.Management/Restart-Computer.md +++ b/reference/6/Microsoft.PowerShell.Management/Restart-Computer.md @@ -119,7 +119,7 @@ These settings are designed for enterprises in which DCOM-based restarts fail be Indicates that this cmdlet runs as a background job. To use this parameter, the local and remote computers must be configured for remoting and, on Windows Vista and later versions of the Windows operating system, you must open Windows PowerShell by using the Run as administrator option. -For more information, see about_Remote_Requirements (http://go.microsoft.com/fwlink/?LinkID=135187). +For more information, see [about_Remote_Requirements](../Microsoft.PowerShell.Core/About/about_Remote_Requirements.md). When you specify the *AsJob* parameter, the command immediately returns an object that represents the background job. You can continue to work in the session while the job finishes. diff --git a/reference/6/Microsoft.PowerShell.Utility/Get-FileHash.md b/reference/6/Microsoft.PowerShell.Utility/Get-FileHash.md index 4abb81aaa9f7..86bdfc3cdcc2 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Get-FileHash.md +++ b/reference/6/Microsoft.PowerShell.Utility/Get-FileHash.md @@ -72,47 +72,46 @@ This command uses the **Get-FileHash** cmdlet and the SHA384 algorithm to comput The output is piped to the Format-List cmdlet to format the output as a list. ### Example 3: Compute the hash value of a stream and compare the procedure with getting the hash from the file directly -``` -PS C:\> $testfile = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -## open $testfile as a stream -$testfilestream = [System.IO.File]::Open( - $testfile, - [System.IO.FileMode]::Open, - [System.IO.FileAccess]::Read) +```powershell +# Path of Microsoft.PowerShell.Utility.psd1 +$file = (Get-Module Microsoft.PowerShell.Utility).Path -$hashFromStream = Get-FileHash -InputStream $testfilestream -Algorithm MD5 +$hashFromFile = Get-FileHash -Path $file -Algorithm MD5 -$testfilestream.Close() +# Open $file as a stream +$stream = [System.IO.File]::OpenRead($file) +$hashFromStream = Get-FileHash -InputStream $stream -Algorithm MD5 +$stream.Close() -$hashFromFile = Get-FileHash -Path $testfile -Algorithm MD5 +Write-Host '### Hash from File ###' -NoNewline +$hashFromFile | Format-List +Write-Host '### Hash from Stream ###' -NoNewline +$hashFromStream | Format-List -## check both hashes are the same -if(($hashFromStream.Hash) -ne ($hashFromFile.Hash)) { - Write-Error "Get-FileHash results are inconsistent!!" -} -else { - Write-Output "Results from File:" - Write-Output "==================" - $hashFromFile | Format-List - Write-Output " " - Write-Output "Results from Stream:" - Write-Output "====================" - $hashFromStream | Format-List +# Check both hashes are the same +if ($hashFromFile.Hash -eq $hashFromStream.Hash) { + Write-Host 'Get-FileHash results are consistent' -ForegroundColor Green +} else { + Write-Host 'Get-FileHash results are inconsistent!!' -ForegroundColor Red } +``` +```output +### Hash from File ### -Results from File: -================== Algorithm : MD5 -Hash : 097CE5761C89434367598B34FE32893B -Path : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe +Hash : 593D6592BD9B7F9174711AB136F5E751 +Path : C:\Program Files\PowerShell\6.0.0\Modules\Microsoft.Powe + rShell.Utility\Microsoft.PowerShell.Utility.psd1 + +### Hash from Stream ### -Results from Stream: -==================== Algorithm : MD5 -Hash : 097CE5761C89434367598B34FE32893B +Hash : 593D6592BD9B7F9174711AB136F5E751 Path : + +Get-FileHash results are consistent ``` ## PARAMETERS diff --git a/reference/6/Microsoft.PowerShell.Utility/Get-Member.md b/reference/6/Microsoft.PowerShell.Utility/Get-Member.md index 81731190de48..04e3bdb0df2b 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Get-Member.md +++ b/reference/6/Microsoft.PowerShell.Utility/Get-Member.md @@ -15,10 +15,10 @@ Gets the properties and methods of objects. ## SYNTAX -``` -Get-Member [-InputObject ] [[-Name] ] [-MemberType ] - [-View ] [-Static] [-Force] [-InformationAction ] - [-InformationVariable ] [] +```powershell +Get-Member [[-Name] ] [-InputObject ] + [-MemberType ] [-View ] [-Static] [-Force] + [] ``` ## DESCRIPTION @@ -267,53 +267,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -InformationAction -The following list describes the properties that are added when you use the Force parameter: - --- PSBase: The original properties of the .NET Framework object without extension or adaptation. These are the properties defined for the object class and listed in MSDN. - --- PSAdapted: The properties and methods defined in the Windows PowerShell extended type system. - --- PSExtended: The properties and methods that were added in the Types.ps1xml files or by using the Add-Member cmdlet. - --- PSObject: The adapter that converts the base object to a Windows PowerShell PSObject object. - --- PSTypeNames: A list of object types that describe the object, in order of specificity. When formatting the object, Windows PowerShell searches for the types in the Format.ps1xml files in the Windows PowerShell installation directory ($pshome). It uses the formatting definition for the first type that it finds.```yaml -Type: ActionPreference -Parameter Sets: (All) -Aliases: infa -Accepted values: SilentlyContinue, Stop, Continue, Inquire, Ignore, Suspend - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InformationVariable -The following list describes the properties that are added when you use the Force parameter: - --- PSBase: The original properties of the .NET Framework object without extension or adaptation. These are the properties defined for the object class and listed in MSDN. - --- PSAdapted: The properties and methods defined in the Windows PowerShell extended type system. - --- PSExtended: The properties and methods that were added in the Types.ps1xml files or by using the Add-Member cmdlet. - --- PSObject: The adapter that converts the base object to a Windows PowerShell PSObject object. - --- PSTypeNames: A list of object types that describe the object, in order of specificity. When formatting the object, Windows PowerShell searches for the types in the Format.ps1xml files in the Windows PowerShell installation directory ($pshome). It uses the formatting definition for the first type that it finds.```yaml -Type: String -Parameter Sets: (All) -Aliases: iv - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -InputObject Specifies the object whose members are retrieved. @@ -393,7 +346,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 1 +Position: 0 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/reference/6/Microsoft.PowerShell.Utility/Group-Object.md b/reference/6/Microsoft.PowerShell.Utility/Group-Object.md index 9f93095351f9..70a564b10018 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Group-Object.md +++ b/reference/6/Microsoft.PowerShell.Utility/Group-Object.md @@ -16,8 +16,8 @@ Groups objects that contain the same value for specified properties. ## SYNTAX ``` -Group-Object [-NoElement] [-AsHashTable] [-AsString] [-InputObject ] [[-Property] ] - [-Culture ] [-CaseSensitive] [-InformationAction ] [-InformationVariable ] +Group-Object [[-Property] ] [-NoElement] [-AsHashTable] [-AsString] + [-InputObject ] [-Culture ] [-CaseSensitive] [] ``` @@ -277,33 +277,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -InformationAction -By itself, the AsHashTable parameter returns each hash table in which each key is an instance of the grouped object. When used with the AsString parameter, the keys in the hash table are strings.```yaml -Type: ActionPreference -Parameter Sets: (All) -Aliases: infa -Accepted values: SilentlyContinue, Stop, Continue, Inquire, Ignore, Suspend - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InformationVariable -By itself, the AsHashTable parameter returns each hash table in which each key is an instance of the grouped object. When used with the AsString parameter, the keys in the hash table are strings.```yaml -Type: String -Parameter Sets: (All) -Aliases: iv - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -InputObject Specifies the objects to group. Enter a variable that contains the objects, or type a command or expression that gets the objects. @@ -353,7 +326,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 1 +Position: 0 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/reference/6/Microsoft.PowerShell.Utility/Select-String.md b/reference/6/Microsoft.PowerShell.Utility/Select-String.md index a6dfd436257e..d77c8cef990a 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Select-String.md +++ b/reference/6/Microsoft.PowerShell.Utility/Select-String.md @@ -203,7 +203,7 @@ When **Select-String** finds more than one match in a line of text, it still emi ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -219,7 +219,7 @@ By default, matches are not case-sensitive. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -250,7 +250,7 @@ When the context includes a match, the **MatchInfo** object for each match inclu ```yaml Type: Int32[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -280,7 +280,7 @@ OEM is the current original equipment manufacturer code page identifier for the ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Accepted values: unicode, utf7, utf8, utf32, ascii, bigendianunicode, default, oem Required: False @@ -299,7 +299,7 @@ Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -317,7 +317,7 @@ Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -366,7 +366,7 @@ The differences are as follows: ```yaml Type: PSObject Parameter Sets: Object -Aliases: +Aliases: Required: True Position: Named @@ -382,7 +382,7 @@ By default, **Select-String** returns a **MatchInfo** object for each match it f ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -397,7 +397,7 @@ Indicates that the cmdlet finds text that does not match the specified pattern. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -417,7 +417,7 @@ If you specify only a directory, the command fails. ```yaml Type: String[] Parameter Sets: File -Aliases: +Aliases: Required: True Position: 2 @@ -436,7 +436,7 @@ To learn about regular expressions, see about_Regular_Expressions. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: True Position: 1 @@ -452,7 +452,7 @@ The value is True if the pattern is found; otherwise, the value is False. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -469,7 +469,7 @@ It does not interpret the value of the *Pattern* parameter as a regular expressi ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -513,7 +513,7 @@ If you use the *Quiet* parameter, the output is a Boolean value indicating wheth ## NOTES * **Select-String** is like the Grep command in UNIX and the FindStr command in Windows. -* The **sst** alias for the **Select-String** cmdlet was introduced in Windows PowerShell 3.0. +* The **sls** alias for the **Select-String** cmdlet was introduced in Windows PowerShell 3.0. * To use **Select-String**, type the text that you want to find as the value of the *Pattern* parameter. To specify the text to be searched, do the following: diff --git a/reference/6/Microsoft.PowerShell.Utility/Sort-Object.md b/reference/6/Microsoft.PowerShell.Utility/Sort-Object.md index e2a718aab1d4..8d1dfa5b1d00 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Sort-Object.md +++ b/reference/6/Microsoft.PowerShell.Utility/Sort-Object.md @@ -15,10 +15,18 @@ Sorts objects by property values. ## SYNTAX +### Default ``` -Sort-Object [-Descending] [-Unique] [-InputObject ] [[-Property] ] [-Culture ] - [-CaseSensitive] [-InformationAction ] [-InformationVariable ] [] - [-Top ] [-Bottom ] +Sort-Object [[-Property] ] [-Descending] [-Unique] [-Top ] + [-InputObject ] [-Culture ] [-CaseSensitive] + [] +``` + +### Bottom +``` +Sort-Object [[-Property] ] -Bottom [-Descending] [-Unique] + [-InputObject ] [-Culture ] [-CaseSensitive] + [] ``` ## DESCRIPTION @@ -182,7 +190,7 @@ Specifies the number of objects to get from the end of the sorted object array. ```yaml Type: Int32 -Parameter Sets: (All) +Parameter Sets: Bottom Aliases: Required: False @@ -242,33 +250,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -InformationAction -```yaml -Type: ActionPreference -Parameter Sets: (All) -Aliases: infa -Accepted values: SilentlyContinue, Stop, Continue, Inquire, Ignore, Suspend - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InformationVariable -```yaml -Type: String -Parameter Sets: (All) -Aliases: iv - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -InputObject Specifies the objects to sort. @@ -315,7 +296,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 1 +Position: 0 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -326,7 +307,7 @@ Specifies the number of objects to get from the start of the sorted object array ```yaml Type: Int32 -Parameter Sets: (All) +Parameter Sets: Default Aliases: Required: False diff --git a/reference/6/Microsoft.PowerShell.Utility/Tee-Object.md b/reference/6/Microsoft.PowerShell.Utility/Tee-Object.md index fdc489c66eab..0fd469983c2f 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Tee-Object.md +++ b/reference/6/Microsoft.PowerShell.Utility/Tee-Object.md @@ -17,20 +17,20 @@ Saves command output in a file or variable and also sends it down the pipeline. ### File (Default) ``` -Tee-Object [-InputObject ] [-FilePath] [-Append] [-InformationAction ] - [-InformationVariable ] [] +Tee-Object [-FilePath] [-InputObject ] [-Append] + [] ``` ### LiteralFile ``` -Tee-Object [-InputObject ] -LiteralPath [-InformationAction ] - [-InformationVariable ] [] +Tee-Object -LiteralPath [-InputObject ] + [] ``` ### Variable ``` -Tee-Object [-InputObject ] -Variable [-InformationAction ] - [-InformationVariable ] [] +Tee-Object -Variable [-InputObject ] + [] ``` ## DESCRIPTION @@ -109,34 +109,7 @@ Parameter Sets: File Aliases: Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InformationAction -This parameter is introduced in Windows PowerShell 3.0.```yaml -Type: ActionPreference -Parameter Sets: (All) -Aliases: infa -Accepted values: SilentlyContinue, Stop, Continue, Inquire, Ignore, Suspend - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InformationVariable -This parameter is introduced in Windows PowerShell 3.0.```yaml -Type: String -Parameter Sets: (All) -Aliases: iv - -Required: False -Position: Named +Position: 0 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/reference/6/Microsoft.PowerShell.Utility/Update-TypeData.md b/reference/6/Microsoft.PowerShell.Utility/Update-TypeData.md index da6b69eeec7e..745f56fea75a 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Update-TypeData.md +++ b/reference/6/Microsoft.PowerShell.Utility/Update-TypeData.md @@ -64,7 +64,7 @@ If you are getting .NET Framework properties, you can work around the suppressio Note that method syntax can only be used with .NET Framework properties. Properties that are added by running the **Update-TypeData** cmdlet cannot use method syntax. -For more information about the *types.ps1xml files in Windows PowerShell, see about_Types.ps1xml (..\Microsoft.PowerShell.Core\About\about_Types.ps1xml.md). +For more information about the *types.ps1xml files in PowerShell, see [about_Types.ps1xml](../Microsoft.PowerShell.Core/About/about_Types.ps1xml.md). ## EXAMPLES diff --git a/reference/docs-conceptual/setup/PS-remoting-second-hop.md b/reference/docs-conceptual/setup/PS-remoting-second-hop.md index c790cd80dc1f..937b7e20e5a8 100644 --- a/reference/docs-conceptual/setup/PS-remoting-second-hop.md +++ b/reference/docs-conceptual/setup/PS-remoting-second-hop.md @@ -271,12 +271,12 @@ You can pass credentials inside the **ScriptBlock** parameter of a call to the - Does not require special server configuration. - Works on any server running WMF 2.0 or later. -## Cons +### Cons - Requires an awkward code technique. - If running WMF 2.0, requires different syntax for passing arguments to a remote session. -## Example +### Example The following example shows how to pass credentials in an **Invoke-Command** script block: