diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Get-FormatData.md b/reference/5.1/Microsoft.PowerShell.Utility/Get-FormatData.md index da166c6085be..7a12bf36d3cd 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Get-FormatData.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Get-FormatData.md @@ -39,41 +39,64 @@ PS C:\> Get-FormatData This command gets all the formatting data in the session. ### Example 2: Get formatting data by type name -``` -PS C:\> Get-FormatData -TypeName "Microsoft.Wsman*" +```powershell +PS C:\> Get-FormatData -TypeName 'System.Management.Automation.Cmd*' ``` -This command gets the formatting data items whose names begin with Microsoft.Wsman. +This command gets the formatting data items whose names begin with System.Management.Automation.Cmd*. ### Example 3: Examine a formatting data object -``` -PS C:\> $F = Get-FormatData -TypeName helpinfoshort +```powershell +PS C:\> $F = Get-FormatData -TypeName 'System.Management.Automation.Cmd*' PS C:\> $F +``` +```Output TypeName FormatViewDefinition -------- -------------------- -HelpInfoShort {help , TableControl} PS C:\> $F.FormatViewDefinition[0].control -Headers Rows -------- ---- -{System.Management.Automation.TableControlColumnHeader, System.Manageme... {System.Management.Automation.TableControlRow} PS C:\> $F.FormatViewDefinition[0].control.headers -Label Alignment Width ------ --------- ----- -Name Left 33 -Category Left 9 -Undefined 0 +HelpInfoShort {help , TableControl} +``` +```powershell +PS C:\> $F.FormatViewDefinition[0].control +``` +```Output +Headers : {System.Management.Automation.TableControlColumnHeader, System.Management.Automation.TableControlColumnHeader, System.Management.Automation.TableControlColumnHeader, + System.Management.Automation.TableControlColumnHeader} +Rows : {System.Management.Automation.TableControlRow} +AutoSize : False +HideTableHeaders : False +GroupBy : +OutOfBand : False +``` +```powershell +PS C:\> $F.FormatViewDefinition[0].control.Headers +``` +```Output +Label Alignment Width +----- --------- ----- +CommandType Undefined 15 +Name Undefined 50 +Version Undefined 10 +Source Undefined 0 ``` This example shows how to get a formatting data object and examine its properties. ### Example 4: Get formatting data and export it -``` +```powershell PS C:\> $A = Get-FormatData PS C:\> Import-Module bitstransfer PS C:\> $B = Get-FormatData PS C:\> Compare-Object $A $B +``` +```Output InputObject SideIndicator ----------- ------------- Microsoft.BackgroundIntelligentTransfer.Management.BitsJob => PS C:\> Get-FormatData *bits* | Export-FormatData -FilePath c:\test\bits.format.ps1xml +``` +```powershell PS C:\> Get-Content c:\test\bits.format.ps1xml +``` +```Output <?xml version="1.0" encoding="utf-8"?><Configuration><ViewDefinitions> <View><Name>Microsoft.BackgroundIntelligentTransfer.Management.BitsJob</Name> ... @@ -88,10 +111,59 @@ It uses a pipeline operator (|) to send the format type object to the Export-For The final command shows an excerpt of the format.ps1xml file content. +### Example 5: Get formatting data based on the specified version of PowerShell +```powershell +PS C:\> Get-FormatData -TypeName 'Microsoft.Powershell.Utility.FileHash' -PowerShellVersion 1.0 + +TypeNames FormatViewDefinition +--------- -------------------- +{Microsoft.Powershell.Utility.FileHash} {Microsoft.Powershell.Utility.FileHash} + +PS C:\> Get-FormatData -TypeName 'Microsoft.Powershell.Utility.FileHash' -PowerShellVersion 2.0 + +TypeNames FormatViewDefinition +--------- -------------------- +{Microsoft.Powershell.Utility.FileHash} {Microsoft.Powershell.Utility.FileHash} + +PS C:\> Get-FormatData -TypeName 'Microsoft.Powershell.Utility.FileHash' -PowerShellVersion 3.0 + +TypeNames FormatViewDefinition +--------- -------------------- +{Microsoft.Powershell.Utility.FileHash} {Microsoft.Powershell.Utility.FileHash} + +PS C:\> Get-FormatData -TypeName 'Microsoft.Powershell.Utility.FileHash' -PowerShellVersion 4.0 + +TypeNames FormatViewDefinition +--------- -------------------- +{Microsoft.Powershell.Utility.FileHash} {Microsoft.Powershell.Utility.FileHash} + +PS C:\> Get-FormatData -TypeName 'Microsoft.Powershell.Utility.FileHash' -PowerShellVersion 5.0 + +TypeNames FormatViewDefinition +--------- -------------------- +{Microsoft.Powershell.Utility.FileHash} {Microsoft.Powershell.Utility.FileHash} + +PS C:\> Get-FormatData -TypeName 'Microsoft.Powershell.Utility.FileHash' -PowerShellVersion 5.1 + +TypeNames FormatViewDefinition +--------- -------------------- +{Microsoft.Powershell.Utility.FileHash} {Microsoft.Powershell.Utility.FileHash} + +PS C:\> Get-FormatData -TypeName 'Microsoft.Powershell.Utility.FileHash' -PowerShellVersion 6.0 + +TypeNames FormatViewDefinition +--------- -------------------- +{Microsoft.Powershell.Utility.FileHash} {Microsoft.Powershell.Utility.FileHash} +``` + +This example shows how to use **Get-FormatData** to get format data for a specified TypeName and a +specified PowerShell version. + ## PARAMETERS ### -PowerShellVersion - +Specify the version of PowerShell this cmdlet gets for the formatting data. +Enter a two digit number seperated by a period. ```yaml Type: Version diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Get-Runspace.md b/reference/5.1/Microsoft.PowerShell.Utility/Get-Runspace.md index 252801918821..7e0602696d6d 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Get-Runspace.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Get-Runspace.md @@ -11,7 +11,7 @@ title: Get-Runspace # Get-Runspace ## SYNOPSIS -Gets active runspaces within a Windows PowerShellhost process. +Gets active runspaces within a Windows PowerShell host process. ## SYNTAX @@ -35,20 +35,62 @@ The **Get-Runspace** cmdlet gets active runspaces in a Windows PowerShell host p ## EXAMPLES -### 1: +### Example 1: Get runspaces +```powershell +PS C:\> Get-Runspace ``` +```Output + Id Name ComputerName Type State Availability + -- ---- ------------ ---- ----- ------------ + 1 Runspace1 localhost Local Opened Busy + 2 Runspace2 localhost Local Opened Available + 3 Runspace3 localhost Local Opened Available ``` -### 2: +### Example 2: Get runspace by Id +```powershell +PS C:\> Get-Runspace -Id 2 ``` +```Output + Id Name ComputerName Type State Availability + -- ---- ------------ ---- ----- ------------ + 2 Runspace2 localhost Local Opened Available ``` +### Example 3: Get runspace by Name +```powershell +PS C:\> Get-Runspace -Name Runspace1 +``` + +```Output + Id Name ComputerName Type State Availability + -- ---- ------------ ---- ----- ------------ + 1 Runspace1 localhost Local Opened Busy +``` + +### Example 4: Get runspace by InstanceId +```powershell +PS C:\> $activeRunspace = Get-Runspace -Name Runspace1 + +PS C:\> Get-Runspace -InstanceId $activeRunspace.InstanceId +``` + +```Output + Id Name ComputerName Type State Availability + -- ---- ------------ ---- ----- ------------ + 1 Runspace1 localhost Local Opened Busy +``` + +In this example, we identify an available runspace using the `Name` parameter and we store the return object to a new +variable named `$activeRunspace`. The second example, we call `Get-Runspace` with the `InstanceId` parameter and pass +in the `$activeRunspace` variable but we specify the `InstanceId` property on our reuturn object. + ## PARAMETERS ### -Id - +Specifies the Id of a runspace ```yaml Type: Int32[] @@ -78,7 +120,7 @@ Accept wildcard characters: False ``` ### -Name - +Specifies the Name of a runspace ```yaml Type: String[] @@ -99,6 +141,9 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## OUTPUTS +### System.Management.Automation.Runspaces.RunspaceBase +You can pipe the results of a **Get-Runspace** command to **Debug-Runspace**. + ## NOTES ## RELATED LINKS diff --git a/reference/6/Microsoft.PowerShell.Utility/Get-FormatData.md b/reference/6/Microsoft.PowerShell.Utility/Get-FormatData.md index 788d1a6b930d..7417a15ef22f 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Get-FormatData.md +++ b/reference/6/Microsoft.PowerShell.Utility/Get-FormatData.md @@ -40,41 +40,64 @@ PS C:\> Get-FormatData This command gets all the formatting data in the session. ### Example 2: Get formatting data by type name -``` -PS C:\> Get-FormatData -TypeName "Microsoft.Wsman*" +```powershell +PS C:\> Get-FormatData -TypeName 'System.Management.Automation.Cmd*' ``` -This command gets the formatting data items whose names begin with Microsoft.Wsman. +This command gets the formatting data items whose names begin with System.Management.Automation.Cmd*. ### Example 3: Examine a formatting data object -``` -PS C:\> $F = Get-FormatData -TypeName helpinfoshort +```powershell +PS C:\> $F = Get-FormatData -TypeName 'System.Management.Automation.Cmd*' PS C:\> $F +``` +```Output TypeName FormatViewDefinition -------- -------------------- -HelpInfoShort {help , TableControl} PS C:\> $F.FormatViewDefinition[0].control -Headers Rows -------- ---- -{System.Management.Automation.TableControlColumnHeader, System.Manageme... {System.Management.Automation.TableControlRow} PS C:\> $F.FormatViewDefinition[0].control.headers -Label Alignment Width ------ --------- ----- -Name Left 33 -Category Left 9 -Undefined 0 +HelpInfoShort {help , TableControl} +``` +```powershell +PS C:\> $F.FormatViewDefinition[0].control +``` +```Output +Headers : {System.Management.Automation.TableControlColumnHeader, System.Management.Automation.TableControlColumnHeader, System.Management.Automation.TableControlColumnHeader, + System.Management.Automation.TableControlColumnHeader} +Rows : {System.Management.Automation.TableControlRow} +AutoSize : False +HideTableHeaders : False +GroupBy : +OutOfBand : False +``` +```powershell +PS C:\> $F.FormatViewDefinition[0].control.Headers +``` +```Output +Label Alignment Width +----- --------- ----- +CommandType Undefined 15 +Name Undefined 50 +Version Undefined 10 +Source Undefined 0 ``` This example shows how to get a formatting data object and examine its properties. ### Example 4: Get formatting data and export it -``` +```powershell PS C:\> $A = Get-FormatData PS C:\> Import-Module bitstransfer PS C:\> $B = Get-FormatData PS C:\> Compare-Object $A $B +``` +```Output InputObject SideIndicator ----------- ------------- Microsoft.BackgroundIntelligentTransfer.Management.BitsJob => PS C:\> Get-FormatData *bits* | Export-FormatData -FilePath c:\test\bits.format.ps1xml +``` +```powershell PS C:\> Get-Content c:\test\bits.format.ps1xml +``` +```Output <?xml version="1.0" encoding="utf-8"?><Configuration><ViewDefinitions> <View><Name>Microsoft.BackgroundIntelligentTransfer.Management.BitsJob</Name> ... @@ -89,6 +112,54 @@ It uses a pipeline operator (|) to send the format type object to the Export-For The final command shows an excerpt of the format.ps1xml file content. +### Example 5: Get formatting data based on the specified version of PowerShell +```powershell +PS C:\> Get-FormatData -TypeName 'Microsoft.Powershell.Utility.FileHash' -PowerShellVersion 1.0 + +TypeNames FormatViewDefinition +--------- -------------------- +{Microsoft.Powershell.Utility.FileHash} {Microsoft.Powershell.Utility.FileHash} + +PS C:\> Get-FormatData -TypeName 'Microsoft.Powershell.Utility.FileHash' -PowerShellVersion 2.0 + +TypeNames FormatViewDefinition +--------- -------------------- +{Microsoft.Powershell.Utility.FileHash} {Microsoft.Powershell.Utility.FileHash} + +PS C:\> Get-FormatData -TypeName 'Microsoft.Powershell.Utility.FileHash' -PowerShellVersion 3.0 + +TypeNames FormatViewDefinition +--------- -------------------- +{Microsoft.Powershell.Utility.FileHash} {Microsoft.Powershell.Utility.FileHash} + +PS C:\> Get-FormatData -TypeName 'Microsoft.Powershell.Utility.FileHash' -PowerShellVersion 4.0 + +TypeNames FormatViewDefinition +--------- -------------------- +{Microsoft.Powershell.Utility.FileHash} {Microsoft.Powershell.Utility.FileHash} + +PS C:\> Get-FormatData -TypeName 'Microsoft.Powershell.Utility.FileHash' -PowerShellVersion 5.0 + +TypeNames FormatViewDefinition +--------- -------------------- +{Microsoft.Powershell.Utility.FileHash} {Microsoft.Powershell.Utility.FileHash} + +PS C:\> Get-FormatData -TypeName 'Microsoft.Powershell.Utility.FileHash' -PowerShellVersion 5.1 + +TypeNames FormatViewDefinition +--------- -------------------- +{Microsoft.Powershell.Utility.FileHash} {Microsoft.Powershell.Utility.FileHash} + +PS C:\> Get-FormatData -TypeName 'Microsoft.Powershell.Utility.FileHash' -PowerShellVersion 6.0 + +TypeNames FormatViewDefinition +--------- -------------------- +{Microsoft.Powershell.Utility.FileHash} {Microsoft.Powershell.Utility.FileHash} +``` + +This example shows how to use **Get-FormatData** to get format data for a specified TypeName and a +specified PowerShell version. + ## PARAMETERS ### -InformationAction @@ -136,7 +207,8 @@ Accept wildcard characters: False ``` ### -PowerShellVersion - +Specify the version of PowerShell this cmdlet gets for the formatting data. +Enter a two digit number seperated by a period. ```yaml Type: Version diff --git a/reference/docfx.json b/reference/docfx.json index a8365f764236..04bbc9671568 100644 --- a/reference/docfx.json +++ b/reference/docfx.json @@ -1,7 +1,6 @@ { "build": { - "content": [ - { + "content": [{ "files": [ "bread-pscore/toc.yml" ] @@ -199,6 +198,7 @@ "resource": [ { "files": [ + "**/images/**", "**/*.png", "**/*.jpg" ], @@ -206,6 +206,66 @@ "**/obj/**", "**/includes/**" ] + }, + { + "files": [ + "**/images/**", + "**/*.png", + "**/*.jpg" + ], + "exclude": [ + "**/obj/**", + "**/includes/**" + ], + "version": "powershell-3.0" + }, + { + "files": [ + "**/images/**", + "**/*.png", + "**/*.jpg" + ], + "exclude": [ + "**/obj/**", + "**/includes/**" + ], + "version": "powershell-4.0" + }, + { + "files": [ + "**/images/**", + "**/*.png", + "**/*.jpg" + ], + "exclude": [ + "**/obj/**", + "**/includes/**" + ], + "version": "powershell-5.0" + }, + { + "files": [ + "**/images/**", + "**/*.png", + "**/*.jpg" + ], + "exclude": [ + "**/obj/**", + "**/includes/**" + ], + "version": "powershell-5.1" + }, + { + "files": [ + "**/images/**", + "**/*.png", + "**/*.jpg" + ], + "exclude": [ + "**/obj/**", + "**/includes/**" + ], + "version": "powershell-6" } ], "versions": { diff --git a/reference/docs-conceptual/core-powershell/WSMan-Remoting-in-PowerShell-Core.md b/reference/docs-conceptual/core-powershell/WSMan-Remoting-in-PowerShell-Core.md index 41021451931d..93e0eff36c53 100644 --- a/reference/docs-conceptual/core-powershell/WSMan-Remoting-in-PowerShell-Core.md +++ b/reference/docs-conceptual/core-powershell/WSMan-Remoting-in-PowerShell-Core.md @@ -35,13 +35,14 @@ Install-PowerShellRemoting.ps1 #### Executed by another instance of PowerShell on behalf of the instance that it will register ``` powershell -<path to powershell>\Install-PowerShellRemoting.ps1 -PowerShellHome "<absolute path to the instance's $PSHOME>" -PowerShellVersion "<the powershell version tag>" +<path to powershell>\Install-PowerShellRemoting.ps1 -PowerShellHome "<absolute path to the instance's $PSHOME>" ``` For Example: ``` powershell -C:\Program Files\PowerShell\6.0.0.9\Install-PowerShellRemoting.ps1 -PowerShellHome "C:\Program Files\PowerShell\6.0.0.9\" -PowerShellVersion "6.0.0-alpha.9" +Set-Location -Path 'C:\Program Files\PowerShell\6.0.0\' +.\Install-PowerShellRemoting.ps1 -PowerShellHome "C:\Program Files\PowerShell\6.0.0\" ``` **NOTE:** The remoting registration script will restart WinRM, so all existing PSRP sessions will terminate immediately after the script is run. If run during a remote session, this will terminate the connection. @@ -51,8 +52,8 @@ C:\Program Files\PowerShell\6.0.0.9\Install-PowerShellRemoting.ps1 -PowerShellHo Create a PowerShell session to the new PowerShell endpoint by specifying `-ConfigurationName "some endpoint name"`. To connect to the PowerShell instance from the example above, use either: ``` powershell -New-PSSession ... -ConfigurationName "powershell.6.0.0-alpha.9" -Enter-PSSession ... -ConfigurationName "powershell.6.0.0-alpha.9" +New-PSSession ... -ConfigurationName "powershell.6.0.0" +Enter-PSSession ... -ConfigurationName "powershell.6.0.0" ``` Note that `New-PSSession` and `Enter-PSSession` invocations that do not specify `-ConfigurationName` will target the default PowerShell endpoint, `microsoft.powershell`. diff --git a/reference/docs-conceptual/setup/Installing-PowerShell-Core-on-Windows.md b/reference/docs-conceptual/setup/Installing-PowerShell-Core-on-Windows.md index 4d7eb338bd86..a88579a5e3e9 100644 --- a/reference/docs-conceptual/setup/Installing-PowerShell-Core-on-Windows.md +++ b/reference/docs-conceptual/setup/Installing-PowerShell-Core-on-Windows.md @@ -3,9 +3,10 @@ ## MSI To install PowerShell on a Windows client or Windows Server (works on Windows 7 SP1, Server 2008 R2, and later), download the MSI package from -<!-- TODO: either the Download Center or --> our GitHub [releases][] page. + The MSI file looks like this - `PowerShell-6.0.0.<buildversion>.<os-arch>.msi` +<!-- TODO: should be updated to point to the Download Center as well --> Once downloaded, double-click the installer and follow the prompts. diff --git a/reference/docs-conceptual/whats-new/What-s-New-in-PowerShell-Core-60.md b/reference/docs-conceptual/whats-new/What-s-New-in-PowerShell-Core-60.md index 81b2d64ff4da..8b2a5edecb44 100644 --- a/reference/docs-conceptual/whats-new/What-s-New-in-PowerShell-Core-60.md +++ b/reference/docs-conceptual/whats-new/What-s-New-in-PowerShell-Core-60.md @@ -236,7 +236,7 @@ For more information about PowerShell jobs, see [about_Jobs](https://msdn.micros - `PSEdition`: This is set to `Core` on PowerShell Core and `Desktop` on Windows PowerShell - `GitCommitId`: This is the Git commit ID of the Git branch or tag where PowerShell was built. On released builds, it will likely be the same as `PSVersion`. - - `OS`: This is an OS version string returned by `[System.Environment]::OSVersion.VersionString` + - `OS`: This is an OS version string returned by `[System.Runtime.InteropServices.RuntimeInformation]::OSDescription` - `Platform`: This is returned by `[System.Environment]::OSVersion.Platform` It is set to `Win32NT` on Windows, `MacOSX` on macOS, and `Unix` on Linux. - Removed the `BuildVersion` property from `$PSVersionTable`.