Skip to content

Commit 12dcead

Browse files
author
Sean Wheeler
authored
Merging to live to fix missing images (#2047)
* Update the example of `Where-Object -IsNot` (#1841) * Update Example 5 in Group-Object.md (#1845) * removing @{Text=} tags * fixing UTF8 characters * removed empty H3 * added H3 for input and output types * removed mangled UTF8 character * updating Out-* commands with -NoNewLine per Issue 1739 * Fix the example of `Format-Table -DisplayError` (#1848) The example is a `-DisplayError` parameter example. But it uses `-ShowError` parameter. * Fix the example of `Format-Wide -DisplayError` (#1850) * Fix the example of `Format-Custom -DisplayError` (#1849) The example is a -DisplayError parameter example. But it uses -ShowError parameter. * updating set-acl docs per PR#901 * using semantic link breaks * Fix the example of `Format-Wide -ShowError` (#1851) * Fixed Test-ScriptFileInfo example (#1852) * fixing issue 1768 * Formatting, example fix for Body parameter (#1847) 1. Replaced variable names with PascalCase convention and for consistency 2. Removed directory information [c:\] in the examples 3. Put powershell keyword for formatting examples 4. Replaced Invoke-RestMethod with Invoke-WebRequest in the Body example, added method Post 5. Removed InformationAction and InformationVariable parameters, which were mistakenly a copy of Body, included already in CommonVariables part * fixing style consistency across articles * Fix example numbers in Resume-Job.md (#1857) Example 4 is duplicated. * Fixes typo $WebSiteName in separatingEnvData.md (#1856) - Adds the website name to common node property inside configuration data. - Also, it is now referenced (e.g. $Node.WebSiteName) in the DSC configuration document in MyWebApp.ps1. * Updates configurations.md (#1855) Two set of changes made. - Example scripts e.g. MyDscConfiguration.ps1 define the configuration inside them and call the configuration at the end line. Removed the call to the configuration at the end. Since the article demonstrates dot-sourcing the file and calling the configuration explicitly. - Fixed typo in the file name (TEST-PC1.mof to localhost.mof ), since the ComputerName was not specified it should default to using 'localhost' as the default argument for it. P.S. - There is a comment on the web-page regarding the fixes made * Fix typo in comment (#1854) * Updating the help content for v6. (#1853) * Updating the help content for v6. * Address code review comments * Fix broken links * Fix example numbers in about_Transactions.md (#1859) Example number '7' is duplicated. * Update Alias-Provider.md (#1831) 1. Removed statement that an alias is to an executable, the definition cotnains the path. It may - but does not need to be. For example: Try Set-Alias np Notepad then look at the definition. 2. Clarified that an alias can also be to a powershell script (ps1 file). 3. Tidied up the language removing multiple 'And,' clauses to improve readability. * Add documentation of new -AsHashtable switch for ConvertFrom-Json introduced by PR #5043 (#1858) * add documentation of new -AsHashTable switch for ConvertFrom-Json and also document the behaviour in case of duplicate strings. * correct casing of -AsHashtable switch. * Address PR comments about -AsHashtable switch for ConvertFrom-Json.md * Accept pipeline input: False for -AsHashtable switch in ConvertFrom-Json.md * Revert "Accept pipeline input: False for -AsHashtable switch in ConvertFrom-Json.md" Accidentally change the wrong field. This reverts commit 6e76191. * Accept pipeline input: False for -AsHashtable switch in ConvertFrom-Json.md * Fix example numbers in Invoke-WebRequest.md (#1862) Example number '4' is duplicated. * reformatting and integrating changes from PR#1831 (#1860) * Fix example numbers in Get-Help.md (#1869) Example number 12 and 13 are missing. * Fix example numbers in Import-Module.md (#1868) Example number '10' is duplicated. * Fix example number in ConvertTo-Html.html (#1867) Example number '10' is duplicated. * Update dscCiCd.md (#1865) Missing a period on line 378. Should be `$(Build.ArtifactStagingDirectory)\` not `$(BuildArtifactStagingDirectory)\`. * Web Cmdlets 6.0.0 Documentation Refresh (#1870) * Web Cmdlets 6.0.0 Documentation Refresh * Address PR Feedback * Merge Example 4 and 5 in Get-Member.md (#1874) Example 4 and 5 in Get-Member.md v3.0 and v4.0 are almost the same. They should be merged as with v5.0. * Remove hash algorithms unsupported in v6.0 (#1873) MACTripleDES and RIPEMD160 are no longer supported in v6.0. * Update outputs of Get-Verb (#1872) Since v6.0, `Get-Verb` returns not MemberDefinition but VerbInfo that has Verb and Group properties. * Fix typo in ConvertTo-Html.md (UTF-x) (#1879) * Fix "Accept wildcard characters" in Get-Service.md v6 (#1878) * Fixed "False" -> "True" (`DisplayName`, `Exclude`, `Include`, and `Name`) * Removed `InformationAction` and `InformationVariable` * Fixed Get-WindowsFeature cmdlet HyperLink (#1877) * Fixed Get-WindowsFeature cmdlet HyperLink Minor edit. Update Get-WindowsFeature cmdlet HyperLink to https://technet.microsoft.com/library/jj205469(v=wps.630).aspx * Changed URL to new docs.microsoft.com location The TechNet URL did not work. TechNet and MSDN are being retired. * Update Get-WinEvent.md (#1876) Removed future tense in a couple of places to improve readability. Minor edit. * Update Example 8 in Get-Process.md (find the owner of a process) (#1875) * Update Example 8 in Get-Process.md (Find the owner of a process) * Update to attempt to avoid build errors It seems that the build system does not accept multiple script blocks per one Example header. * updated localmachine\Root to LocalMachine\My (#1880) The example where we import the PFX on the target node should import the cert into Personal store and not root. * Update Group property example in Get-Verb.md (#1881) * adding missing space (#1885) * removing stray character (#1886) * Update Example 9 in Get-Process.md (#1888) * powershell -> pwsh (only v6.0) * Windows PowerShell -> PowerShell * Remove "About ISE" files of v6.0 (#1891) * Remove "About ISE" files of v6.0 ISE is no longer bundled with PowerShell 6.0. * Remove links for "About ISE" files of v6.0 * Update Get-Process.md (#1890) Fixed name parameter details to show it accepts wildcards in the name * Update productincompat.md (#1892) The list of compatible systems should include Skype For Business Server 2015 and Lync Server 2013. * Update unapproved verbs examples in Get-Verb.md (#1896) * Updated Example 4 * Removed Example 5 * Removing extra space in the Example 5A script (#1894) It was highlighting as string in the documentation, I was trying to remove all the extra space. * fixing merge conflict * updates to style and contrib * tweak format * tweak format 2 * fix typo * fix number list example * adding review feedback * fix broken links * incorporating feedback from zach * reformatting About_* for 80 columns - part 1 * reformat about_* * reformatting About_* topics - Part 2 * fixing broken links * fixing more broken links * more broken links fixed * Fix parameter's position in Get-Random.md (#1901) * Fix parameter's position in Measure-Command.md (#1905) * Fix parameter's position in Trace-Command.md (#1904) * Actually call the configuration in the example (#1906) On line 74, it says... "The last line of the example containing only the name of the configuration, calls the configuration." This change actually makes that call. * reformatting About_* for 80 columns - part 3 (#1902) * reformatting About_* * reformatting About_* part 3 * fixing broken links * fixing more broken links * one more time with the links * reformatting About_* for 80 columns - part 4 * Adding PreRelease versioning info for PSGallery & PSGet (#1903) * PowerShellGet PreRelease Support Adding descriptive doc for pre-release versioning support * Correcting typos in pre-release doc Minor typos and case issues fixed * Updated prerelease info based on feedback Mostly cosmetic updates. Functional change: added line 28, stating we only support 3-segment module versions. * Adding prerelease to module install update find save commands * Updating PSGet -Script commands for Prerelease support * Hyphen listed as optional rather than preferred in Prereleasestring * Minor corrections from Rebro review * Addressing @sdwheeler feedback on links and double slashes * Fixing broken link * Update PreReleaseScript.md * Style tweaks in STYLE.md (#1913) * Fix YAML metadata on "Understanding Concepts" (#1911) I'm not quite sure what this means, but it certainly looks terrible on docs.microsoft.com when it's malformed. (To be perfectly honest, I only managed to even figure out it's called "YAML metadata" by peeking at the DOM of github's HTML.) * Fix parameter's position in Join-Path.md (#1909) * typo correction on line 85 (#1916) E:\Windows\Sytem32 sould be E:\Windows\System32 * Fix parameter's position in Get-TraceSource.md (#1917) * Changed required PSGet version to 1.6.0 (#1920) * Update Example 5 in Get-Process.md (#1923) * fixing backlashes reported in PR1921 (#1924) * fixing backlashes reported in PR1921 * found more backslashes * reformatting About_* for 80 columns - part 5 * reformatting About_* for 80 columns - part 6 * incorporating review feedback * reformatting About_* for 80 columns - part 7 * Fixed formatting of output per issue #808 * Fix typo in syntax description (#1931) * Fix parameter's position in ConvertTo-Xml.md (#1929) * Remove descriptions about ComputerName parameter in Get-Process.md v6.0 (#1928) * Line 192 Single Quote Breaks Example (#1930) * Line 192 Single Quote Breaks Example * clarified the example for -Regex * Update Example 2 in Get-Alias.md (ineffective Exclude) (#1935) `-Exclude Get-*` is ineffective because there are no aliases that begin with `Get-`. * Fix formatting: DESCRIPTION section in ConvertTo-Xml.md (#1934) * Fix typo in Unregister-ScheduledJob (#1932) * Update Unregister-ScheduledJob.md * Update Unregister-ScheduledJob.md * Update Unregister-ScheduledJob.md * Update Unregister-ScheduledJob.md * Fix parameter's position in ConvertFrom-Csv.md (#1937) * fix typo on metaConfig.md (#1936) fixed typo * Quick edits (#1938) * Changed required PSGet version to 1.6.0 * Fixes to PSGet TOC and WMF 5.1 compat page * Update Get-Item.md (#1942) Proof-read some of the examples. The first two were wrong entirely: The user must be in the ps-test folder for the result shown to happen. * Add description about Format-Hex -InputObject (#1939) * Fix parameter's position in Add-Member.md (#1946) * Fix parameter's position in Select-Object.md (#1945) * Correcting add to hash table example (#1944) * Update about_Hash_Tables.md corrected add to hash table example in 3.0 * Update about_Hash_Tables.md corrected add to hash table examples in 4.0 * Update about_Hash_Tables.md corrected add to hash table example in 5.0 * Update about_Hash_Tables.md corrected add to hash table example in 5.1 * Update about_Hash_Tables.md corrected add to hash table example in 6 * Fix Set-TraceSource -ListenerOption parameter (#1949) * Fixed the value of "Accepted values:" * Fixed minor differences in formatting and wording * Fix Trace-Command -ListenerOption parameter (#1948) * Fixed the value of "Accepted values:" * Fixed minor differences in formatting and wording * Fix parameter's position in Select-Xml.md (#1953) * Fix Get-Alias -Name parameter (#1952) * Position: 0 * Default value: All aliases * Accept wildcard characters: True * Fixed minor differences in formatting and wording And also removed InformationAction/InformationVariable in v6.0. * Wmf 5.1 cleanup (#1950) * Changed required PSGet version to 1.6.0 * Fixes to PSGet TOC and WMF 5.1 compat page * Add note explaining WMF does not ship in Windows * Typo fix ("you will are not" -> "you will not"). (#1951) * Typo fix ("you will are not" -> "you will not"). * Changed from passive voice to active voice * added article about formatting code samples * fixing typos * fixed typos and incorporated feedback * updating metadata tags in docfx.json * fixing filename spelling * Fix parameter's position in Get-Content.md (#1959) * Fix parameter's position in Get-Member.md (#1958) * Update PSGallery "Items Tab" (for the new prerelease feature) (#1957) * Fix link for about_WorkflowCommonParameters in New-PSWorkflowExecutionOption.md (#1962) * Fix link for about_Types.ps1xml in Update-TypeData.md (#1961) * Fix parameter's position in Group-Object.md (#1966) * Fix hex values in about_Arithmetic_Operators.md (#1965) * Indent headers as subheaders (#1967) * Update minor typo in Limit-EventLog.md (#1968) * Update Example 3 in Get-FileHash.md (#1969) * Fix parameter's position in Tee-Object.md (#1970) * fixing output example per issue 1933 * fix -Path metadata to reflect wildcard support * fixing issue 1640 * fixing issue 1651 * Fix link for about_Remote_Requirements (#1976) * Split parameter set in Sort-Object.md v6.0 (#1975) Since v6.0, Sort-Object cmdlet has two parameter sets, "Default" and "Bottom". * Fix link for about_Preference_Variables (#1982) http://... -> relative path * Fix broken headers in Get-CimSession.md v6.0 (#1981) * Update Example 1 in Import-Counter.md (#1980) * move $OFS to prefs article added note about read-only (#1978) * Update decisionMaker.md (#1984) Slight, but critical corrections to the definition of DevOps. * Update configurations.md (#1985) * Fix parameter's position in Restart-Service.md (#1993) * Fix link for logical operators in about_Operator_Precedence.md (#1992) * Update scriptResource.md (#1986) Match specified GetScript rule * Bad link (#1988) The link "http://go.microsoft.com/fwlink/?LinkId=119096" is supposed to point to a page or a document about "Code-Signing Best Practices". However, it points to a video about "Understanding Extension INFs and Component INFs". I watched the whole video and there is nothing inside about "Code-Signing Best Practices". The best match I have found is the following one: http://download.microsoft.com/download/a/f/7/af7777e5-7dcd-4800-8a0a-b18336565f5b/best_practices.doc It would be a very good idea to make a web page from this document. Pieces of advice it contains are still accurate. * Update Example 1 of Protect-CmsMessage (#1987) The existing example did not specify you needed to create the INF. This not only says so but does so using a script block piped to out-file * Small edits for mispellings (#1989) * Corrected command (#1990) The CanPauseAndContinue property is a boolean so the correct comparison to use is $true rather than "True". * removing module ref for modules that do not ship in v6-rc2 (#1996) * Fix parameter's position in Resume-Service.md (#1998) * Fix link for about_Providers (#1999) * Help doc enhancement for ConvertFrom-StringData cmdlet (#2002) * Help doc correction Removed an unwanted * from Notes section Corrected intenting for last example Removed unwanted ... from example 2 * Help doc wnhancements in all versions for ConvertFrom-StringData Removed an unwanted * from Notes section Corrected intenting for last example Removed unwanted ... from example 2 * PowerShell 6 logging on Windows, Linux, and MacOS (#1922) * First draft of PowerShell 6 logging * Fix style guideline issues. * Document logging settings in PowerShellProperties.json * Address PR Feedback Limit lines to 80 columns, when possible Insert <br> in selected locations to improve readability of rendered markdown. * Reformatted tables Reformatted tables to work with new processing of About_* topics * Adding calling the ComputerName parameter to the example (#1964) * Adding calling the ComputerName parameter to the example * Changing quotes to brackets * Removed unused variable in Example 1 (#2004) The variable was declared but not used. It also appears in the same place in Example 2 but is used later on. * Made surrounding text agree with sample code. (#2003) * Reformatting v4 About_ topics missed in first pass (#2006) * v4 about scrub missed files * fixing broken links * fix broken link * Reformatting v3 About_ topics missed in first pass (#2005) * v3 about scrub missed files * fixing broken links * fix broken link * Reformatting v5 About_ topics missed in first pass (#2008) * v5 about scrub missed files * fixing broken links * v5.1 about scrub missed files (#2009) * Reformatting v6 About_ topics missed in first pass (#2010) * v6 about scrub missed files * fixing broken links and removing non-v6 content * final pass on About_ topic reformat (#2011) * Corrected Example 3 (#2014) * Corrected Example 3 Example 3 is an example to remove the user from the group but instead it was removing the group completely. This change adds the correct syntax to perform what was intended. See #2001 * minor edits for spacing and metadata * Enable running pandoc on about topic files (#2012) * Enable running pandoc on about topic files * Remove extra line * Removed --ascii parameter from pandoc as it is not required * Creates output directory as pandoc needs it (#2018) * remove alias `sc` to match PSCore6 (#2021) * Cmdlet help for ConvertFrom-Clixml and ConvertTo-Clixml (#2022) * Cmdlet help for ConvertFrom-Clixml and ConvertTo-Clixml for Powershell#3898 * minor edits - Removed -information* common parameters - reformat code blocks - renumbered example * minor updates - reformatted examples - removed common paramters * update link to about topic * minor edits - removed common parameters - formatted code blocks * minor edits - reformatted code blocks - removed common parameters * fix broken link (#2024) * Adding more info to Contributor Guide (#2023) * adding notes about OPS extensions * added notes about OPS extensions and linking * fix typo * fix typo * Support lifecycle doc (#1994) * first pass of support lifecycle doc * add notes on MIT license * address slee's comments on support lifecycle * respond to lifecycle feedback from Sean * add lifecycle image * Fixed spelling typo * add lifecycle to TOC * respond to feedback on lifecycle * Removed en-us from URLs You need to remove locale paths from URLs. Including en-us forces the reader to English rather than being redirected to the localized version of the article that matches their locale. * add note on 12 months, fix en-us * Fixed typo * Move setup/install and remoting docs into PowerShell-Docs (#2026) This creates a couple new topics around WSMan remoting, SSH remoting, and installing/configuring PowerShell Core. It also adds a topic on using VS Code with PowerShell. * PowerShell Core 6.0 release notes (#2020) What's New in PowerShell Core 6.0 * update TOC and change title of setup mac/linux article (#2030) * update TOC and change title of setup mac/linux article * fix typos * attempt to fix images (#2033) * attempt to fix images * update to docfx to support images * Update docfx to add image support (#2040) * attempt to fix images * update to docfx to support images * update root docfx for images * update docfx for image support * Update Installing-PowerShell-Core-on-Windows.md (#2042) The original paged rendered badly - this edit is a move of a 'to do' comment in the MD so as to not break the sentence. * Fix $PSVersionTable.OS in What's New 6.0 (#2039) $PSVersionTable.OS is: x [System.Environment]::OSVersion.VersionString o [System.Runtime.InteropServices.RuntimeInformation]::OSDescription * Update WSMan-Remoting-in-PowerShell-Core.md (#2038) The current example doesn't work for me when specifying the full file path. It just outputs the file location rather than running the script. I had to move to the location of the file and run it from there. The parameter PowerShellVersion also doesn't appear to exist anymore so I have removed that. I've also changes file paths to match the 6.0.0 GA release rather than the previous alpha 9. * Update Get-FormatData.md (#2034) Updated Get-FormatData Markdown. Fixes #1895 * Update Get-FormatData Markdown (#2035) Updated Get-FormatData Markdown. Fixes #1895 * Updated Get-Runspace Help (#2032) Updated Get-Runspace Markdown. Fixes #1883 * updated docfx to try to fix images (#2043) * attempt to fix images * update to docfx to support images * update root docfx for images * update docfx for image support * update docfx for images * Add resource per version in docfx.json (#2046)
1 parent 8cc2914 commit 12dcead

File tree

7 files changed

+296
-45
lines changed

7 files changed

+296
-45
lines changed

reference/5.1/Microsoft.PowerShell.Utility/Get-FormatData.md

Lines changed: 88 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,41 +39,64 @@ PS C:\> Get-FormatData
3939
This command gets all the formatting data in the session.
4040

4141
### Example 2: Get formatting data by type name
42-
```
43-
PS C:\> Get-FormatData -TypeName "Microsoft.Wsman*"
42+
```powershell
43+
PS C:\> Get-FormatData -TypeName 'System.Management.Automation.Cmd*'
4444
```
4545

46-
This command gets the formatting data items whose names begin with Microsoft.Wsman.
46+
This command gets the formatting data items whose names begin with System.Management.Automation.Cmd*.
4747

4848
### Example 3: Examine a formatting data object
49-
```
50-
PS C:\> $F = Get-FormatData -TypeName helpinfoshort
49+
```powershell
50+
PS C:\> $F = Get-FormatData -TypeName 'System.Management.Automation.Cmd*'
5151
PS C:\> $F
52+
```
53+
```Output
5254
TypeName FormatViewDefinition
5355
-------- --------------------
54-
HelpInfoShort {help , TableControl} PS C:\> $F.FormatViewDefinition[0].control
55-
Headers Rows
56-
------- ----
57-
{System.Management.Automation.TableControlColumnHeader, System.Manageme... {System.Management.Automation.TableControlRow} PS C:\> $F.FormatViewDefinition[0].control.headers
58-
Label Alignment Width
59-
----- --------- -----
60-
Name Left 33
61-
Category Left 9
62-
Undefined 0
56+
HelpInfoShort {help , TableControl}
57+
```
58+
```powershell
59+
PS C:\> $F.FormatViewDefinition[0].control
60+
```
61+
```Output
62+
Headers : {System.Management.Automation.TableControlColumnHeader, System.Management.Automation.TableControlColumnHeader, System.Management.Automation.TableControlColumnHeader,
63+
System.Management.Automation.TableControlColumnHeader}
64+
Rows : {System.Management.Automation.TableControlRow}
65+
AutoSize : False
66+
HideTableHeaders : False
67+
GroupBy :
68+
OutOfBand : False
69+
```
70+
```powershell
71+
PS C:\> $F.FormatViewDefinition[0].control.Headers
72+
```
73+
```Output
74+
Label Alignment Width
75+
----- --------- -----
76+
CommandType Undefined 15
77+
Name Undefined 50
78+
Version Undefined 10
79+
Source Undefined 0
6380
```
6481

6582
This example shows how to get a formatting data object and examine its properties.
6683

6784
### Example 4: Get formatting data and export it
68-
```
85+
```powershell
6986
PS C:\> $A = Get-FormatData
7087
PS C:\> Import-Module bitstransfer
7188
PS C:\> $B = Get-FormatData
7289
PS C:\> Compare-Object $A $B
90+
```
91+
```Output
7392
InputObject SideIndicator
7493
----------- -------------
7594
Microsoft.BackgroundIntelligentTransfer.Management.BitsJob => PS C:\> Get-FormatData *bits* | Export-FormatData -FilePath c:\test\bits.format.ps1xml
95+
```
96+
```powershell
7697
PS C:\> Get-Content c:\test\bits.format.ps1xml
98+
```
99+
```Output
77100
<?xml version="1.0" encoding="utf-8"?><Configuration><ViewDefinitions>
78101
<View><Name>Microsoft.BackgroundIntelligentTransfer.Management.BitsJob</Name>
79102
...
@@ -88,10 +111,59 @@ It uses a pipeline operator (|) to send the format type object to the Export-For
88111

89112
The final command shows an excerpt of the format.ps1xml file content.
90113

114+
### Example 5: Get formatting data based on the specified version of PowerShell
115+
```powershell
116+
PS C:\> Get-FormatData -TypeName 'Microsoft.Powershell.Utility.FileHash' -PowerShellVersion 1.0
117+
118+
TypeNames FormatViewDefinition
119+
--------- --------------------
120+
{Microsoft.Powershell.Utility.FileHash} {Microsoft.Powershell.Utility.FileHash}
121+
122+
PS C:\> Get-FormatData -TypeName 'Microsoft.Powershell.Utility.FileHash' -PowerShellVersion 2.0
123+
124+
TypeNames FormatViewDefinition
125+
--------- --------------------
126+
{Microsoft.Powershell.Utility.FileHash} {Microsoft.Powershell.Utility.FileHash}
127+
128+
PS C:\> Get-FormatData -TypeName 'Microsoft.Powershell.Utility.FileHash' -PowerShellVersion 3.0
129+
130+
TypeNames FormatViewDefinition
131+
--------- --------------------
132+
{Microsoft.Powershell.Utility.FileHash} {Microsoft.Powershell.Utility.FileHash}
133+
134+
PS C:\> Get-FormatData -TypeName 'Microsoft.Powershell.Utility.FileHash' -PowerShellVersion 4.0
135+
136+
TypeNames FormatViewDefinition
137+
--------- --------------------
138+
{Microsoft.Powershell.Utility.FileHash} {Microsoft.Powershell.Utility.FileHash}
139+
140+
PS C:\> Get-FormatData -TypeName 'Microsoft.Powershell.Utility.FileHash' -PowerShellVersion 5.0
141+
142+
TypeNames FormatViewDefinition
143+
--------- --------------------
144+
{Microsoft.Powershell.Utility.FileHash} {Microsoft.Powershell.Utility.FileHash}
145+
146+
PS C:\> Get-FormatData -TypeName 'Microsoft.Powershell.Utility.FileHash' -PowerShellVersion 5.1
147+
148+
TypeNames FormatViewDefinition
149+
--------- --------------------
150+
{Microsoft.Powershell.Utility.FileHash} {Microsoft.Powershell.Utility.FileHash}
151+
152+
PS C:\> Get-FormatData -TypeName 'Microsoft.Powershell.Utility.FileHash' -PowerShellVersion 6.0
153+
154+
TypeNames FormatViewDefinition
155+
--------- --------------------
156+
{Microsoft.Powershell.Utility.FileHash} {Microsoft.Powershell.Utility.FileHash}
157+
```
158+
159+
This example shows how to use **Get-FormatData** to get format data for a specified TypeName and a
160+
specified PowerShell version.
161+
91162
## PARAMETERS
92163

93164
### -PowerShellVersion
94-
165+
Specify the version of PowerShell this cmdlet gets for the formatting data.
166+
Enter a two digit number seperated by a period.
95167

96168
```yaml
97169
Type: Version

reference/5.1/Microsoft.PowerShell.Utility/Get-Runspace.md

Lines changed: 50 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ title: Get-Runspace
1111
# Get-Runspace
1212

1313
## SYNOPSIS
14-
Gets active runspaces within a Windows PowerShellhost process.
14+
Gets active runspaces within a Windows PowerShell host process.
1515

1616
## SYNTAX
1717

@@ -35,20 +35,62 @@ The **Get-Runspace** cmdlet gets active runspaces in a Windows PowerShell host p
3535

3636
## EXAMPLES
3737

38-
### 1:
38+
### Example 1: Get runspaces
39+
```powershell
40+
PS C:\> Get-Runspace
3941
```
4042

43+
```Output
44+
Id Name ComputerName Type State Availability
45+
-- ---- ------------ ---- ----- ------------
46+
1 Runspace1 localhost Local Opened Busy
47+
2 Runspace2 localhost Local Opened Available
48+
3 Runspace3 localhost Local Opened Available
4149
```
4250

43-
### 2:
51+
### Example 2: Get runspace by Id
52+
```powershell
53+
PS C:\> Get-Runspace -Id 2
4454
```
4555

56+
```Output
57+
Id Name ComputerName Type State Availability
58+
-- ---- ------------ ---- ----- ------------
59+
2 Runspace2 localhost Local Opened Available
4660
```
4761

62+
### Example 3: Get runspace by Name
63+
```powershell
64+
PS C:\> Get-Runspace -Name Runspace1
65+
```
66+
67+
```Output
68+
Id Name ComputerName Type State Availability
69+
-- ---- ------------ ---- ----- ------------
70+
1 Runspace1 localhost Local Opened Busy
71+
```
72+
73+
### Example 4: Get runspace by InstanceId
74+
```powershell
75+
PS C:\> $activeRunspace = Get-Runspace -Name Runspace1
76+
77+
PS C:\> Get-Runspace -InstanceId $activeRunspace.InstanceId
78+
```
79+
80+
```Output
81+
Id Name ComputerName Type State Availability
82+
-- ---- ------------ ---- ----- ------------
83+
1 Runspace1 localhost Local Opened Busy
84+
```
85+
86+
In this example, we identify an available runspace using the `Name` parameter and we store the return object to a new
87+
variable named `$activeRunspace`. The second example, we call `Get-Runspace` with the `InstanceId` parameter and pass
88+
in the `$activeRunspace` variable but we specify the `InstanceId` property on our reuturn object.
89+
4890
## PARAMETERS
4991

5092
### -Id
51-
93+
Specifies the Id of a runspace
5294

5395
```yaml
5496
Type: Int32[]
@@ -78,7 +120,7 @@ Accept wildcard characters: False
78120
```
79121
80122
### -Name
81-
123+
Specifies the Name of a runspace
82124
83125
```yaml
84126
Type: String[]
@@ -99,6 +141,9 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
99141
100142
## OUTPUTS
101143
144+
### System.Management.Automation.Runspaces.RunspaceBase
145+
You can pipe the results of a **Get-Runspace** command to **Debug-Runspace**.
146+
102147
## NOTES
103148
104149
## RELATED LINKS

reference/6/Microsoft.PowerShell.Utility/Get-FormatData.md

Lines changed: 88 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,41 +40,64 @@ PS C:\> Get-FormatData
4040
This command gets all the formatting data in the session.
4141

4242
### Example 2: Get formatting data by type name
43-
```
44-
PS C:\> Get-FormatData -TypeName "Microsoft.Wsman*"
43+
```powershell
44+
PS C:\> Get-FormatData -TypeName 'System.Management.Automation.Cmd*'
4545
```
4646

47-
This command gets the formatting data items whose names begin with Microsoft.Wsman.
47+
This command gets the formatting data items whose names begin with System.Management.Automation.Cmd*.
4848

4949
### Example 3: Examine a formatting data object
50-
```
51-
PS C:\> $F = Get-FormatData -TypeName helpinfoshort
50+
```powershell
51+
PS C:\> $F = Get-FormatData -TypeName 'System.Management.Automation.Cmd*'
5252
PS C:\> $F
53+
```
54+
```Output
5355
TypeName FormatViewDefinition
5456
-------- --------------------
55-
HelpInfoShort {help , TableControl} PS C:\> $F.FormatViewDefinition[0].control
56-
Headers Rows
57-
------- ----
58-
{System.Management.Automation.TableControlColumnHeader, System.Manageme... {System.Management.Automation.TableControlRow} PS C:\> $F.FormatViewDefinition[0].control.headers
59-
Label Alignment Width
60-
----- --------- -----
61-
Name Left 33
62-
Category Left 9
63-
Undefined 0
57+
HelpInfoShort {help , TableControl}
58+
```
59+
```powershell
60+
PS C:\> $F.FormatViewDefinition[0].control
61+
```
62+
```Output
63+
Headers : {System.Management.Automation.TableControlColumnHeader, System.Management.Automation.TableControlColumnHeader, System.Management.Automation.TableControlColumnHeader,
64+
System.Management.Automation.TableControlColumnHeader}
65+
Rows : {System.Management.Automation.TableControlRow}
66+
AutoSize : False
67+
HideTableHeaders : False
68+
GroupBy :
69+
OutOfBand : False
70+
```
71+
```powershell
72+
PS C:\> $F.FormatViewDefinition[0].control.Headers
73+
```
74+
```Output
75+
Label Alignment Width
76+
----- --------- -----
77+
CommandType Undefined 15
78+
Name Undefined 50
79+
Version Undefined 10
80+
Source Undefined 0
6481
```
6582

6683
This example shows how to get a formatting data object and examine its properties.
6784

6885
### Example 4: Get formatting data and export it
69-
```
86+
```powershell
7087
PS C:\> $A = Get-FormatData
7188
PS C:\> Import-Module bitstransfer
7289
PS C:\> $B = Get-FormatData
7390
PS C:\> Compare-Object $A $B
91+
```
92+
```Output
7493
InputObject SideIndicator
7594
----------- -------------
7695
Microsoft.BackgroundIntelligentTransfer.Management.BitsJob => PS C:\> Get-FormatData *bits* | Export-FormatData -FilePath c:\test\bits.format.ps1xml
96+
```
97+
```powershell
7798
PS C:\> Get-Content c:\test\bits.format.ps1xml
99+
```
100+
```Output
78101
<?xml version="1.0" encoding="utf-8"?><Configuration><ViewDefinitions>
79102
<View><Name>Microsoft.BackgroundIntelligentTransfer.Management.BitsJob</Name>
80103
...
@@ -89,6 +112,54 @@ It uses a pipeline operator (|) to send the format type object to the Export-For
89112

90113
The final command shows an excerpt of the format.ps1xml file content.
91114

115+
### Example 5: Get formatting data based on the specified version of PowerShell
116+
```powershell
117+
PS C:\> Get-FormatData -TypeName 'Microsoft.Powershell.Utility.FileHash' -PowerShellVersion 1.0
118+
119+
TypeNames FormatViewDefinition
120+
--------- --------------------
121+
{Microsoft.Powershell.Utility.FileHash} {Microsoft.Powershell.Utility.FileHash}
122+
123+
PS C:\> Get-FormatData -TypeName 'Microsoft.Powershell.Utility.FileHash' -PowerShellVersion 2.0
124+
125+
TypeNames FormatViewDefinition
126+
--------- --------------------
127+
{Microsoft.Powershell.Utility.FileHash} {Microsoft.Powershell.Utility.FileHash}
128+
129+
PS C:\> Get-FormatData -TypeName 'Microsoft.Powershell.Utility.FileHash' -PowerShellVersion 3.0
130+
131+
TypeNames FormatViewDefinition
132+
--------- --------------------
133+
{Microsoft.Powershell.Utility.FileHash} {Microsoft.Powershell.Utility.FileHash}
134+
135+
PS C:\> Get-FormatData -TypeName 'Microsoft.Powershell.Utility.FileHash' -PowerShellVersion 4.0
136+
137+
TypeNames FormatViewDefinition
138+
--------- --------------------
139+
{Microsoft.Powershell.Utility.FileHash} {Microsoft.Powershell.Utility.FileHash}
140+
141+
PS C:\> Get-FormatData -TypeName 'Microsoft.Powershell.Utility.FileHash' -PowerShellVersion 5.0
142+
143+
TypeNames FormatViewDefinition
144+
--------- --------------------
145+
{Microsoft.Powershell.Utility.FileHash} {Microsoft.Powershell.Utility.FileHash}
146+
147+
PS C:\> Get-FormatData -TypeName 'Microsoft.Powershell.Utility.FileHash' -PowerShellVersion 5.1
148+
149+
TypeNames FormatViewDefinition
150+
--------- --------------------
151+
{Microsoft.Powershell.Utility.FileHash} {Microsoft.Powershell.Utility.FileHash}
152+
153+
PS C:\> Get-FormatData -TypeName 'Microsoft.Powershell.Utility.FileHash' -PowerShellVersion 6.0
154+
155+
TypeNames FormatViewDefinition
156+
--------- --------------------
157+
{Microsoft.Powershell.Utility.FileHash} {Microsoft.Powershell.Utility.FileHash}
158+
```
159+
160+
This example shows how to use **Get-FormatData** to get format data for a specified TypeName and a
161+
specified PowerShell version.
162+
92163
## PARAMETERS
93164

94165
### -InformationAction
@@ -136,7 +207,8 @@ Accept wildcard characters: False
136207
```
137208
138209
### -PowerShellVersion
139-
210+
Specify the version of PowerShell this cmdlet gets for the formatting data.
211+
Enter a two digit number seperated by a period.
140212
141213
```yaml
142214
Type: Version

0 commit comments

Comments
 (0)