From aeb76759f58c866a26cc2c9a813c8982428a6a75 Mon Sep 17 00:00:00 2001 From: Kevin Marquette Date: Tue, 6 Mar 2018 10:51:20 -0800 Subject: [PATCH 01/21] resolves 5817 (#2148) add Path alias to DestinationPath for Save-Help add Path alias to SourcePath for Update-Help add Path alias to BinaryPathName for New-Service add Path alias to FilePath for Start-Process, Set-TraceSource, Tee-Object, Trace-Command, Invoke-WSManAction, New-WSManInstance, and Set-WSManInstance --- reference/6/Microsoft.PowerShell.Core/Save-Help.md | 2 +- reference/6/Microsoft.PowerShell.Core/Update-Help.md | 2 +- reference/6/Microsoft.PowerShell.Management/New-Service.md | 2 +- reference/6/Microsoft.PowerShell.Management/Start-Process.md | 2 +- reference/6/Microsoft.PowerShell.Utility/Set-TraceSource.md | 2 +- reference/6/Microsoft.PowerShell.Utility/Tee-Object.md | 2 +- reference/6/Microsoft.PowerShell.Utility/Trace-Command.md | 2 +- reference/6/Microsoft.WSMan.Management/Invoke-WSManAction.md | 2 +- reference/6/Microsoft.WSMan.Management/New-WSManInstance.md | 2 +- reference/6/Microsoft.WSMan.Management/Set-WSManInstance.md | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/reference/6/Microsoft.PowerShell.Core/Save-Help.md b/reference/6/Microsoft.PowerShell.Core/Save-Help.md index 23d64e4c2fca..d0c340013a41 100644 --- a/reference/6/Microsoft.PowerShell.Core/Save-Help.md +++ b/reference/6/Microsoft.PowerShell.Core/Save-Help.md @@ -189,7 +189,7 @@ Do not specify a file name or file name extension. ```yaml Type: String[] Parameter Sets: Path -Aliases: +Aliases: Path Required: True Position: 0 diff --git a/reference/6/Microsoft.PowerShell.Core/Update-Help.md b/reference/6/Microsoft.PowerShell.Core/Update-Help.md index a55b9dbd6582..e145d1e835db 100644 --- a/reference/6/Microsoft.PowerShell.Core/Update-Help.md +++ b/reference/6/Microsoft.PowerShell.Core/Update-Help.md @@ -374,7 +374,7 @@ For more information, see about_Group_Policy_Settings (http://go.microsoft.com/f ```yaml Type: String[] Parameter Sets: Path -Aliases: +Aliases: Path Required: False Position: 1 diff --git a/reference/6/Microsoft.PowerShell.Management/New-Service.md b/reference/6/Microsoft.PowerShell.Management/New-Service.md index b79a88eb9758..6a73c625db14 100644 --- a/reference/6/Microsoft.PowerShell.Management/New-Service.md +++ b/reference/6/Microsoft.PowerShell.Management/New-Service.md @@ -67,7 +67,7 @@ This parameter is required. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Path Required: True Position: 2 diff --git a/reference/6/Microsoft.PowerShell.Management/Start-Process.md b/reference/6/Microsoft.PowerShell.Management/Start-Process.md index 7809b49dd9f5..8dc492a5c0df 100644 --- a/reference/6/Microsoft.PowerShell.Management/Start-Process.md +++ b/reference/6/Microsoft.PowerShell.Management/Start-Process.md @@ -167,7 +167,7 @@ If you specify only a file name, use the *WorkingDirectory* parameter to specify ```yaml Type: String Parameter Sets: (All) -Aliases: PSPath +Aliases: PSPath, Path Required: True Position: 1 diff --git a/reference/6/Microsoft.PowerShell.Utility/Set-TraceSource.md b/reference/6/Microsoft.PowerShell.Utility/Set-TraceSource.md index 169e4c6531dd..4e0902f310fd 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Set-TraceSource.md +++ b/reference/6/Microsoft.PowerShell.Utility/Set-TraceSource.md @@ -81,7 +81,7 @@ If you use this parameter to start the trace, use the *RemoveFileListener* param ```yaml Type: String Parameter Sets: optionsSet -Aliases: PSPath +Aliases: PSPath, Path Required: False Position: Named diff --git a/reference/6/Microsoft.PowerShell.Utility/Tee-Object.md b/reference/6/Microsoft.PowerShell.Utility/Tee-Object.md index 0fd469983c2f..110d49d6e495 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Tee-Object.md +++ b/reference/6/Microsoft.PowerShell.Utility/Tee-Object.md @@ -106,7 +106,7 @@ Specifies a file that this cmdlet saves the object to Wildcard characters are pe ```yaml Type: String Parameter Sets: File -Aliases: +Aliases: Path Required: True Position: 0 diff --git a/reference/6/Microsoft.PowerShell.Utility/Trace-Command.md b/reference/6/Microsoft.PowerShell.Utility/Trace-Command.md index f4db42f35e2a..5586ddeeb53a 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Trace-Command.md +++ b/reference/6/Microsoft.PowerShell.Utility/Trace-Command.md @@ -139,7 +139,7 @@ This parameter also selects the file trace listener. ```yaml Type: String Parameter Sets: (All) -Aliases: PSPath +Aliases: PSPath, Path Required: False Position: Named diff --git a/reference/6/Microsoft.WSMan.Management/Invoke-WSManAction.md b/reference/6/Microsoft.WSMan.Management/Invoke-WSManAction.md index bba50b72f507..d846248262c9 100644 --- a/reference/6/Microsoft.WSMan.Management/Invoke-WSManAction.md +++ b/reference/6/Microsoft.WSMan.Management/Invoke-WSManAction.md @@ -279,7 +279,7 @@ The file, Input.xml, contains the following content: ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Path Required: False Position: Named diff --git a/reference/6/Microsoft.WSMan.Management/New-WSManInstance.md b/reference/6/Microsoft.WSMan.Management/New-WSManInstance.md index debd0a10c9aa..52999d40a944 100644 --- a/reference/6/Microsoft.WSMan.Management/New-WSManInstance.md +++ b/reference/6/Microsoft.WSMan.Management/New-WSManInstance.md @@ -201,7 +201,7 @@ You specify the management resource by using the *ResourceURI* parameter and the ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Path Required: False Position: Named diff --git a/reference/6/Microsoft.WSMan.Management/Set-WSManInstance.md b/reference/6/Microsoft.WSMan.Management/Set-WSManInstance.md index a1ff98cd448e..33c715dba69f 100644 --- a/reference/6/Microsoft.WSMan.Management/Set-WSManInstance.md +++ b/reference/6/Microsoft.WSMan.Management/Set-WSManInstance.md @@ -282,7 +282,7 @@ You specify the management resource by using the *ResourceURI* parameter and the ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Path Required: False Position: Named From d743469bc0e67ff20a0ddd1232482fc3abfa3433 Mon Sep 17 00:00:00 2001 From: Alma Jenks Date: Tue, 20 Mar 2018 07:26:02 -0700 Subject: [PATCH 02/21] Bringing even with staging (#2191) * Merging latest changes to Live (#2144) * 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 6e76191c4546d97c8621054c8394715083ab4626. * 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
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 https://github.com/PowerShell/PowerShell-Docs/issues/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) * Change 'PowerShellProperties.json' to 'powershell.config.json' in about_logging (#2050) * OPS Build config changes and minor article edits (#2051) * clean up warnings from build log * clean up moniker mapping and add image types to config * removing unneeded index pages * fixing typos * Update New-PSSessionOption.md (#2052) Missing "are" between "they" and "effective". * Update Add-Member.md example layouts (#2055) * Update Add-Member.md fixed layout of examples 1,2 ,3 * fixed format of example 5 * Removes unnecessary description about the RunAsAdministrator parameter (#2057) There is no need to have documentation for functions which do not exists in the product. There is no need to specify in which version this feature was added. Otherwise we need to add such remarks to many other features as well * Fix Example 2 in Set-PSReadlineKeyHandler.md (#2058) * Fix Example 1 in Remove-PSReadlineKeyHandler.md (#2059) * Fix minor Markdown syntax error (#2060) "Backwards compatibility with Windows PowerShell" anchor reference had incorrect Markdown syntax. * Update secureMOF.md (#2061) Update "On the Target Node: create and export the certificate" section * remove eric and jp from metadata * update docs to reflect change by https://github.com/PowerShell/PowerShell/pull/5923y (#2064) * Fix release links/names (6.0.0) (#2056) Corrected links and names to match the 6.0.0 release * Removes unexistent RunAsAdministrator parameter from the Syntax section (#2066) * Fixed path inconsistencies in Set-ItemProperty Example 2 (#2072) * Corrected path error in Example 2 * Corrected path error in Example 2 * Corrected error in Example 2 * Updated About documentation links to relative paths (#2071) * Gallery ui manifest (#2073) * Changed required PSGet version to 1.6.0 * New doc explaining how manifests affect Gallery UI * Adding new topic to TOC * Escapes angle brackets in about_Requires (#2075) This change makes content in this brackets displayable * add links for topics * About_Windows_PowerShell_5.1 #1171 * fix typo * about_Type_Operators issues #1915 * fix typos * add note about reboot (#2076) * Removed empty bullet point below notes. (#2078) A minor typo. * change PowerShellProperties.json to powershell.config.json (#2079) * Update metaConfig.md (#2081) * Update metaConfig.md * Update metaConfig.md * Fix typo in code example (#2082) * Fix example VB code (#2084) * Fix example VB code This VB code writen in a line is not compilable. `VBFromFilePublic` also requires a space. * Fix example 4 VB code for all versions * Remove the mentioning of version 2.0 * Adds missing SslProtocol parameter from Invoke-WebRequest cmdlet. (#2085) * Add SslProtocol parameter. * Add libcurl note to Certificate parameter. * Import-Csv Update examples, and UseCulture (#2086) * address example formatting Also includes some update to wording that I'll expand on in PR. * Start on update formatting for 3.0 doc * More formatting * Correcting examples and format of them. * 3.0 update format example 1 * 3.0 update to example 2 * 3.0 update example 4 * 4.0 update example 1-4 * 5.0 update example 3 and 4 * 5.1 update example 4 paragraph format * 3.0 update example 5 * 4.0 update example 5 * 5.0 update example 5 * 5.1 update example 5 * 5.1 update example 6 * 5.0 update example 6 * 4.0 update example 6 * 3.0 update example 6 * 3.0 update format of param Delimiter and Encoding * 4.0 update format of param Delimiter and Encoding * 5.0 update format of param Encoding * 5.1 update format of param Encoding * 5.0 update param header * 4.0 update param header info * 3.0 update param header info * 5.1 update remaining parameter format * 5.0 update remaining parameter format * 4.0 update remaining parameter format * 3.0 update remaining parameter format * 3.0 update remaining parameter format * 5.1 update notes format and add related link * 5.0 update notes format and add related link * 4.0 update notes format and add related link * 3.0 update notes format and add related link * update to example 1 across 3.0 to 5.1 * 6.0 Updates to description and example 1 * 4.0 update to example 1 * 3.0 - 5.1 update case of file name * 6.0 update example 2 and 3 * 3.0 - 5.1 update case of file name * 6.0 working on updating example 4 This example does not give same results I have on 6.0.1. Think other examples are going to be bad as well, have to go back and test those. * update example 4 * update example 5 * 6.0 example 6 and parameter format * addtional touchups on format * Use a working URL in Clipboard examples (#2087) * Fixed bad link in about_Hash_Tables.md docs (#2090) Links to about_Object_Creation.md were malformed in all references versions. * restoring changes made in PR#1870 (#2089) * Remove repeat description (#2093) * remove duplicate sentences (#2094) * add escape \ for the delimiter (#2095) * Fix typos in Invoke-WebRequest.md. (#2099) * Small typo in Get-PfxCertificate.md fixed (#2101) * Modify incorrect link (#2102) There is no MacOS part in linux.md, now * Update pull server documentation (#2097) * improve clarity on pull service * remove line at top of page * add community references * remove extra lines * fixed line break in bolded text This should remove the build warning. * fix toc title (#2105) * Merging changes to TOC into Staging (#2107) * refactoring TOC (#2096) * refactoring TOC * fix typo in TOC * adding redirects for deleted files (#2106) * refactoring TOC * fix typo in TOC * adding redir for deleted files * fix broken links * Fix about_Switch.md. (#2109) * fix about_Switch.md. * Fix formatting. * Fix Windows-PowerShell-Glossary.md. (#2110) * Add info on POWERSHELL_TELEMETRY_OPTOUT environment variable. (#2111) * Add details of where to look (#2112) Add details of where to look for version information. * Update Stop-Process.md (#2113) Clean up unordered list formatting. * Add ValidateDrive and ValidateUserDrive attributes information. (#2114) * Update Installing-Windows-PowerShell.md (#2118) PowerShell 6.0 has already been released. * Update Add-Member.md (#2121) Fixed Layout of Example 3 * fixing example 4 per Issue #2122 * Update Write-Debug.md (#2120) * Added new line to powershell output Added new line to clarify that the new line is a command vs output of previous command `$DebugPreference` * Added newline break to clarify between PowerShell output and command * fix typo (#2124) fix typo of invoke-command session parameter * Typo in Windows-PowerShell-Integrated-Scripting-Environment--ISE-.md (#2127) Remove duplicated 'the'. * Fixing issue 1585 - removing Information* parameters * added missing H3 for -Name param * Fixing issue 1434 * Fix issue 1434 * Minor typo fix in Format-List.md (#2129) Checked "Accept wildcard characters" from "False" to "True" for "-Property". Example 4 clearly shows that this parameter accepts wildcards. * Added missing bullet (#2133) * Fixed empty bullet (#2132) * fix broken yaml blocks in content * Adds foreach & where method added in PowerShell v4 (#2139) Adding details about foreach & where methods being added in PowerShell v4 and that they aren't available downlevel (for historical purposes) and also points to using the Pipeline methods with the resulting Foreach-Object & Where-Object cmdlets * Missing y in Active Directory (#2137) For copy and paste reasons (also it would now make a bit more sense) * #5816 add message and msg alias to Write-Information and Write-Host (#2141) * update links to published content * removed "Windows" per zach * Test-Connection Default Count value is 4 not None (#2171) * Fix inconsistency in Test-Connection Count default Currently the text description clearly describes the default functionality: four pings are sent. The documentation for the Count's Default value stated that None was default which was false. * Fix Test-Connection inconsistency for 5.0 Default value is 4, not None * Fix Test-Connection inconsistency for 6.0 Default value is 4, not None * Incorrect Whitespace (#2170) - Incorrect whitespace * Clarify the docs regarding libcurl for installation on openSUSE (#2169) - Explicitly mention the conflict error and the solution. - Make the command that looks for libcurl more precise, since the goal is to find the specific package that places the lib in the place where the RHEL PS package looks for it. Ref: https://github.com/PowerShell/PowerShell/issues/6184 * Update modulewithpseditionsupport.md (#2167) typos corrected * Adding DSC Extension history (#2175) * Adding DSC Extension history * Link and JSON cleanup * Update docfx.json (#2176) * Fixing breadcrumb configs and converting TOC to YAML (#2177) * converted TOC to Yaml * converting all TOC to yaml and fixing breadcrumb warning * fixed breadcrumb for ref content * fixing broken links * Fix automation link and lint cleanup (#2180) * Fix automation link and lint cleanup * Fixed semantic lines * Fixing links and various changes (#2181) * Fixing links and various changes * Requested changes and minor fixes * Really fix the link this time * Added notes on OnRemove event (#2174) * Added notes on OnRemove event * Update Remove-Module.md * Update Remove-Module.md * Update Remove-Module.md * Update Remove-Module.md * Close fenced code block (#2184) Add "```" at the end to close the last fenced code block. * Update azureDscexthistory.md (#2182) Remove duplicated Version 2.19 section. Fix typos. * Returning 2.19 to Latest Versions in History (#2185) * Update authoringResourceMofDesigner.md (#2188) * Fixed "about_Updatable_Help" link (#2186) --- README.md | 39 +- dsc/TOC.md | 205 --------- dsc/TOC.yml | 221 ++++++++++ dsc/authoringResourceMofDesigner.md | 4 +- dsc/azureDsc.md | 31 +- dsc/azureDscexthistory.md | 251 +++++++++++ dsc/docfx.json | 2 +- gallery/TOC.md | 67 --- gallery/TOC.yml | 128 ++++++ gallery/docfx.json | 2 +- gallery/psget/get_psget_module.md | 3 +- .../module/modulewithpseditionsupport.md | 4 +- jea/TOC.MD | 11 - jea/TOC.yml | 18 + jea/docfx.json | 2 +- .../Test-Connection.md | 2 +- .../Test-Connection.md | 2 +- .../Remove-Module.md | 17 + .../Test-Connection.md | 2 +- .../Install-PackageProvider.md | 2 +- reference/docfx.json | 2 +- ...owerShell-Tab-in-Windows-PowerShell-ISE.md | 7 +- ...Debug-Scripts-in-Windows-PowerShell-ISE.md | 9 +- ...-Use-Profiles-in-Windows-PowerShell-ISE.md | 16 +- ...ion-in-the-Script-Pane-and-Console-Pane.md | 8 +- ...sole-Pane-in-the-Windows-PowerShell-ISE.md | 4 +- ...n-Scripts-in-the-Windows-PowerShell-ISE.md | 3 +- .../ise/The-ISE-Object-Model-Hierarchy.md | 23 +- .../ise/The-ISEAddOnTool-Object.md | 46 +- .../ise/The-ISEAddOnToolCollection-Object.md | 68 +-- .../ise/The-ISEEditor-Object.md | 166 +++---- .../core-powershell/ise/The-ISEFile-Object.md | 122 +++--- .../ise/The-ISEFileCollection-Object.md | 50 +-- .../ise/The-ISEMenuItem-Object.md | 64 +-- .../ise/The-ISEMenuItemCollection-Object.md | 45 +- .../ise/The-ISEOptions-Object.md | 412 ++++++++++-------- .../ise/The-ISESnippetCollection-Object.md | 26 +- .../ise/The-ISESnippetObject.md | 13 +- .../ise/The-ObjectModelRoot-Object.md | 20 +- .../ise/The-PowerShellTab-Object.md | 184 ++++---- .../ise/The-PowerShellTabCollection-Object.md | 58 +-- ...Getting-Ready-to-Use-Windows-PowerShell.md | 2 +- .../Other-Useful-Scripting-Objects.md | 43 +- .../Exploring-the-Windows-PowerShell-ISE.md | 18 +- ...Accessibility-in-Windows-PowerShell-ISE.md | 12 +- ...ling-PowerShell-Core-on-macOS-and-Linux.md | 19 +- .../What-s-New-in-the-PowerShell-50-ISE.md | 2 +- wmf/TOC.md | 97 ----- wmf/TOC.yml | 209 +++++++++ wmf/docfx.json | 2 +- 50 files changed, 1656 insertions(+), 1107 deletions(-) delete mode 100644 dsc/TOC.md create mode 100644 dsc/TOC.yml create mode 100644 dsc/azureDscexthistory.md delete mode 100644 gallery/TOC.md create mode 100644 gallery/TOC.yml delete mode 100644 jea/TOC.MD create mode 100644 jea/TOC.yml delete mode 100644 wmf/TOC.md create mode 100644 wmf/TOC.yml diff --git a/README.md b/README.md index 55be2ece7f1d..53351b22bf78 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,43 @@ -## Microsoft Open Source Code of Conduct +# Microsoft Open Source Code of Conduct This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. [![Build status](https://ci.appveyor.com/api/projects/status/onshefxnc4g4pv87/branch/staging?svg=true)](https://ci.appveyor.com/project/PowerShell/powershell-docs/branch/staging) -# PowerShell Documentation +## PowerShell Documentation -Welcome to the PowerShell-Docs repository, housing the official Windows PowerShell documentation. +Welcome to the PowerShell-Docs repository, housing the official PowerShell documentation. ## Repository Structure -Each folder in this repo publishes to [MSDN](https://msdn.microsoft.com/en-us/powershell). The folders correspond to the following PowerShell assets: -* [/dsc/](https://msdn.microsoft.com/en-us/powershell/dsc/) is for the Desired State Configuration feature -* [/gallery/](https://msdn.microsoft.com/powershell/gallery) is for the [PowerShell Gallery](https://www.powershellgallery.com/) -* [/jea/](https://msdn.microsoft.com/powershell/jea/) is for the Just Enough Administration feature -* [/reference/](https://msdn.microsoft.com/powershell/reference/) is for PowerShell module reference across versions 3.0, 4.0, 5.0, 5.1, and 6.0 - * This content will be retrieved by the `Get-Help` cmdlet in the future -* [/scripting/](https://msdn.microsoft.com/en-us/powershell/scripting/) is general PowerShell reference content -* [/wmf](https://msdn.microsoft.com/en-us/powershell/wmf/readme) contains release notes for the Windows Management Framework, the package used to distribute new versions of PowerShell to previous versions of Windows. + +Each folder in this repo publishes to [Microsoft Docs](https://docs.microsoft.com/powershell). The folders +correspond to the following PowerShell assets: + +- [/dsc/](https://docs.microsoft.com/powershell/dsc/) is for the Desired State Configuration feature +- [/gallery/](https://docs.microsoft.com/powershell/gallery) is for the [PowerShell Gallery](https://www.powershellgallery.com/) +- [/jea/](https://docs.microsoft.com/powershell/jea/) is for the Just Enough Administration feature +- [/reference/](https://docs.microsoft.com/powershell/scripting/) is for PowerShell conceptual topics + and module reference across versions 3.0, 4.0, 5.0, 5.1, and 6.0 + - This content will be retrieved by the `Get-Help` cmdlet in the future +- [/wmf](https://docs.microsoft.com/powershell/wmf/readme) contains release notes for the Windows + Management Framework, the package used to distribute new versions of PowerShell to previous versions of Windows. ## Contributing -We actively merge contributions into this repository via [pull request](https://help.github.com/articles/using-pull-requests/) into the *staging* branch. -Please note that before you submit a pull request you must [sign a Contribution License Agreement](https://cla.microsoft.com/) to ensure that the community is free to use your submissions. +We actively merge contributions into this repository via [pull request](https://help.github.com/articles/using-pull-requests/) +into the *staging* branch. +Please note that before you submit a pull request you must [sign a Contribution License Agreement](https://cla.microsoft.com/) +to ensure that the community is free to use your submissions. + For more information on contributing, read our [contributions guide](CONTRIBUTING.md). There is a draft [style guide](./STYLE.md) to review before making contributions. -Please use the Issue and Pull Request templates to help keep documentation consistent across versions. +Please use the Issue and Pull Request templates to help keep documentation consistent across versions. ## Licenses -There are two license files for this project. +There are two license files for this project. The MIT License applies to the code contained in this repo. -The Creative Commons license applies to the documentation. +The Creative Commons license applies to the documentation. diff --git a/dsc/TOC.md b/dsc/TOC.md deleted file mode 100644 index abd927c7a952..000000000000 --- a/dsc/TOC.md +++ /dev/null @@ -1,205 +0,0 @@ -# [Overview](overview.md) - -## [Desired State Configuration Overview for Decision Makers](decisionMaker.md) - -## [Desired State Configuration Overview for Engineers](DscForEngineers.md) - -## [DSC quick start](quickStart.md) - -# [Configurations](configurations.md) - -## [Enacting configurations](enactingConfigurations.md) - -## [Separating configuration and environment data](separatingEnvData.md) - -## [Using resources with multiple versions](sxsResource.md) - -## [Running DSC with user credentials](runAsUser.md) - -## [Specifying cross-node dependencies](crossNodeDependencies.md) - -## [Configuration data](configData.md) - -### [Credential options in configuration data](configDataCredentials.md) - -## [Nesting configurations](compositeConfigs.md) - -## [Securing the configuration MOF file](secureMOF.md) - -## [Partial Configurations](partialConfigs.md) - -## [Writing help for DSC configurations](configHelp.md) - -## [Configure a virtual machine at initial boot-up by using DSC](bootstrapDsc.md) - -### [DSCAutomationHostEnabled registry key](DSCAutomationHostEnabled.md) - -# [Resources](resources.md) - -## [Built-in resources](builtInResource.md) - -### [Archive Resource](archiveResource.md) - -### [Environment Resource](environmentResource.md) - -### [File Resource](fileResource.md) - -### [Group Resource](groupResource.md) - -### [GroupSet Resource](groupSetResource.md) - -### [Log Resource](logResource.md) - -### [Package Resource](packageResource.md) - -### [ProcessSet Resource](processSetResource.md) - -### [Registry Resource](registryResource.md) - -### [Script Resource](scriptResource.md) - -### [Service Resource](serviceResource.md) - -### [ServiceSet Resource](serviceSetResource.md) - -### [User Resource](userResource.md) - -### [WaitForAllResource](waitForAllResource.md) - -### [WaitForAnyResource](waitForAnyResource.md) - -### [WaitForSomeResource](waitForSomeResource.md) - -### [WindowsFeature Resource](windowsfeatureResource.md) - -### [WindowsFeatureSet Resource](windowsFeatureSetResource.md) - -### [WindowsOptionalFeature Resource](windowsOptionalFeatureResource.md) - -### [WindowsOptionalFeatureSet Resource](windowsOptionalFeatureSetResource.md) - -### [WindowsPackageCab Resource](windowsPackageCabResource.md) - -### [WindowsProcess Resource](windowsProcessResource.md) - -## [Authoring custom resources](authoringResource.md) - -### [MOF-based custom resources](authoringResourceMOF.md) - -#### [MOF-based resource in C#](authoringResourceMofCS.md) - -### [Class-based custom resouces](authoringResourceClass.md) - -### [Composite resources](authoringResourceComposite.md) - -### [Writing a single-instance DSC resource (best practice)](singleInstance.md) - -### [Resource authoring checklist](resourceAuthoringChecklist.md) - -## [Debugging DSC resources](debugResource.md) - -## [Calling DSC resource methods directly](directCallResource.md) - -# Local Configuration Manager - -## [Configuring the Local Configuration Manager (LCM)](metaConfig.md) - -## [Configuring the LCM in PowerShell 4.0](metaConfig4.md) - -# The DSC pull model - -## [DSC Pull Service](pullServer.md) - -## [Setting up a DSC SMB pull server](pullServerSMB.md) - -## [Setting up a pull client](pullClient.md) - -### [Setting up a pull client using configuration names](pullClientConfigNames.md) - -### [Setting up a pull client using configuration ID](pullClientConfigID.md) - -## [Using a DSC report server](reportServer.md) - -## [Pull server best practices](secureServer.md) - -# [DSC examples](dscExamples.md) - -## [Building a CI/CD pipeline with DSC, Pester, and Visual Studio Team Services](dscCiCd.md) - -## [Separating configuration and environment data](separatingEnvData.md) - -# [Troubleshooting DSC](troubleshooting.md) - -# [Using DSC on Nano Server](nanoDsc.md) - -# DSC on Linux - -## [Getting started with DSC for Linux](lnxGettingStarted.md) - -## [Built-in resources for Linux](lnxBuiltInResources.md) - -### [nxArchive Resource](lnxArchiveResource.md) - -### [nxEnvironment Resource](lnxEnvironmentResource.md) - -### [nxFile Resource](lnxFileResource.md) - -### [nxFileLine Resource](lnxFileLineResource.md) - -### [nxGroup Resource](lnxGroupResource.md) - -### [nxPackage Resource](lnxPackageResource.md) - -### [nxService Resource](lnxServiceResource.md) - -### [nxSshAuthorizedKeys Resource](lnxSshAuthorizedKeysResource.md) - -### [nxUser Resource](lnxUserResource.md) - -# [Using DSC on Microsoft Azure](azureDsc.md) - -# DSC MOF Reference - -## [MSFT_DSCLocalConfigurationManager class](msft-dsclocalconfigurationmanager.md) - -### [ApplyConfiguration method of the MSFT_DSCLocalConfigurationManager class](msft-dsclocalconfigurationmanager-applyconfiguration.md) - -### [DisableDebugConfiguration method of the MSFT_DSCLocalConfigurationManager class](msft-dsclocalconfigurationmanager-disabledebugconfiguration.md) - -### [EnableDebugConfiguration method of the MSFT_DSCLocalConfigurationManager class](msft-dsclocalconfigurationmanager-enabledebugconfiguration.md) - -### [GetConfiguration method of the MSFT_DSCLocalConfigurationManager class](msft-dsclocalconfigurationmanager-getconfiguration.md) - -### [GetConfigurationResultOutput method of the MSFT_DSCLocalConfigurationManager class](msft-dsclocalconfigurationmanager-getconfigurationresultoutput.md) - -### [GetConfigurationStatus method of the MSFT_DSCLocalConfigurationManager class](msft-dsclocalconfigurationmanager-getconfigurationstatus.md) - -### [GetMetaConfiguration method of the MSFT_DSCLocalConfigurationManager class](msft-dsclocalconfigurationmanager-getmetaconfiguration.md) - -### [PerformRequiredConfigurationChecks method of the MSFT_DSCLocalConfigurationManager class](msft-dsclocalconfigurationmanager-performrequiredconfigurationchecks.md) - -### [RemoveConfiguration method of the MSFT_DSCLocalConfigurationManager class](msft-dsclocalconfigurationmanager-removeconfiguration.md) - -### [ResourceGet method of the MSFT_DSCLocalConfigurationManager class](msft-dsclocalconfigurationmanager-resourceget.md) - -### [ResourceSet method of the MSFT_DSCLocalConfigurationManager class](msft-dsclocalconfigurationmanager-resourceset.md) - -### [ResourceTest method of the MSFT_DSCLocalConfigurationManager class](msft-dsclocalconfigurationmanager-resourcetest.md) - -### [RollBack method of the MSFT_DSCLocalConfigurationManager class](msft-dsclocalconfigurationmanager-rollback.md) - -### [SendConfiguration method of the MSFT_DSCLocalConfigurationManager class](msft-dsclocalconfigurationmanager-sendconfiguration.md) - -### [SendConfigurationApply method of the MSFT_DSCLocalConfigurationManager class](msft-dsclocalconfigurationmanager-sendconfigurationapply.md) - -### [SendConfigurationApplyAsync method of the MSFT_DSCLocalConfigurationManager class](msft-dsclocalconfigurationmanager-sendconfigurationapplyasync.md) - -### [SendMetaConfigurationApply method of the MSFT_DSCLocalConfigurationManager class](msft-dsclocalconfigurationmanager-sendmetaconfigurationapply.md) - -### [StopConfiguration method of the MSFT_DSCLocalConfigurationManager class](msft-dsclocalconfigurationmanager-stopconfiguration.md) - -### [TestConfiguration method of the MSFT_DSCLocalConfigurationManager class](msft-dsclocalconfigurationmanager-testconfiguration.md) - -# More Resources - -## [Whitepapers](whitepapers.md) diff --git a/dsc/TOC.yml b/dsc/TOC.yml new file mode 100644 index 000000000000..63bf81b6710b --- /dev/null +++ b/dsc/TOC.yml @@ -0,0 +1,221 @@ +- name: Overview + href: overview.md + items: + - name: Desired State Configuration Overview for Decision Makers + href: decisionMaker.md + - name: Desired State Configuration Overview for Engineers + href: DscForEngineers.md + - name: DSC quick start + href: quickStart.md +- name: Configurations + href: configurations.md + items: + - name: Enacting configurations + href: enactingConfigurations.md + - name: Separating configuration and environment data + href: separatingEnvData.md + - name: Using resources with multiple versions + href: sxsResource.md + - name: Running DSC with user credentials + href: runAsUser.md + - name: Specifying cross-node dependencies + href: crossNodeDependencies.md + - name: Configuration data + href: configData.md + items: + - name: Credential options in configuration data + href: configDataCredentials.md + - name: Nesting configurations + href: compositeConfigs.md + - name: Securing the configuration MOF file + href: secureMOF.md + - name: Partial Configurations + href: partialConfigs.md + - name: Writing help for DSC configurations + href: configHelp.md + - name: Configure a virtual machine at initial boot-up by using DSC + href: bootstrapDsc.md + items: + - name: DSCAutomationHostEnabled registry key + href: DSCAutomationHostEnabled.md +- name: Resources + href: resources.md + items: + - name: Built-in resources + href: builtInResource.md + items: + - name: Archive Resource + href: archiveResource.md + - name: Environment Resource + href: environmentResource.md + - name: File Resource + href: fileResource.md + - name: Group Resource + href: groupResource.md + - name: GroupSet Resource + href: groupSetResource.md + - name: Log Resource + href: logResource.md + - name: Package Resource + href: packageResource.md + - name: ProcessSet Resource + href: processSetResource.md + - name: Registry Resource + href: registryResource.md + - name: Script Resource + href: scriptResource.md + - name: Service Resource + href: serviceResource.md + - name: ServiceSet Resource + href: serviceSetResource.md + - name: User Resource + href: userResource.md + - name: WaitForAllResource + href: waitForAllResource.md + - name: WaitForAnyResource + href: waitForAnyResource.md + - name: WaitForSomeResource + href: waitForSomeResource.md + - name: WindowsFeature Resource + href: windowsfeatureResource.md + - name: WindowsFeatureSet Resource + href: windowsFeatureSetResource.md + - name: WindowsOptionalFeature Resource + href: windowsOptionalFeatureResource.md + - name: WindowsOptionalFeatureSet Resource + href: windowsOptionalFeatureSetResource.md + - name: WindowsPackageCab Resource + href: windowsPackageCabResource.md + - name: WindowsProcess Resource + href: windowsProcessResource.md + - name: Authoring custom resources + href: authoringResource.md + items: + - name: MOF-based custom resources + href: authoringResourceMOF.md + items: + - name: MOF-based resource in C# + href: authoringResourceMofCS.md + - name: Class-based custom resouces + href: authoringResourceClass.md + - name: Composite resources + href: authoringResourceComposite.md + - name: Writing a single-instance DSC resource (best practice) + href: singleInstance.md + - name: Resource authoring checklist + href: resourceAuthoringChecklist.md + - name: Debugging DSC resources + href: debugResource.md + - name: Calling DSC resource methods directly + href: directCallResource.md +- name: Local Configuration Manager + items: + - name: Configuring the Local Configuration Manager (LCM) + href: metaConfig.md + - name: Configuring the LCM in PowerShell 4.0 + href: metaConfig4.md +- name: The DSC pull model + items: + - name: DSC Pull Service + href: pullServer.md + - name: Setting up a DSC SMB pull server + href: pullServerSMB.md + - name: Setting up a pull client + href: pullClient.md + items: + - name: Setting up a pull client using configuration names + href: pullClientConfigNames.md + - name: Setting up a pull client using configuration ID + href: pullClientConfigID.md + - name: Using a DSC report server + href: reportServer.md + - name: Pull server best practices + href: secureServer.md +- name: DSC examples + href: dscExamples.md + items: + - name: Building a CI/CD pipeline with DSC, Pester, and Visual Studio Team Services + href: dscCiCd.md + - name: Separating configuration and environment data + href: separatingEnvData.md +- name: Troubleshooting DSC + href: troubleshooting.md +- name: Using DSC on Nano Server + href: nanoDsc.md +- name: DSC on Linux + items: + - name: Getting started with DSC for Linux + href: lnxGettingStarted.md + - name: Built-in resources for Linux + href: lnxBuiltInResources.md + items: + - name: nxArchive Resource + href: lnxArchiveResource.md + - name: nxEnvironment Resource + href: lnxEnvironmentResource.md + - name: nxFile Resource + href: lnxFileResource.md + - name: nxFileLine Resource + href: lnxFileLineResource.md + - name: nxGroup Resource + href: lnxGroupResource.md + - name: nxPackage Resource + href: lnxPackageResource.md + - name: nxService Resource + href: lnxServiceResource.md + - name: nxSshAuthorizedKeys Resource + href: lnxSshAuthorizedKeysResource.md + - name: nxUser Resource + href: lnxUserResource.md +- name: Using DSC on Microsoft Azure + href: azureDsc.md + items: + - name: DSC Extension History + href: azureDscexthistory.md +- name: DSC MOF Reference + items: + - name: MSFT_DSCLocalConfigurationManager class + href: msft-dsclocalconfigurationmanager.md + items: + - name: ApplyConfiguration method of the MSFT_DSCLocalConfigurationManager class + href: msft-dsclocalconfigurationmanager-applyconfiguration.md + - name: DisableDebugConfiguration method of the MSFT_DSCLocalConfigurationManager class + href: msft-dsclocalconfigurationmanager-disabledebugconfiguration.md + - name: EnableDebugConfiguration method of the MSFT_DSCLocalConfigurationManager class + href: msft-dsclocalconfigurationmanager-enabledebugconfiguration.md + - name: GetConfiguration method of the MSFT_DSCLocalConfigurationManager class + href: msft-dsclocalconfigurationmanager-getconfiguration.md + - name: GetConfigurationResultOutput method of the MSFT_DSCLocalConfigurationManager class + href: msft-dsclocalconfigurationmanager-getconfigurationresultoutput.md + - name: GetConfigurationStatus method of the MSFT_DSCLocalConfigurationManager class + href: msft-dsclocalconfigurationmanager-getconfigurationstatus.md + - name: GetMetaConfiguration method of the MSFT_DSCLocalConfigurationManager class + href: msft-dsclocalconfigurationmanager-getmetaconfiguration.md + - name: PerformRequiredConfigurationChecks method of the MSFT_DSCLocalConfigurationManager class + href: msft-dsclocalconfigurationmanager-performrequiredconfigurationchecks.md + - name: RemoveConfiguration method of the MSFT_DSCLocalConfigurationManager class + href: msft-dsclocalconfigurationmanager-removeconfiguration.md + - name: ResourceGet method of the MSFT_DSCLocalConfigurationManager class + href: msft-dsclocalconfigurationmanager-resourceget.md + - name: ResourceSet method of the MSFT_DSCLocalConfigurationManager class + href: msft-dsclocalconfigurationmanager-resourceset.md + - name: ResourceTest method of the MSFT_DSCLocalConfigurationManager class + href: msft-dsclocalconfigurationmanager-resourcetest.md + - name: RollBack method of the MSFT_DSCLocalConfigurationManager class + href: msft-dsclocalconfigurationmanager-rollback.md + - name: SendConfiguration method of the MSFT_DSCLocalConfigurationManager class + href: msft-dsclocalconfigurationmanager-sendconfiguration.md + - name: SendConfigurationApply method of the MSFT_DSCLocalConfigurationManager class + href: msft-dsclocalconfigurationmanager-sendconfigurationapply.md + - name: SendConfigurationApplyAsync method of the MSFT_DSCLocalConfigurationManager class + href: msft-dsclocalconfigurationmanager-sendconfigurationapplyasync.md + - name: SendMetaConfigurationApply method of the MSFT_DSCLocalConfigurationManager class + href: msft-dsclocalconfigurationmanager-sendmetaconfigurationapply.md + - name: StopConfiguration method of the MSFT_DSCLocalConfigurationManager class + href: msft-dsclocalconfigurationmanager-stopconfiguration.md + - name: TestConfiguration method of the MSFT_DSCLocalConfigurationManager class + href: msft-dsclocalconfigurationmanager-testconfiguration.md +- name: More Resources + items: + - name: Whitepapers + href: whitepapers.md diff --git a/dsc/authoringResourceMofDesigner.md b/dsc/authoringResourceMofDesigner.md index 964c0de9d655..80eb796113fa 100644 --- a/dsc/authoringResourceMofDesigner.md +++ b/dsc/authoringResourceMofDesigner.md @@ -29,7 +29,7 @@ To create the properties, we use the **New-xDscResourceProperty** cmdlet. The fo ```powershell $UserName = New-xDscResourceProperty –Name UserName -Type String -Attribute Key $Ensure = New-xDscResourceProperty –Name Ensure -Type String -Attribute Write –ValidateSet “Present”, “Absent” -$DomainCredential = New-xDscResourceProperty –Name DomainCredential-Type PSCredential -Attribute Write +$DomainCredential = New-xDscResourceProperty –Name DomainCredential -Type PSCredential -Attribute Write $Password = New-xDscResourceProperty –Name Password -Type PSCredential -Attribute Write ``` @@ -177,4 +177,4 @@ The Resource Designer tool exposes one more cmdlet that can be used to test the [Build Custom Windows PowerShell Desired State Configuration Resources](authoringResource.md) #### Other Resources -[xDscResourceDesigner Module](https://powershellgallery.com/packages/xDscResourceDesigner) \ No newline at end of file +[xDscResourceDesigner Module](https://powershellgallery.com/packages/xDscResourceDesigner) diff --git a/dsc/azureDsc.md b/dsc/azureDsc.md index 28e88a4e9ee7..b53d714ac090 100644 --- a/dsc/azureDsc.md +++ b/dsc/azureDsc.md @@ -1,30 +1,31 @@ --- -ms.date: 2017-06-12 +ms.date: 2018-03-15 ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Using DSC on Microsoft Azure --- - # Using DSC on Microsoft Azure -Desired State Configuration (DSC) is supported in Microsoft Azure through the -[Azure Desired State Configuration extension handler](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-extensions-dsc-overview) and through -[Azure Automation DSC](https://docs.microsoft.com/azure/automation/automation-dsc-overview). +Desired State Configuration (DSC) is supported in Microsoft Azure through the +[Azure Desired State Configuration extension handler](/azure/virtual-machines/virtual-machines-windows-extensions-dsc-overview) +and through [Azure Automation DSC](/azure/automation/automation-dsc-overview). ## Azure Desired State Configuration extension handler -The Azure DSC extension allows VMs hosted in Microsoft Azure to be managed with DSC. For more information, see the following topics: +The Azure DSC extension allows VMs hosted in Microsoft Azure to be managed with DSC. +For more information, see the following topics: -- [Azure Desired State Configuration extension handler](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-extensions-dsc-overview) -- [Windows VMSS and Desired State Configuration with Azure Resource Manager templates](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-extensions-dsc-template) -- [Passing credentials to the Azure DSC extension handler](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-extensions-dsc-credentials) +- [Azure Desired State Configuration extension handler](/azure/virtual-machines/virtual-machines-windows-extensions-dsc-overview) +- [Windows VMSS and Desired State Configuration with Azure Resource Manager templates](/azure/virtual-machines/virtual-machines-windows-extensions-dsc-template) +- [Passing credentials to the Azure DSC extension handler](/azure/virtual-machines/virtual-machines-windows-extensions-dsc-credentials) +- [Azure Desired State Configuration extension history](azureDscexthistory.md) ## Azure Automation DSC -The [Azure Automation service](https://azure.microsoft.com/services/automation/) allows you to manage DSC configurations, resources, and managed nodes from within Azure. For -more information, see the following topics: - -- [Azure Automation DSC](https://docs.microsoft.com/azure/automation/automation-dsc-overview) -- [Getting started with Azure Automation DSC](https://docs.microsoft.com/azure/automation/automation-dsc-getting-started) -- [Onboarding machines for management by Azure Automation DSC](https://docs.microsoft.com/azure/automation/automation-dsc-onboarding) +The [Azure Automation service](https://azure.microsoft.com/services/automation/) allows you to +manage DSC configurations, resources, and managed nodes from within Azure. For more information, +see the following topics: +- [Azure Automation DSC](/azure/automation/automation-dsc-overview) +- [Getting started with Azure Automation DSC](/azure/automation/automation-dsc-getting-started) +- [Onboarding machines for management by Azure Automation DSC](/azure/automation/automation-dsc-onboarding) \ No newline at end of file diff --git a/dsc/azureDscexthistory.md b/dsc/azureDscexthistory.md new file mode 100644 index 000000000000..78cfeb5ad1d5 --- /dev/null +++ b/dsc/azureDscexthistory.md @@ -0,0 +1,251 @@ +--- +description: Learn about the version history for the Desired State Configuration (DSC) extension in Azure. +ms.date: 2018-03-14 +ms.topic: conceptual +keywords: dsc, powershell, azure, extension +title: Azure DSC Extension Version History +author: DCtheGeek +ms.author: dacoulte +--- +# Azure Desired State Configuration extension version history + +The Azure Desired State Configuration (DSC) VM Extension is updated as-needed to support enhancements and new capabilities delivered by Azure, Windows Server, and the Windows Management Framework (WMF) that includes Windows PowerShell. + +This article will provide information about each version of the Azure DSC VM Extension, what environments it supports, and comments and remarks on new features or changes. + +## Latest Versions + +### Version 2.75 + +- **Release date:** + - March 5, 2018 +- **OS support:** + - Windows Server 2016 + - Windows Server 2012 R2 + - Windows Server 2012 + - Windows Server 2008 R2 SP1 + - Windows Client 7/8.1/10 + - Nano Server +- **WMF support:** + - WMF 5.1 + - WMF 5.0 RTM + - WMF 4.0 Update + - WMF 4.0 +- **Environment:** + - Azure +- **Remarks:** This version uses DSC as included in Windows Server 2016; for other Windows OSes, it installs the [Windows Management Framework 5.1](https://blogs.msdn.microsoft.com/powershell/2016/12/06/wmf-5-1-releasing-january-2017/) (installing WMF requires a reboot). For Nano Server, DSC role is installed on the VM. +- **New features:** + - After GitHub's recent move to TLS 1.2, you can't onboard a VM to Azure Automation DSC using DIY Resource Manager templates available on Azure Marketplace or use DSC extension to get any config hosted on GitHub. You will see an error similar to the following while deploying the extension: + + ```json + { + "code": "DeploymentFailed", + "message": "At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-debug for usage details.", + "details": [{ + "code": "Conflict", + "message": "{ + \"status\": \"Failed\", + \"error\": { + \"code\": \"ResourceDeploymentFailure\", + \"message\": \"The resource operation completed with terminal provisioning state 'Failed'.\", + \"details\": [ { + \"code\": \"VMExtensionProvisioningError\", + \"message\": \"VM has reported a failure when processing extension 'Microsoft.Powershell.DSC'. + Error message: \\\"The DSC Extension failed to execute: Error downloading + https://github.com/Azure/azure-quickstart-templates/raw/master/dsc-extension-azure-automation-pullserver/UpdateLCMforAAPull.zip + after 29 attempts: The request was aborted: Could not create SSL/TLS secure channel..\\nMore information about the failure can + be found in the logs located under 'C:\\\\WindowsAzure\\\\Logs\\\\Plugins\\\\Microsoft.Powershell.DSC\\\\2.74.0.0' on the VM.\\\".\" + } ] + } + }" + }] + } + ``` + + - In the new extension version, TLS 1.2 is now enforced. While deploying the extension if you already had the AutoUpgradeMinorVersion = true in the Resource Manager template, then the extension will get autoupgraded to 2.75. For manual updates, specify `TypeHandlerVersion = 2.75` in your Resource Manager template. + +### Version 2.19 + +- **Release date:** + - June 3, 2016 +- **OS support:** + - Windows Server 2016 Technical Preview + - Windows Server 2012 R2 + - Windows Server 2012 + - Windows Server 2008 R2 SP1 +- **WMF support:** + - WMF 5.0 RTM + - WMF 4.0 Update + - WMF 4.0 +- **Environment:** + - Azure + - Azure China + - Azure Government +- **Remarks:** This version uses DSC as included in Windows Server 2016 Technical Preview; for other OSes, it installs the [Windows Management Framework 5.0 RTM](https://blogs.msdn.microsoft.com/powershell/2015/12/16/windows-management-framework-wmf-5-0-rtm-is-now-available/) (installing WMF requires a reboot). +- **New features:** + - The DSC Extension is now on boarded to Azure China. This version primarily contains fixes for running the Extension on Azure China. + +## Supported Versions + +> [!WARNING] +> Versions 2.4 through 2.13 use WMF 5.0 Public Preview whose signing certificates expired in August 2016. For more information about this issue, see [blog post](https://blogs.msdn.microsoft.com/powershell/2016/05/24/azure-dsc-extension-versions-2-4-up-to-2-13-will-retire-in-august/). + +### Version 2.70 - 2.72 + +- **Release date:** November 13, 2017 +- **OS support:** Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 R2 SP1, Windows Client 7/8.1/10, Nano Server +- **WMF support:** WMF 5.1, WMF 5.0 RTM, WMF 4.0 Update, WMF 4.0 +- **Environment:** Azure +- **Remarks:** This version uses DSC as included in Windows Server 2016; for other Windows OSes, it installs the [Windows Management Framework 5.1](https://blogs.msdn.microsoft.com/powershell/2016/12/06/wmf-5-1-releasing-january-2017/) (installing WMF requires a reboot). For Nano Server, DSC role is installed on the VM. +- **New features:** + - Bug fixes & improvements that simplifies using DSC Azure Automation through the portal UI as well as Resource Manager template. For more information, see [Default Configuration Script](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/extensions-dsc-overview#default-configuration-script) in the DSC Extension documentation. + +### Version 2.26 + +- **Release date:** June 9, 2017 +- **OS support:** Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 R2 SP1, Windows Client 7/8.1/10, Nano Server +- **WMF support:** WMF 5.1, WMF 5.0 RTM, WMF 4.0 Update, WMF 4.0 +- **Environment:** Azure +- **Remarks:** This version uses DSC as included in Windows Server 2016; for other Windows OSes, it installs the [Windows Management Framework 5.1](https://blogs.msdn.microsoft.com/powershell/2016/12/06/wmf-5-1-releasing-january-2017/) (installing WMF requires a reboot). For Nano Server, DSC role is installed on the VM. +- **New features:** + - Telemetry improvements. + +### Version 2.25 + +- **Release date:** June 2, 2017 +- **OS support:** Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 R2 SP1, Windows Client 7/8.1/10, Nano Server +- **WMF support:** WMF 5.1, WMF 5.0 RTM, WMF 4.0 Update, WMF 4.0 +- **Environment:** Azure +- **Remarks:** This version uses DSC as included in Windows Server 2016; for other Windows OSes, it installs the [Windows Management Framework 5.1](https://blogs.msdn.microsoft.com/powershell/2016/12/06/wmf-5-1-releasing-january-2017/) (installing WMF requires a reboot). For Nano Server, DSC role is installed on the VM. +- **New features:** + - Several bug fixes and other minor improvements were added. + +### Version 2.24 + +- **Release date:** April 13, 2017 +- **OS support:** Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 R2 SP1, Nano Server +- **WMF support:** WMF 5.1, WMF 5.0 RTM, WMF 4.0 Update, WMF 4.0 +- **Environment:** Azure +- **Remarks:** This version uses DSC as included in Windows Server 2016; for other Windows OSes, it installs the [Windows Management Framework 5.1](https://blogs.msdn.microsoft.com/powershell/2016/12/06/wmf-5-1-releasing-january-2017/) (installing WMF requires a reboot). For Nano Server, DSC role is installed on the VM. +- **New features:** + - Exposes VM UUID & DSC Agent ID as extension metadata. Other minor improvements were added. + +### Version 2.23 + +- **Release date:** March 15, 2017 +- **OS support:** Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 R2 SP1, Nano Server +- **WMF support:** WMF 5.1, WMF 5.0 RTM, WMF 4.0 Update, WMF 4.0 +- **Environment:** Azure +- **Remarks:** This version uses DSC as included in Windows Server 2016; for other Windows OSes, it installs the [Windows Management Framework 5.1](https://blogs.msdn.microsoft.com/powershell/2016/12/06/wmf-5-1-releasing-january-2017/) (installing WMF requires a reboot). For Nano Server, DSC role is installed on the VM. +- **New features:** + - Lots of bug fixes and other improvements were added. + +### Version 2.22 + +- **Release date:** February 8, 2017 +- **OS support:** Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 R2 SP1, Nano Server +- **WMF support:** WMF 5.1, WMF 5.0 RTM, WMF 4.0 Update, WMF 4.0 +- **Environment:** Azure +- **Remarks:** This version uses DSC as included in Windows Server 2016; for other Windows OSes, it installs the [Windows Management Framework 5.1](https://blogs.msdn.microsoft.com/powershell/2016/12/06/wmf-5-1-releasing-january-2017/) (installing WMF requires a reboot). For Nano Server, DSC role is installed on the VM. +- **New features:** + - The DSC Extension now has support for WMF 5.1. + - Minor other improvements were added. + +### Version 2.21 + +- **Release date:** December 2, 2016 +- **OS support:** Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 R2 SP1, Nano Server +- **WMF support:** WMF 5.1 Preview, WMF 5.0 RTM, WMF 4.0 Update, WMF 4.0 +- **Environment:** Azure +- **Remarks:** This version uses DSC as included in Windows Server 2016; for other Windows OSes, it installs the [Windows Management Framework 5.0 RTM](https://blogs.msdn.microsoft.com/powershell/2015/12/16/windows-management-framework-wmf-5-0-rtm-is-now-available/) (installing WMF requires a reboot). For Nano Server, DSC role is installed on the VM. +- **New features:** + - The DSC Extension is now available on Nano Server. This version primarily contains code changes for running the Extension on Nano Server. + - Minor other improvements were added. + +### Version 2.20 + +- **Release date:** August 2, 2016 +- **OS support:** Windows Server 2016 Technical Preview, Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 R2 SP1 +- **WMF support:** WMF 5.1 Preview, WMF 5.0 RTM, WMF 4.0 Update, WMF 4.0 +- **Environment:** Azure +- **Remarks:** This version uses DSC as included in Windows Server 2016 Technical Preview; for other Windows OSes, it installs the [Windows Management Framework 5.0 RTM](https://blogs.msdn.microsoft.com/powershell/2015/12/16/windows-management-framework-wmf-5-0-rtm-is-now-available/) (installing WMF requires a reboot). +- **New features:** + - Support for WMF 5.1 Preview. When first published, this version was an optional upgrade and you had to specify Wmfversion = ‘5.1PP’ in Resource Manager templates to install WMF 5.1 preview. Wmfversion = ‘latest’ still installs the [WMF 5.0 RTM](https://blogs.msdn.microsoft.com/powershell/2015/12/16/windows-management-framework-wmf-5-0-rtm-is-now-available/). For more information on WMF 5.1 preview, see [this blog]( https://blogs.msdn.microsoft.com/powershell/2016/07/16/announcing-windows-management-framework-wmf-5-1-preview/). + - Minor other fixes and improvements were added. + +### Version 2.19 + +- **Release date:** June 3, 2016 +- **OS support:** Windows Server 2016 Technical Preview, Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 R2 SP1 +- **WMF support:** WMF 5.0 RTM, WMF 4.0 Update, WMF 4.0 +- **Environment:** Azure, Azure China, Azure Government +- **Remarks:** This version uses DSC as included in Windows Server 2016 Technical Preview; for other Windows OSes, it installs the [Windows Management Framework 5.0 RTM](https://blogs.msdn.microsoft.com/powershell/2015/12/16/windows-management-framework-wmf-5-0-rtm-is-now-available/) (installing WMF requires a reboot). +- **New features:** + - The DSC Extension is now onboarded to Azure China. This version primarily contains fixes for running the Extension on Azure China. + +### Version 2.18 + +- **Release date:** June 3, 2016 +- **OS support:** Windows Server 2016 Technical Preview, Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 R2 SP1 +- **WMF support:** WMF 5.0 RTM, WMF 4.0 Update, WMF 4.0 +- **Environment:** Azure +- **Remarks:** This version uses DSC as included in Windows Server 2016 Technical Preview; for other Windows OSes, it installs the [Windows Management Framework 5.0 RTM](https://blogs.msdn.microsoft.com/powershell/2015/12/16/windows-management-framework-wmf-5-0-rtm-is-now-available/) (installing WMF requires a reboot). +- **New features:** + - Make telemetry non-blocking when an error occurs during telemetry hotfix download (known Azure DNS issue) or during install. + - Fix for the intermittent issue where extension stops processing configuration after a reboot. This was causing the DSC Extension to remain in ‘transitioning’ state. + - Minor other fixes and improvements were added. + +### Version 2.17 + +- **Release date:** April 26, 2016 +- **OS support:** Windows Server 2016 Technical Preview, Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 R2 SP1 +- **WMF support:** WMF 5.0 RTM, WMF 4.0 Update, WMF 4.0 +- **Environment:** Azure +- **Remarks:** This version uses DSC as included in Windows Server 2016 Technical Preview; for other Windows OSes, it installs the [Windows Management Framework 5.0 RTM](https://blogs.msdn.microsoft.com/powershell/2015/12/16/windows-management-framework-wmf-5-0-rtm-is-now-available/) (installing WMF requires a reboot). +- **New features:** + - Support for WMF 4.0 Update. For more information on WMF 4.0 Update, see [this blog](https://blogs.msdn.microsoft.com/powershell/2016/01/19/windows-management-framework-wmf-4-0-update-now-available-for-windows-server-2012-windows-server-2008-r2-sp1-and-windows-7-sp1/). + - Retry logic on errors that occur during the DSC Extension install or while applying a DSC configuration post extension install. As a part of this change, the extension will retry the installation if a previous install failed or re-enact a DSC configuration that had previously failed, for a maximum three times until it reaches the completion state (Success/Error) or if a new request comes. If the extension fails due to invalid user settings/user input, it does not retry. In this case, the extension needs to be invoked again with a new request and correct user settings. Note: The DSC Extension is dependent on the Azure VM agent for the retries. Azure VM agent invokes the extension with the last failed request until it reaches a success or error state. + +### Version 2.16 + +- **Release date:** April 21, 2016 +- **OS support:** Windows Server 2016 Technical Preview, Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 R2 SP1 +- **WMF support:** WMF 5.0 RTM, WMF 4.0 +- **Environment:** Azure +- **Remarks:** This version uses DSC as included in Windows Server 2016 Technical Preview; for other Windows OSes, it installs the [Windows Management Framework 5.0 RTM](https://blogs.msdn.microsoft.com/powershell/2015/12/16/windows-management-framework-wmf-5-0-rtm-is-now-available/) (installing WMF requires a reboot). +- **New features:** + - Improvement in error handling and other minor bug fixes. + - New property in DSC Extension settings. ‘ForcePullAndApply’ in AdvancedOptions is added to enable the DSC Extension enact DSC configurations when the refresh mode is Pull (as opposed to the default Push mode). For more information, please refer to [this blog](https://blogs.msdn.microsoft.com/powershell/2016/02/26/arm-dsc-extension-settings/) to get more information on the DSC Extension settings. + +### Version 2.15 + +- **Release date:** March 14, 2016 +- **OS support:** Windows Server 2016 Technical Preview, Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 R2 SP1 +- **WMF support:** WMF 5.0 RTM, WMF 4.0 +- **Environment:** Azure +- **Remarks:** This version uses DSC as included in Windows Server 2016 Technical Preview; for other Windows OSes, it installs the [Windows Management Framework 5.0 RTM](https://blogs.msdn.microsoft.com/powershell/2015/12/16/windows-management-framework-wmf-5-0-rtm-is-now-available/) (installing WMF requires a reboot). +- **New features:** + - In extension version 2.14, changes to install WMF RTM were included. While upgrading from extension version 2.13.2.0 to 2.14.0.0, you may notice that some DSC cmdlets fail or your configuration fails with an error – ‘No Instance found with given property values’. For more information, see the [DSC release notes](https://msdn.microsoft.com/en-us/powershell/wmf/limitation_dsc). The workarounds for these issues have been added in 2.15 version. + - Unfortunately, if you have already installed version 2.14 and are running into one of the above two issues, you will need to perform these steps manually. In an elevated PowerShell session: + - `Remove-Item -Path $env:SystemRoot\system32\Configuration\DSCEngineCache.mof` + - `mofcomp $env:windir\system32\wbem\DscCoreConfProv.mof` + +### Version 2.14 + +- **Release date:** February 25, 2016 +- **OS support:** Windows Server 2016 Technical Preview, Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 R2 SP1 +- **WMF support:** WMF 5.0 RTM, WMF 4.0 +- **Environment:** Azure +- **Remarks:** This version uses DSC as included in Windows Server 2016 Technical Preview; for other Windows OSes, it installs the [Windows Management Framework 5.0 RTM](https://blogs.msdn.microsoft.com/powershell/2015/12/16/windows-management-framework-wmf-5-0-rtm-is-now-available/) (installing WMF requires a reboot). +- **New features:** + - Uses WMF RTM. + - Enables data collection in order to improve the quality of the DSC Extension. For more information, see [the blog](https://blogs.msdn.microsoft.com/powershell/2016/02/02/azure-dsc-extension-data-collection-2/). + - Provides an updated settings format for the extension in a Resource Manager template. For more information, see [the blog](https://blogs.msdn.microsoft.com/powershell/2016/02/26/arm-dsc-extension-settings/). + - Bug fixes and other enhancements. + +## Next steps + +- For more information about PowerShell DSC, go to the [PowerShell documentation center](overview.md). +- Examine the [Resource Manager template for the DSC extension](/azure/virtual-machines/windows/extensions-dsc-template). +- For more functionality that you can manage by using PowerShell DSC, and for more DSC resources, browse the [PowerShell gallery](https://www.powershellgallery.com/packages?q=DscResource&x=0&y=0). +- For details about passing sensitive parameters into configurations, see [Manage credentials securely with the DSC extension handler](/azure/virtual-machines/windows/extensions-dsc-credentials). \ No newline at end of file diff --git a/dsc/docfx.json b/dsc/docfx.json index 8d4d435b0573..df4d40711b9b 100644 --- a/dsc/docfx.json +++ b/dsc/docfx.json @@ -10,7 +10,7 @@ } ], "globalMetadata": { - "breadcrumb_path":"bread/toc.json", + "breadcrumb_path":"~/bread/toc.yml", "uhfHeaderId": "MSDocsHeader-Powershell", "layout": "conceptual", "ROBOTS": "INDEX, FOLLOW", diff --git a/gallery/TOC.md b/gallery/TOC.md deleted file mode 100644 index 57ec5223eb1c..000000000000 --- a/gallery/TOC.md +++ /dev/null @@ -1,67 +0,0 @@ -# [Overview](readme.md) -## Gallery -### [Getting started](psgallery/psgallery_gettingstarted.md) -### [Health Status](psgallery/psgallery_status.md) -### [Gallery FAQs](psgallery/psgallery_faqs.md) -### [Gallery Items tab](psgallery/psgallery_items_tab.md) -### [Gallery search syntax](psgallery/psgallery_search_syntax.md) -### [Items with Compatible PSEditions](psgallery/psgallery_pseditions.md) -### [FileList view](psgallery/psgallery_filelist_feature.md) -### [Deploy to Azure Automation](psgallery/psgallery_deploy_to_azure_automation.md) -### [Creating a PowerShellGallery Account](psgallery/psgallery_creating_an_account.md) -### [Creating and publishing items](psgallery/Creating-and-Publishing-an-item.md) -### [Publishing guidelines and best practices](psgallery/psgallery-PublishingGuidelines.md) -### [Item manifest and Gallery UI](psgallery/psgallery_ItemManifestAffectingUI.md) -### [Unlisting items](psgallery/psgallery_unlist_items.md) -### [Deleting items](psgallery/Deleting-Items.md) -### [Managing item owners](psgallery/Managing-Item-Owners.md) -### [Report Abuse](psgallery/psgallery_report_abuse.md) -### [Dispute resolution](psgallery/psgallery_dispute_resolution.md) -### [Contacting item owners](psgallery/psgallery_contacting_item_owners.md) -### [Contacting administrators](psgallery/psgallery_contacting_administrators.md) -### [Providing Feedback via Social Media or Comments](psgallery/psgallery-SocialMediaFeedback.md) -### [Require License Acceptance on Items details](psgallery/psgallery_requires_license_acceptance.md) -### [Require License Acceptance on Deploy to Azure Automation](psgallery/psgallery_deploy_to_azure_automation_requireLicenseAcceptance.md) - -# [PowerShellGet](psget/overview.md) -## [Get PowerShellGet Module](psget/get_psget_module.md) - -## Module -### [Find Modules](psget/module/psget_find-module.md) -### [Find DSC Resources](psget/module/psget_find-dscresource.md) -### [Find Role Capabilities](psget/module/psget_find-rolecapability.md) -### [Find Commands](psget/module/psget_find-command.md) -### [Save](psget/module/psget_save-module.md) -### [Install](psget/module/psget_install-module.md) -### [Update](psget/module/psget_update-module.md) -### [Uninstall](psget/module/psget_uninstall-module.md) -### [Get installed modules](psget/module/psget_get-installedmodule.md) -### [Update module manifest](psget/module/psget_update-modulemanifest.md) -### [Publish](psget/module/psget_publish-module.md) -### [Modules with PSEditions](psget/module/modulewithpseditionsupport.md) -### [Modules Requiring License Acceptance](psget/module/RequireLicenseAcceptance.md) -### [Prerelease Versions](psget/module/PreReleaseModule.md) -### [Troubleshooting](psget/psget_cmdlets_troubleshooting.md) - -## Script -### [Find](psget/script/psget_find-script.md) -### [Save](psget/script/psget_save-script.md) -### [Install](psget/script/psget_install-script.md) -### [Update](psget/script/psget_update-script.md) -### [Uninstall](psget/script/psget_uninstall-script.md) -### [Get installed scipts](psget/script/psget_get-installedscript.md) -### [Create script file with metadata](psget/script/psget_new-scriptfileinfo.md) -### [Test script file metadata](psget/script/psget_test-scriptfileinfo.md) -### [Update script file metadata](psget/script/psget_update-scriptfileinfo.md) -### [Publish](psget/script/psget_publish-script.md) -### [Scripts with PSEditions](psget/script/scriptwithpseditionsupport.md) -### [Require License Acceptance for Scripts](psget/script/script_RequireLicenseAcceptance.md) -### [Prerelease Versions](psget/script/PreReleaseScript.md) -## Repository management -### [Bootstrapping NuGet provider and NuGet.exe](psget/repository/bootstrapping_nuget_proivder_and_exe.md) -### [Registering repository](psget/repository/psget_register-psrepository.md) -### [Listing registered repository](psget/repository/psget_get-psrepository.md) -### [Modifying registered repository](psget/repository/psget_set-psrepository.md) -### [Unregistering repository](psget/repository/psget_unregister-psrepository.md) - -## [PackageManagement cmdlets](psget/oneget/PackageManagement_cmdlets.md) diff --git a/gallery/TOC.yml b/gallery/TOC.yml new file mode 100644 index 000000000000..cd9234e172e7 --- /dev/null +++ b/gallery/TOC.yml @@ -0,0 +1,128 @@ +- name: Overview + href: readme.md + items: + - name: Gallery + items: + - name: Getting started + href: psgallery/psgallery_gettingstarted.md + - name: Health Status + href: psgallery/psgallery_status.md + - name: Gallery FAQs + href: psgallery/psgallery_faqs.md + - name: Gallery Items tab + href: psgallery/psgallery_items_tab.md + - name: Gallery search syntax + href: psgallery/psgallery_search_syntax.md + - name: Items with Compatible PSEditions + href: psgallery/psgallery_pseditions.md + - name: FileList view + href: psgallery/psgallery_filelist_feature.md + - name: Deploy to Azure Automation + href: psgallery/psgallery_deploy_to_azure_automation.md + - name: Creating a PowerShellGallery Account + href: psgallery/psgallery_creating_an_account.md + - name: Creating and publishing items + href: psgallery/Creating-and-Publishing-an-item.md + - name: Publishing guidelines and best practices + href: psgallery/psgallery-PublishingGuidelines.md + - name: Item manifest and Gallery UI + href: psgallery/psgallery_ItemManifestAffectingUI.md + - name: Unlisting items + href: psgallery/psgallery_unlist_items.md + - name: Deleting items + href: psgallery/Deleting-Items.md + - name: Managing item owners + href: psgallery/Managing-Item-Owners.md + - name: Report Abuse + href: psgallery/psgallery_report_abuse.md + - name: Dispute resolution + href: psgallery/psgallery_dispute_resolution.md + - name: Contacting item owners + href: psgallery/psgallery_contacting_item_owners.md + - name: Contacting administrators + href: psgallery/psgallery_contacting_administrators.md + - name: Providing Feedback via Social Media or Comments + href: psgallery/psgallery-SocialMediaFeedback.md + - name: Require License Acceptance on Items details + href: psgallery/psgallery_requires_license_acceptance.md + - name: Require License Acceptance on Deploy to Azure Automation + href: psgallery/psgallery_deploy_to_azure_automation_requireLicenseAcceptance.md +- name: PowerShellGet + href: psget/overview.md + items: + - name: Get PowerShellGet Module + href: psget/get_psget_module.md + - name: Module + items: + - name: Find Modules + href: psget/module/psget_find-module.md + - name: Find DSC Resources + href: psget/module/psget_find-dscresource.md + - name: Find Role Capabilities + href: psget/module/psget_find-rolecapability.md + - name: Find Commands + href: psget/module/psget_find-command.md + - name: Save + href: psget/module/psget_save-module.md + - name: Install + href: psget/module/psget_install-module.md + - name: Update + href: psget/module/psget_update-module.md + - name: Uninstall + href: psget/module/psget_uninstall-module.md + - name: Get installed modules + href: psget/module/psget_get-installedmodule.md + - name: Update module manifest + href: psget/module/psget_update-modulemanifest.md + - name: Publish + href: psget/module/psget_publish-module.md + - name: Modules with PSEditions + href: psget/module/modulewithpseditionsupport.md + - name: Modules Requiring License Acceptance + href: psget/module/RequireLicenseAcceptance.md + - name: Prerelease Versions + href: psget/module/PreReleaseModule.md + - name: Troubleshooting + href: psget/psget_cmdlets_troubleshooting.md + - name: Script + items: + - name: Find + href: psget/script/psget_find-script.md + - name: Save + href: psget/script/psget_save-script.md + - name: Install + href: psget/script/psget_install-script.md + - name: Update + href: psget/script/psget_update-script.md + - name: Uninstall + href: psget/script/psget_uninstall-script.md + - name: Get installed scipts + href: psget/script/psget_get-installedscript.md + - name: Create script file with metadata + href: psget/script/psget_new-scriptfileinfo.md + - name: Test script file metadata + href: psget/script/psget_test-scriptfileinfo.md + - name: Update script file metadata + href: psget/script/psget_update-scriptfileinfo.md + - name: Publish + href: psget/script/psget_publish-script.md + - name: Scripts with PSEditions + href: psget/script/scriptwithpseditionsupport.md + - name: Require License Acceptance for Scripts + href: psget/script/script_RequireLicenseAcceptance.md + - name: Prerelease Versions + href: psget/script/PreReleaseScript.md + - name: Repository management + items: + - name: Bootstrapping NuGet provider and NuGet.exe + href: psget/repository/bootstrapping_nuget_proivder_and_exe.md + - name: Registering repository + href: psget/repository/psget_register-psrepository.md + - name: Listing registered repository + href: psget/repository/psget_get-psrepository.md + - name: Modifying registered repository + href: psget/repository/psget_set-psrepository.md + - name: Unregistering repository + href: psget/repository/psget_unregister-psrepository.md + - name: PackageManagement cmdlets + href: psget/oneget/PackageManagement_cmdlets.md diff --git a/gallery/docfx.json b/gallery/docfx.json index 7015d17719f4..af03c10b1955 100644 --- a/gallery/docfx.json +++ b/gallery/docfx.json @@ -10,7 +10,7 @@ } ], "globalMetadata": { - "breadcrumb_path": "/powershell/gallery/bread/toc.json", + "breadcrumb_path": "/powershell/gallery/bread/toc.yml", "ROBOTS": "INDEX, FOLLOW", "uhfHeaderId": "MSDocsHeader-Powershell", "ms.prod": "powershell", diff --git a/gallery/psget/get_psget_module.md b/gallery/psget/get_psget_module.md index c61229b1f836..7571a153cd53 100644 --- a/gallery/psget/get_psget_module.md +++ b/gallery/psget/get_psget_module.md @@ -54,4 +54,5 @@ Exit ```powershell Copy-Item "C:\LocalFolder\PowerShellGet\*" "$env:ProgramFiles\WindowsPowerShell\Modules\PowerShellGet\" -Recurse -Force -Copy-Item "C:\LocalFolder\PackageManagement\*" "$env:ProgramFiles\WindowsPowerShell\Modules\PackageManagement\" -Recurse -Force \ No newline at end of file +Copy-Item "C:\LocalFolder\PackageManagement\*" "$env:ProgramFiles\WindowsPowerShell\Modules\PackageManagement\" -Recurse -Force +``` diff --git a/gallery/psget/module/modulewithpseditionsupport.md b/gallery/psget/module/modulewithpseditionsupport.md index fe0473688050..66f785cdaca0 100644 --- a/gallery/psget/module/modulewithpseditionsupport.md +++ b/gallery/psget/module/modulewithpseditionsupport.md @@ -220,8 +220,8 @@ Mode LastWriteTime Length Name -a---- 7/5/2016 1:35 PM 0 MyCoreClrRM.dl ``` -## PowerShell Gallery users can find the list of modules supported on a specific PowerShell Edition using tags PSEdition_Desktop and PSEditon_Core. -Modules without PSEdition_Desktop and PSEditon_Core tags are considered to work fine on PowerShell Desktop editions. +## PowerShell Gallery users can find the list of modules supported on a specific PowerShell Edition using tags PSEdition_Desktop and PSEdition_Core. +Modules without PSEdition_Desktop and PSEdition_Core tags are considered to work fine on PowerShell Desktop editions. ```powershell diff --git a/jea/TOC.MD b/jea/TOC.MD deleted file mode 100644 index 2af6fcc53fec..000000000000 --- a/jea/TOC.MD +++ /dev/null @@ -1,11 +0,0 @@ - -# [Overview](overview.md) - -# Deploy JEA -## [Prerequisites](prerequisites.md) -## [Role Capabilities](role-capabilities.md) -## [Session Configurations](session-configurations.md) -## [Registering JEA](register-jea.md) -## [Using JEA](using-jea.md) -## [Security Considerations](security-considerations.md) -## [Audit and Report on JEA](audit-and-report.md) diff --git a/jea/TOC.yml b/jea/TOC.yml new file mode 100644 index 000000000000..58213d9786a5 --- /dev/null +++ b/jea/TOC.yml @@ -0,0 +1,18 @@ +- name: Overview + href: overview.md +- name: Deploy JEA + items: + - name: Prerequisites + href: prerequisites.md + - name: Role Capabilities + href: role-capabilities.md + - name: Session Configurations + href: session-configurations.md + - name: Registering JEA + href: register-jea.md + - name: Using JEA + href: using-jea.md + - name: Security Considerations + href: security-considerations.md + - name: Audit and Report on JEA + href: audit-and-report.md diff --git a/jea/docfx.json b/jea/docfx.json index 431b86b21360..653e62d53740 100644 --- a/jea/docfx.json +++ b/jea/docfx.json @@ -10,7 +10,7 @@ } ], "globalMetadata": { - "breadcrumb_path": "bread/toc.json", + "breadcrumb_path": "bread/toc.yml", "uhfHeaderId": "MSDocsHeader-Powershell", "ROBOTS": "INDEX, FOLLOW", "ms.prod": "powershell", diff --git a/reference/5.0/Microsoft.PowerShell.Management/Test-Connection.md b/reference/5.0/Microsoft.PowerShell.Management/Test-Connection.md index 07a5fc5c2513..fae7289283e2 100644 --- a/reference/5.0/Microsoft.PowerShell.Management/Test-Connection.md +++ b/reference/5.0/Microsoft.PowerShell.Management/Test-Connection.md @@ -238,7 +238,7 @@ Aliases: Required: False Position: Named -Default value: None +Default value: 4 Accept pipeline input: False Accept wildcard characters: False ``` diff --git a/reference/5.1/Microsoft.PowerShell.Management/Test-Connection.md b/reference/5.1/Microsoft.PowerShell.Management/Test-Connection.md index 1535a2d06f93..1b5bb763a4d2 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Test-Connection.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Test-Connection.md @@ -200,7 +200,7 @@ Aliases: Required: False Position: Named -Default value: None +Default value: 4 Accept pipeline input: False Accept wildcard characters: False ``` diff --git a/reference/6/Microsoft.PowerShell.Core/Remove-Module.md b/reference/6/Microsoft.PowerShell.Core/Remove-Module.md index 147020c472a1..eb42a5345d3d 100644 --- a/reference/6/Microsoft.PowerShell.Core/Remove-Module.md +++ b/reference/6/Microsoft.PowerShell.Core/Remove-Module.md @@ -205,6 +205,23 @@ You can pipe module names and module objects to **Remove-Module**. This cmdlet does not generate any output. ## NOTES +When removing a module, there is an event on the module that will execute. +This event allows a module to react to being removed and perform some cleanup such as freeing up resources. Example: + +$OnRemoveScript = { + + \# perform cleanup + + $cachedSessions | Remove-PSSession + +} + +$ExecutionContext.SessionState.Module.OnRemove += $OnRemoveScript + +For full consistency, it might be also useful to react to the closing of the PowerShell process: + +Register-EngineEvent -SourceIdentifier ([System.Management.Automation.PsEngineEvent]::Exiting) -Action $OnRemoveScript + ## RELATED LINKS diff --git a/reference/6/Microsoft.PowerShell.Management/Test-Connection.md b/reference/6/Microsoft.PowerShell.Management/Test-Connection.md index 24030991762f..8acd339e20a9 100644 --- a/reference/6/Microsoft.PowerShell.Management/Test-Connection.md +++ b/reference/6/Microsoft.PowerShell.Management/Test-Connection.md @@ -201,7 +201,7 @@ Aliases: Required: False Position: Named -Default value: None +Default value: 4 Accept pipeline input: False Accept wildcard characters: False ``` diff --git a/reference/6/PackageManagement/Install-PackageProvider.md b/reference/6/PackageManagement/Install-PackageProvider.md index cfbdf744c59e..f7cb0dae1ba2 100644 --- a/reference/6/PackageManagement/Install-PackageProvider.md +++ b/reference/6/PackageManagement/Install-PackageProvider.md @@ -33,7 +33,7 @@ Install-PackageProvider [-Scope ] [-InputObject] [- ## DESCRIPTION The **Install-PackageProvider** cmdlet installs matching Package Management providers that are available in package sources registered with **PowerShellGet**. By default, this includes modules available in the Windows PowerShell Gallery with the **PackageManagement**. -The ** PowerShellGet** Package Management provider is used for finding providers in these repositories. +The **PowerShellGet** Package Management provider is used for finding providers in these repositories. This cmdlet also installs matching Package Management providers that are available using the Package Management bootstrapping application. diff --git a/reference/docfx.json b/reference/docfx.json index ffb21c5245ab..5b366ceaf4b9 100644 --- a/reference/docfx.json +++ b/reference/docfx.json @@ -49,7 +49,7 @@ "overwrite": [], "externalReference": [], "globalMetadata": { - "breadcrumb_path": "/powershell/bread-pscore/toc.json", + "breadcrumb_path": "/powershell/bread-pscore/toc.yml", "uhfHeaderId": "MSDocsHeader-Powershell", "apiPlatform": "powershell", "ms.devlang": "powershell", diff --git a/reference/docs-conceptual/core-powershell/ise/How-to-Create-a-PowerShell-Tab-in-Windows-PowerShell-ISE.md b/reference/docs-conceptual/core-powershell/ise/How-to-Create-a-PowerShell-Tab-in-Windows-PowerShell-ISE.md index 78261e99aae0..e7351f88e256 100644 --- a/reference/docs-conceptual/core-powershell/ise/How-to-Create-a-PowerShell-Tab-in-Windows-PowerShell-ISE.md +++ b/reference/docs-conceptual/core-powershell/ise/How-to-Create-a-PowerShell-Tab-in-Windows-PowerShell-ISE.md @@ -4,8 +4,8 @@ keywords: powershell,cmdlet title: How to Create a PowerShell Tab in Windows PowerShell ISE ms.assetid: c10c18c7-9ece-4fd0-83dc-a19c53d4fd83 --- - # How to Create a PowerShell Tab in Windows PowerShell ISE + Tabs in the Windows PowerShell Integrated Scripting Environment (ISE) allow you to simultaneously create and use several execution environments within the same application. @@ -67,6 +67,5 @@ see [How to Save a Script](How-to-Write-and-Run-Scripts-in-the-Windows-PowerShel ## See Also -- [Using the Windows PowerShell ISE](Using-the-Windows-PowerShell-ISE.md) -- [How to Use the Console Pane in the Windows PowerShell ISE](How-to-Use-the-Console-Pane-in-the-Windows-PowerShell-ISE.md) - +- [Introducing the Windows PowerShell ISE](Introducing-the-Windows-PowerShell-ISE.md) +- [How to Use the Console Pane in the Windows PowerShell ISE](How-to-Use-the-Console-Pane-in-the-Windows-PowerShell-ISE.md) \ No newline at end of file diff --git a/reference/docs-conceptual/core-powershell/ise/How-to-Debug-Scripts-in-Windows-PowerShell-ISE.md b/reference/docs-conceptual/core-powershell/ise/How-to-Debug-Scripts-in-Windows-PowerShell-ISE.md index 015c55dd09bc..546b2414246b 100644 --- a/reference/docs-conceptual/core-powershell/ise/How-to-Debug-Scripts-in-Windows-PowerShell-ISE.md +++ b/reference/docs-conceptual/core-powershell/ise/How-to-Debug-Scripts-in-Windows-PowerShell-ISE.md @@ -38,7 +38,7 @@ Displays all breakpoints in the current Windows PowerShell session. On the **Debug** menu, click **List Breakpoints**. The following script is an example of how you can list all breakpoints from the Console Pane by using the [Get-PSBreakpoint](https://technet.microsoft.com/library/0bf48936-00ab-411c-b5e0-9b10a812a3c6) cmdlet. ``` PowerShell -# This command lists all breakpoints in the current session. +# This command lists all breakpoints in the current session. Get-PSBreakpoint ``` @@ -83,7 +83,7 @@ Disable-PSBreakpoint -Id 0 Disabling a breakpoint does not remove it; it turns it off until it is enabled. To disable all breakpoints in the current session, on the **Debug** menu, click **Disable all Breakpoints**. The following script is an example of how you can disable all breakpoints from the Console Pane by using the [Disable-PSBreakpoint](https://technet.microsoft.com/library/d4974e9b-0aaa-4e20-b87f-f599a413e4e8) cmdlet. ``` PowerShell -# This command disables all breakpoints in the current session. +# This command disables all breakpoints in the current session. # You can abbreviate this command as: "gbp | dbp". Get-PSBreakpoint | Disable-PSBreakpoint ``` @@ -100,7 +100,7 @@ Enable-PSBreakpoint -Id 0, 1, 5 To enable all breakpoints defined in the current session, on the **Debug** menu, click **Enable all Breakpoints**. The following script is an example of how you can enable all breakpoints from the Console Pane by using the [Enable-PSBreakpoint](https://technet.microsoft.com/library/739e1091-3b3f-405f-a428-bec7543e5df0) cmdlet. ``` PowerShell -# This command enables all breakpoints in the current session. +# This command enables all breakpoints in the current session. # You can abbreviate the command by using their aliases: "gbp | ebp". Get-PSBreakpoint | Enable-PSBreakpoint ``` @@ -175,5 +175,4 @@ C:\ps-test\MyScript.ps1 ``` ## See Also -- [Using the Windows PowerShell ISE](Using-the-Windows-PowerShell-ISE.md) - +- [Exploring the Windows PowerShell ISE](../../getting-started/fundamental/exploring-the-windows-powershell-ise.md) diff --git a/reference/docs-conceptual/core-powershell/ise/How-to-Use-Profiles-in-Windows-PowerShell-ISE.md b/reference/docs-conceptual/core-powershell/ise/How-to-Use-Profiles-in-Windows-PowerShell-ISE.md index 19df5bdd544e..12a3cb0a3cee 100644 --- a/reference/docs-conceptual/core-powershell/ise/How-to-Use-Profiles-in-Windows-PowerShell-ISE.md +++ b/reference/docs-conceptual/core-powershell/ise/How-to-Use-Profiles-in-Windows-PowerShell-ISE.md @@ -4,8 +4,8 @@ keywords: powershell,cmdlet title: How to Use Profiles in Windows PowerShell ISE ms.assetid: 0219626a-6da5-4acc-b630-d058e8b29cc6 --- - # How to Use Profiles in Windows PowerShell ISE + This topic explains how to use Profiles in Windows PowerShell® Integrated Scripting Environment (ISE). We recommend that before performing the tasks in this section, you review [about_Profiles [v4]](https://technet.microsoft.com/library/e1d9e30a-70cc-4f36-949f-fc7cd96b4054(v=wps.630)), or in the Console Pane, type, `Get-Help about_Profiles` and press **ENTER**. A profile is a Windows PowerShell ISE script that runs automatically when you start a new session. You can create one or more Windows PowerShell profiles for Windows PowerShell ISE and use them to add the configure the Windows PowerShell or Windows PowerShell ISE environment, preparing it for your use, with variables, aliases, functions, and color and font preferences that you want available. A profile affects every Windows PowerShell ISE session that you start. @@ -14,6 +14,7 @@ A profile is a Windows PowerShell ISE script that runs automatically when you st > The Windows PowerShell execution policy determines whether you can run scripts and load a profile. The default execution policy, “Restricted,” prevents all scripts from running, including profiles. If you use the “Restricted” policy, the profile cannot load. For more information about execution policy, see [about_Execution_Policies [v4]](https://technet.microsoft.com/library/347708dc-1515-4d74-978b-8334603472e6(v=wps.630)). ## Selecting a profile to use in the Windows PowerShell ISE + Windows PowerShell ISE supports profiles for the current user and all users. It also supports the Windows PowerShell profiles that apply to all hosts. The profile that you use is determined by how you use Windows PowerShell and Windows PowerShell ISE. @@ -32,31 +33,32 @@ The following are profiles that can be created and used in Windows PowerShell IS | **All users, All hosts** | `$PROFILE.AllUsersAllHosts` | ## To create a new profile + To create a new “Current user, Windows PowerShell ISE” profile, run this command: ```powershell -if (!(Test-Path -Path $PROFILE )) +if (!(Test-Path -Path $PROFILE )) { New-Item -Type File -Path $PROFILE -Force } ``` To create a new “All users, Windows PowerShell ISE” profile, run this command: ```powershell -if (!(Test-Path -Path $PROFILE.AllUsersCurrentHost)) +if (!(Test-Path -Path $PROFILE.AllUsersCurrentHost)) { New-Item -Type File -Path $PROFILE.AllUsersCurrentHost -Force } ``` To create a new “Current user, All Hosts” profile, run this command: ```powershell -if (!(Test-Path -Path $PROFILE.CurrentUserAllHosts)) +if (!(Test-Path -Path $PROFILE.CurrentUserAllHosts)) { New-Item -Type File -Path $PROFILE.CurrentUserAllHosts -Force } ``` To create a new “All users, All Hosts” profile, type: ```powershell -if (!(Test-Path -Path $PROFILE.AllUsersAllHosts)) +if (!(Test-Path -Path $PROFILE.AllUsersAllHosts)) { New-Item -Type File -Path $PROFILE.AllUsersAllHosts -Force } ``` @@ -73,6 +75,6 @@ if (!(Test-Path -Path $PROFILE.AllUsersAllHosts)) 3. To save your profile file, on the **File** menu, click **Save**. Next time you open the Windows PowerShell ISE, your customizations are applied. ## See Also -- [about_Profiles [v4]](https://technet.microsoft.com/library/e1d9e30a-70cc-4f36-949f-fc7cd96b4054(v=wps.630)) -- [Using the Windows PowerShell ISE](Using-the-Windows-PowerShell-ISE.md) +- [about_Profiles [v4]](https://technet.microsoft.com/library/e1d9e30a-70cc-4f36-949f-fc7cd96b4054(v=wps.630)) +- [Introducing the Windows PowerShell ISE](Introducing-the-Windows-PowerShell-ISE.md) \ No newline at end of file diff --git a/reference/docs-conceptual/core-powershell/ise/How-to-Use-Tab-Completion-in-the-Script-Pane-and-Console-Pane.md b/reference/docs-conceptual/core-powershell/ise/How-to-Use-Tab-Completion-in-the-Script-Pane-and-Console-Pane.md index 35cf4833e2a9..410ac0c2741c 100644 --- a/reference/docs-conceptual/core-powershell/ise/How-to-Use-Tab-Completion-in-the-Script-Pane-and-Console-Pane.md +++ b/reference/docs-conceptual/core-powershell/ise/How-to-Use-Tab-Completion-in-the-Script-Pane-and-Console-Pane.md @@ -4,22 +4,24 @@ keywords: powershell,cmdlet title: How to Use Tab Completion in the Script Pane and Console Pane ms.assetid: 3b752c3c-0bd0-4eca-a2d3-2d5a37fd9d84 --- - # How to Use Tab Completion in the Script Pane and Console Pane + Tab completion provides automatic help when you are typing in the Script Pane or in the Command Pane. Use the following steps to take advantage of this feature: ## To automatically complete a command entry + In the Command Pane or Script Pane, type a few characters of a command and then press TAB to select the desired completion text. If multiple items begin with the text that you initially typed, then continue pressing Tab until the item you want appears. Tab completion can help with typing a cmdlet name, parameter name, variable name, object property name, or a file path. > [!NOTE] > In the Script Pane, pressing TAB will automatically complete a command only when you are editing .ps1, .psd1, or .psm1 files. Tab completion works any time when you are typing in the Command Pane. ## To automatically complete a cmdlet parameter entry + In the Command Pane or Script pane, type a cmdlet followed by a dash, and then press TAB. For example, type `Get-Process -` and then press TAB multiple times to display each of the parameters for the cmdlet in turn. ## See Also -- [Using Windows PowerShell ISE](using-the-windows-powershell-ise.md) -- [How to Create a PowerShell Tab](How-to-Create-a-PowerShell-Tab-in-Windows-PowerShell-ISE.md) +- [Introducing the Windows PowerShell ISE](Introducing-the-Windows-PowerShell-ISE.md) +- [How to Create a PowerShell Tab](How-to-Create-a-PowerShell-Tab-in-Windows-PowerShell-ISE.md) \ No newline at end of file diff --git a/reference/docs-conceptual/core-powershell/ise/How-to-Use-the-Console-Pane-in-the-Windows-PowerShell-ISE.md b/reference/docs-conceptual/core-powershell/ise/How-to-Use-the-Console-Pane-in-the-Windows-PowerShell-ISE.md index 74fbb8aa53ef..14260fa1a4fe 100644 --- a/reference/docs-conceptual/core-powershell/ise/How-to-Use-the-Console-Pane-in-the-Windows-PowerShell-ISE.md +++ b/reference/docs-conceptual/core-powershell/ise/How-to-Use-the-Console-Pane-in-the-Windows-PowerShell-ISE.md @@ -4,8 +4,8 @@ keywords: powershell,cmdlet title: How to Use the Console Pane in the Windows PowerShell ISE ms.assetid: 44d67705-87c7-4a69-a53e-6471fdebb757 --- - # How to Use the Console Pane in the Windows PowerShell ISE + The Console pane in the Windows PowerShell Integrated Scripting Environment (ISE) operates exactly like the stand-alone Windows PowerShell ISE console window. To run a command in the Console Pane, type a command, and then press ENTER. To enter multiple commands that you want to execute in sequence, type SHIFT+ENTER between commands. See [How to Use Tab Completion in the Script Pane and Console Pane](How-to-Use-Tab-Completion-in-the-Script-Pane-and-Console-Pane.md) for help in typing commands. @@ -21,5 +21,5 @@ Beginning in Windows PowerShell v3, the Output pane was combined with the Consol - Clear all the text in the Console pane. To clear the Console pane, you can click the **Clear Console Pane** icon on the toolbar, or run the command **Clear-Host** or its alias, **cls**. ## See Also -- [Using the Windows PowerShell ISE](Using-the-Windows-PowerShell-ISE.md) +- [Introducing the Windows PowerShell ISE](Introducing-the-Windows-PowerShell-ISE.md) \ No newline at end of file diff --git a/reference/docs-conceptual/core-powershell/ise/How-to-Write-and-Run-Scripts-in-the-Windows-PowerShell-ISE.md b/reference/docs-conceptual/core-powershell/ise/How-to-Write-and-Run-Scripts-in-the-Windows-PowerShell-ISE.md index 7bd06cb58cc8..76bdd90afc6d 100644 --- a/reference/docs-conceptual/core-powershell/ise/How-to-Write-and-Run-Scripts-in-the-Windows-PowerShell-ISE.md +++ b/reference/docs-conceptual/core-powershell/ise/How-to-Write-and-Run-Scripts-in-the-Windows-PowerShell-ISE.md @@ -135,5 +135,4 @@ Windows PowerShell ISE supports the following encoding options: ASCII, BigEndian Windows PowerShell ISE does not change the encoding of scripts that were created by in other editors, even when you use the Save or Save As commands in Windows PowerShell ISE. ## See Also -- [Using the Windows PowerShell ISE](Using-the-Windows-PowerShell-ISE.md) - +- [Exploring the Windows PowerShell ISE](../../getting-started/fundamental/exploring-the-windows-powershell-ise.md) diff --git a/reference/docs-conceptual/core-powershell/ise/The-ISE-Object-Model-Hierarchy.md b/reference/docs-conceptual/core-powershell/ise/The-ISE-Object-Model-Hierarchy.md index 597e26937f15..a89b4c1ae48b 100644 --- a/reference/docs-conceptual/core-powershell/ise/The-ISE-Object-Model-Hierarchy.md +++ b/reference/docs-conceptual/core-powershell/ise/The-ISE-Object-Model-Hierarchy.md @@ -3,13 +3,13 @@ ms.date: 2017-06-05 keywords: powershell,cmdlet title: The ISE Object Model Hierarchy --- - # The ISE Object Model Hierarchy -This topic shows the hierarchy of objects that are part of -Windows PowerShell Integrated Scripting Environment (ISE). -Windows PowerShell ISE is included in Windows PowerShell 3.0 -and in Windows PowerShell 4.0. -Click an object to take you to the reference documentation + +This topic shows the hierarchy of objects that are part of +Windows PowerShell Integrated Scripting Environment (ISE). +Windows PowerShell ISE is included in Windows PowerShell 3.0 +and in Windows PowerShell 4.0. +Click an object to take you to the reference documentation for the class that defines the object. ## $psISE Object @@ -39,7 +39,7 @@ edge of the Windows PowerShell ISE window. The **$psISE.CurrentVisibleHorizontalTool** object is an instance of the [ISEAddOnTool](The-ISEAddOnTool-Object.md) class. -It represents the installed add-on tool that is currently docked to the +It represents the installed add-on tool that is currently docked to the right-hand edge of the Windows PowerShell ISE window. ## [$psISE.Options](The-ISEOptions-Object.md) @@ -55,11 +55,12 @@ It is an instance of the Microsoft.PowerShell.Host.ISE.ISEOptions class. The **$psISE.PowerShellTabs** object is an instance of the [PowerShellTabCollection](The-PowerShellTabCollection-Object.md) class. It is a collection of all the currently open PowerShell tabs that represent -the available Windows PowerShell run environments on the local computer -or on connected remote computers. +the available Windows PowerShell run environments on the local computer +or on connected remote computers. Each member in the collection is an instance of the [PowerShellTab](The-PowerShellTab-Object.md) class. ## See Also -- [The Windows PowerShell ISE Scripting Object Model](The-Windows-PowerShell-ISE-Scripting-Object-Model.md) -- [Windows PowerShell ISE Object Model Reference](Windows-PowerShell-ISE-Object-Model-Reference.md) + +- [Purpose of the Windows PowerShell ISE Scripting Object Model](Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md) +- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) \ No newline at end of file diff --git a/reference/docs-conceptual/core-powershell/ise/The-ISEAddOnTool-Object.md b/reference/docs-conceptual/core-powershell/ise/The-ISEAddOnTool-Object.md index 19b180856abe..7d285f2d9304 100644 --- a/reference/docs-conceptual/core-powershell/ise/The-ISEAddOnTool-Object.md +++ b/reference/docs-conceptual/core-powershell/ise/The-ISEAddOnTool-Object.md @@ -4,25 +4,27 @@ keywords: powershell,cmdlet title: The ISEAddOnTool Object ms.assetid: ce84d8bc-07ba-41f6-bdde-d6f3fddcd1e3 --- - # The ISEAddOnTool Object - An **ISEAddonTool** object represents an installed add-on tool that provides additional functionality toWindows PowerShell ISE. An example is the **Commands** tool that you can display by clicking **View**, then **Show Command Add-on**. This tool is then accessible to you by manipulating the various available **ISEAddOnTool** objects. - Each add-on tool can be associated with either the vertical pane or the horizontal pane. The vertical pane is docked to the right edge of Windows PowerShell ISE. The horizontal pane is docked to the bottom edge. +An **ISEAddonTool** object represents an installed add-on tool that provides additional functionality toWindows PowerShell ISE. An example is the **Commands** tool that you can display by clicking **View**, then **Show Command Add-on**. This tool is then accessible to you by manipulating the various available **ISEAddOnTool** objects. + +Each add-on tool can be associated with either the vertical pane or the horizontal pane. The vertical pane is docked to the right edge of Windows PowerShell ISE. The horizontal pane is docked to the bottom edge. - Each PowerShell tab in Windows PowerShell ISE can have its own set of add-on tools installed. See [$psISE.CurrentPowerShellTab.HorizontalAddOnTools](The-PowerShellTab-Object.md) and [$psISE.CurrentPowerShellTab.VerticalAddOnTools](The-PowerShellTab-Object.md) to access the collection of tools available to the currently selected tab or the same properties on any of the **PowerShellTab** objects in the [$psISE.PowerShellTabs](The-PowerShellTabCollection-Object.md) collection object. +Each PowerShell tab in Windows PowerShell ISE can have its own set of add-on tools installed. See [$psISE.CurrentPowerShellTab.HorizontalAddOnTools](The-PowerShellTab-Object.md) and [$psISE.CurrentPowerShellTab.VerticalAddOnTools](The-PowerShellTab-Object.md) to access the collection of tools available to the currently selected tab or the same properties on any of the **PowerShellTab** objects in the [$psISE.PowerShellTabs](The-PowerShellTabCollection-Object.md) collection object. ## Methods - There are no Windows PowerShell ISE-specific methods available for objects of this class. + +There are no Windows PowerShell ISE-specific methods available for objects of this class. ## Properties ### Control - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - The **Control** property provides read access to many of the details of the Commands add-on tool. +Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. -``` +The **Control** property provides read access to many of the details of the Commands add-on tool. + +```powershell # View the properties of the Commands add-on tool. # (assumes that it is visible in the vertical pane) $psISE.CurrentVisibleVerticalTool.Control @@ -130,37 +132,35 @@ TouchesDirectlyOver : {} DependencyObjectType : System.Windows.DependencyObjectType IsSealed : False Dispatcher : System.Windows.Threading.Dispatcher - ``` ### IsVisible - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - The Boolean property that indicates whether the add-on tool is currently visible in its assigned pane. If it is visible, you can set the **IsVisible** property to **$false** to hide the tool, or set the **IsVisible** property to **$true** to make an add-on tool visible on its PowerShell tab. Note that after an add-on tool is hidden, it is no longer accessible through the **CurrentVisibleHorizontalTool** or **CurrentVisibleVerticalTool** objects, and therefore cannot be made visible by using this property on that object. +Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. -``` +The Boolean property that indicates whether the add-on tool is currently visible in its assigned pane. If it is visible, you can set the **IsVisible** property to **$false** to hide the tool, or set the **IsVisible** property to **$true** to make an add-on tool visible on its PowerShell tab. Note that after an add-on tool is hidden, it is no longer accessible through the **CurrentVisibleHorizontalTool** or **CurrentVisibleVerticalTool** objects, and therefore cannot be made visible by using this property on that object. + +```powershell # Hide the current tool in the vertical tool pane $psISE.CurrentVisibleVerticalTool.IsVisible = $false # Show the first tool on the currently selected PowerShell tab -$psISE.CurrentPowerShellTab.VerticalAddOnTools[0].IsVisible=$true - +$psISE.CurrentPowerShellTab.VerticalAddOnTools[0].IsVisible = $true ``` ### Name - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - The read-only property that gets the name of the add-on tool. +Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. -``` +The read-only property that gets the name of the add-on tool. + +```powershell # Gets the name of the visible vertical pane add-on tool. -$psISE.CurrentVisibleVerticalTool.name +$psISE.CurrentVisibleVerticalTool.Name Commands - ``` ## See Also -- [The ISEAddOnToolCollection Object](The-ISEAddOnToolCollection-Object.md) -- [The Windows PowerShell ISE Scripting Object Model](The-Windows-PowerShell-ISE-Scripting-Object-Model.md) -- [Windows PowerShell ISE Object Model Reference](Windows-PowerShell-ISE-Object-Model-Reference.md) -- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) +- [The ISEAddOnToolCollection Object](The-ISEAddOnToolCollection-Object.md) +- [Purpose of the Windows PowerShell ISE Scripting Object Model](Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md) +- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) \ No newline at end of file diff --git a/reference/docs-conceptual/core-powershell/ise/The-ISEAddOnToolCollection-Object.md b/reference/docs-conceptual/core-powershell/ise/The-ISEAddOnToolCollection-Object.md index 50d5bd29b2a8..04fd2eef7eda 100644 --- a/reference/docs-conceptual/core-powershell/ise/The-ISEAddOnToolCollection-Object.md +++ b/reference/docs-conceptual/core-powershell/ise/The-ISEAddOnToolCollection-Object.md @@ -4,25 +4,26 @@ keywords: powershell,cmdlet title: The ISEAddOnToolCollection Object ms.assetid: 634eab89-0845-4016-974b-361b09bb8f7b --- - # The ISEAddOnToolCollection Object - The **ISEAddOnToolCollection** object is a collection of **ISEAddOnTool** objects. An example is the **$psISE.CurrentPowerShellTab.VerticalAddOnTools** object. + +The **ISEAddOnToolCollection** object is a collection of **ISEAddOnTool** objects. An example is the **$psISE.CurrentPowerShellTab.VerticalAddOnTools** object. ## Methods ### Add\( Name, ControlType, \[IsVisible\] \) - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - Adds a new add-on tool to the collection. It returns the newly added add-on tool. Before you run this command, you must install the add-on tool on the local computer and load the assembly. +Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - **Name** - String - Specifies the display name of the add-on tool that is added to Windows PowerShell ISE. +Adds a new add-on tool to the collection. It returns the newly added add-on tool. Before you run this command, you must install the add-on tool on the local computer and load the assembly. - **ControlType** -Type - Specifies the control that is added. +**Name** - String +Specifies the display name of the add-on tool that is added to Windows PowerShell ISE. - **\[IsVisible\]** - optional Boolean - If set to **$true**, the add-on tool is immediately visible in the associated tool pane. +**ControlType** -Type +Specifies the control that is added. + +**\[IsVisible\]** - optional Boolean +If set to **$true**, the add-on tool is immediately visible in the associated tool pane. ```powershell # Load a DLL with an add-on and then add it to the ISE @@ -31,12 +32,13 @@ $psISE.CurrentPowerShellTab.VerticalAddOnTools.Add("Solutions", [ISESimpleSoluti ``` ### Remove\( Item \) - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - Removes the specified add-on tool from the collection. +Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. + +Removes the specified add-on tool from the collection. - **Item** - Microsoft.PowerShell.Host.ISE.ISEAddOnTool - Specifies the object to be removed from Windows PowerShell ISE. +**Item** - Microsoft.PowerShell.Host.ISE.ISEAddOnTool +Specifies the object to be removed from Windows PowerShell ISE. ```powershell # Load a DLL with an add-on and then add it to the ISE @@ -45,39 +47,39 @@ $psISE.CurrentPowerShellTab.VerticalAddOnTools.Add("Solutions", [ISESimpleSoluti ``` ### SetSelectedPowerShellTab\( psTab \) - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - Selects the PowerShell tab that the **psTab** parameter specifies. +Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - **psTab** - Microsoft.PowerShell.Host.ISE.PowerShellTab - The PowerShell tab to select. +Selects the PowerShell tab that the **psTab** parameter specifies. + +**psTab** - Microsoft.PowerShell.Host.ISE.PowerShellTab +The PowerShell tab to select. ```powershell - $newTab = $psISE.PowerShellTabs.Add() -# Change the DisplayName of the new PowerShell tab. -$newTab.DisplayName="Brand New Tab" +$newTab = $psISE.PowerShellTabs.Add() +# Change the DisplayName of the new PowerShell tab. +$newTab.DisplayName = 'Brand New Tab' ``` ### Remove\( psTab \) - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - Removes the PowerShell tab that the **psTab** parameter specifies. +Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. + +Removes the PowerShell tab that the **psTab** parameter specifies. - **psTab** - Microsoft.PowerShell.Host.ISE.PowerShellTab - The PowerShell tab to remove. +**psTab** - Microsoft.PowerShell.Host.ISE.PowerShellTab +The PowerShell tab to remove. ```powershell $newTab = $psISE.PowerShellTabs.Add() -Change the DisplayName of the new PowerShell tab. -$newTab.DisplayName="This tab will go away in 5 seconds" -sleep 5 +Change the DisplayName of the new PowerShell tab. +$newTab.DisplayName = 'This tab will go away in 5 seconds' +sleep 5 $psISE.PowerShellTabs.Remove($newTab) ``` ## See Also -- [The PowerShellTab Object](The-PowerShellTab-Object.md) -- [The Windows PowerShell ISE Scripting Object Model](The-Windows-PowerShell-ISE-Scripting-Object-Model.md) -- [Windows PowerShell ISE Object Model Reference](Windows-PowerShell-ISE-Object-Model-Reference.md) -- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) - +- [The PowerShellTab Object](The-PowerShellTab-Object.md) +- [Purpose of the Windows PowerShell ISE Scripting Object Model](Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md) +- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) \ No newline at end of file diff --git a/reference/docs-conceptual/core-powershell/ise/The-ISEEditor-Object.md b/reference/docs-conceptual/core-powershell/ise/The-ISEEditor-Object.md index fbbe0534389a..cf6d8a55dfc2 100644 --- a/reference/docs-conceptual/core-powershell/ise/The-ISEEditor-Object.md +++ b/reference/docs-conceptual/core-powershell/ise/The-ISEEditor-Object.md @@ -3,16 +3,17 @@ ms.date: 2017-06-05 keywords: powershell,cmdlet title: The ISEEditor Object --- - # The ISEEditor Object - An **ISEEditor** object is an instance of the Microsoft.PowerShell.Host.ISE.ISEEditor class. The Console pane is an **ISEEditor** object. Each [ISEFile](The-ISEFile-Object.md) object has an associated **ISEEditor** object. The following sections list the methods and properties of an **ISEEditor** object. + +An **ISEEditor** object is an instance of the Microsoft.PowerShell.Host.ISE.ISEEditor class. The Console pane is an **ISEEditor** object. Each [ISEFile](The-ISEFile-Object.md) object has an associated **ISEEditor** object. The following sections list the methods and properties of an **ISEEditor** object. ## Methods ### Clear\(\) - Supported in Windows PowerShell ISE 2.0 and later. - Clears the text in the editor. +Supported in Windows PowerShell ISE 2.0 and later. + +Clears the text in the editor. ```powershell # Clears the text in the Console pane. @@ -20,104 +21,113 @@ $psISE.CurrentPowerShellTab.ConsolePane.Clear() ``` ### EnsureVisible\(int lineNumber\) - Supported in Windows PowerShell ISE 2.0 and later. - Scrolls the editor so that the line that corresponds to the specified **lineNumber** parameter value is visible. It throws an exception if the specified line number is outside the range of 1,last line number, which defines the valid line numbers. +Supported in Windows PowerShell ISE 2.0 and later. - **lineNumber** - The number of the line that is to be made visible. +Scrolls the editor so that the line that corresponds to the specified **lineNumber** parameter value is visible. It throws an exception if the specified line number is outside the range of 1,last line number, which defines the valid line numbers. + +**lineNumber** +The number of the line that is to be made visible. ```powershell -# Scrolls the text in the Script pane so that the fifth line is in view. +# Scrolls the text in the Script pane so that the fifth line is in view. $psISE.CurrentFile.Editor.EnsureVisible(5) ``` ### Focus\(\) - Supported in Windows PowerShell ISE 2.0 and later. - Sets the focus to the editor. +Supported in Windows PowerShell ISE 2.0 and later. + +Sets the focus to the editor. ```powershell -# Sets focus to the Console pane. +# Sets focus to the Console pane. $psISE.CurrentPowerShellTab.ConsolePane.Focus() ``` ### GetLineLength\(int lineNumber \) - Supported in Windows PowerShell ISE 2.0 and later. - Gets the line length as an integer for the line that is specified by the line number. +Supported in Windows PowerShell ISE 2.0 and later. - **lineNumber** - The number of the line of which to get the length. +Gets the line length as an integer for the line that is specified by the line number. - **Returns** - The line length for the line at the specified line number. +**lineNumber** +The number of the line of which to get the length. + +**Returns** +The line length for the line at the specified line number. ```powershell -# Gets the length of the first line in the text of the Command pane. +# Gets the length of the first line in the text of the Command pane. $psISE.CurrentPowerShellTab.ConsolePane.GetLineLength(1) ``` ### GoToMatch\(\) - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - Moves the caret to the matching character if the **CanGoToMatch** property of the editor object is **$true**, which occurs when the caret is immediately before an opening parenthesis, bracket, or brace - \(,\[,{ - or immediately after a closing parenthesis, bracket, or brace - \),\],}. The caret is placed before an opening character or after a closing character. If the **CanGoToMatch** property is **$false**, then this method does nothing. +Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. + +Moves the caret to the matching character if the **CanGoToMatch** property of the editor object is **$true**, which occurs when the caret is immediately before an opening parenthesis, bracket, or brace - \(,\[,{ - or immediately after a closing parenthesis, bracket, or brace - \),\],}. The caret is placed before an opening character or after a closing character. If the **CanGoToMatch** property is **$false**, then this method does nothing. ```powershell -# Test to see if the caret is next to a parenthesis, bracket, or brace. +# Goes to the matching character if CanGoToMatch() is $true +$psISE.CurrentPowerShellTab.ConsolePane.GoToMatch() ``` ### InsertText\( text \) - Supported in Windows PowerShell ISE 2.0 and later. - Replaces the selection with text or inserts text at the current caret position. +Supported in Windows PowerShell ISE 2.0 and later. + +Replaces the selection with text or inserts text at the current caret position. - **text** - String - The text to insert. +**text** - String +The text to insert. - See the [Scripting Example](#scripting-example) later in this topic. +See the [Scripting Example](#scripting-example) later in this topic. ### Select\( startLine, startColumn, endLine, endColumn \) - Supported in Windows PowerShell ISE 2.0 and later. - Selects the text from the **startLine**, **startColumn**, **endLine**, and **endColumn** parameters. +Supported in Windows PowerShell ISE 2.0 and later. - **startLine** - Integer - The line where the selection starts. +Selects the text from the **startLine**, **startColumn**, **endLine**, and **endColumn** parameters. - **startColumn** - Integer - The column within the start line where the selection starts. +**startLine** - Integer +The line where the selection starts. - **endLine** - Integer - The line where the selection ends. +**startColumn** - Integer +The column within the start line where the selection starts. - **endColumn** - Integer - The column within the end line where the selection ends. +**endLine** - Integer +The line where the selection ends. - See the [Scripting Example](#scripting-example) later in this topic. +**endColumn** - Integer +The column within the end line where the selection ends. + +See the [Scripting Example](#scripting-example) later in this topic. ### SelectCaretLine\(\) - Supported in Windows PowerShell ISE 2.0 and later. - Selects the entire line of text that currently contains the caret. +Supported in Windows PowerShell ISE 2.0 and later. + +Selects the entire line of text that currently contains the caret. ```powershell # First, set the caret position on line 5. -$psISE.CurrentFile.Editor.SetCaretPosition(5,1) +$psISE.CurrentFile.Editor.SetCaretPosition(5,1) # Now select that entire line of text $psISE.CurrentFile.Editor.SelectCaretLine() ``` ### SetCaretPosition\( lineNumber, columnNumber \) - Supported in Windows PowerShell ISE 2.0 and later. - Sets the caret position at the line number and the column number. It throws an exception if either the caret line number or the caret column number are out of their respective valid ranges. +Supported in Windows PowerShell ISE 2.0 and later. + +Sets the caret position at the line number and the column number. It throws an exception if either the caret line number or the caret column number are out of their respective valid ranges. - **lineNumber** - Integer - The caret line number. +**lineNumber** - Integer +The caret line number. - **columnNumber** - Integer - The caret column number. +**columnNumber** - Integer +The caret column number. ```powershell # Set the CaretPosition. @@ -125,9 +135,10 @@ $psISE.CurrentFile.Editor.SetCaretPosition(5,1) ``` ### ToggleOutliningExpansion\(\) - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - Causes all the outline sections to expand or collapse. +Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. + +Causes all the outline sections to expand or collapse. ```powershell # Toggle the outlining expansion @@ -137,9 +148,10 @@ $psISE.CurrentFile.Editor.ToggleOutliningExpansion() ## Properties ### CanGoToMatch - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - The read-only Boolean property to indicate whether the caret is next to a parenthesis, bracket, or brace - \(\), \[\], {}. If the caret is immediately before the opening character or immediately after the closing character of a pair, then this property value is **$true**. Otherwise, it is **$false**. +Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. + +The read-only Boolean property to indicate whether the caret is next to a parenthesis, bracket, or brace - \(\), \[\], {}. If the caret is immediately before the opening character or immediately after the closing character of a pair, then this property value is **$true**. Otherwise, it is **$false**. ```powershell # Test to see if the caret is next to a parenthesis, bracket, or brace @@ -147,9 +159,10 @@ $psISE.CurrentFile.Editor.CanGoToMatch ``` ### CaretColumn - Supported in Windows PowerShell ISE 2.0 and later. - The read-only property that gets the column number that corresponds to the position of the caret. +Supported in Windows PowerShell ISE 2.0 and later. + +The read-only property that gets the column number that corresponds to the position of the caret. ```powershell # Get the CaretColumn. @@ -157,9 +170,10 @@ $psISE.CurrentFile.Editor.CaretColumn ``` ### CaretLine - Supported in Windows PowerShell ISE 2.0 and later. - The read-only property that gets the number of the line that contains the caret. +Supported in Windows PowerShell ISE 2.0 and later. + +The read-only property that gets the number of the line that contains the caret. ```powershell # Get the CaretLine. @@ -167,9 +181,10 @@ $psISE.CurrentFile.Editor.CaretLine ``` ### CaretLineText - Supported in Windows PowerShell ISE 2.0 and later. - The read-only property that gets the complete line of text that contains the caret. +Supported in Windows PowerShell ISE 2.0 and later. + +The read-only property that gets the complete line of text that contains the caret. ```powershell # Get all of the text on the line that contains the caret. @@ -177,9 +192,10 @@ $psISE.CurrentFile.Editor.CaretLineText ``` ### LineCount - Supported in Windows PowerShell ISE 2.0 and later. - The read-only property that gets the line count from the editor. +Supported in Windows PowerShell ISE 2.0 and later. + +The read-only property that gets the line count from the editor. ```powershell # Get the LineCount. @@ -187,24 +203,26 @@ $psISE.CurrentFile.Editor.LineCount ``` ### SelectedText - Supported in Windows PowerShell ISE 2.0 and later. - The read-only property that gets the selected text from the editor. +Supported in Windows PowerShell ISE 2.0 and later. - See the [Scripting Example](#scripting-example) later in this topic. +The read-only property that gets the selected text from the editor. + +See the [Scripting Example](#scripting-example) later in this topic. ### Text - Supported in Windows PowerShell ISE 2.0 and later. - The read/write property that gets or sets the text in the editor. +Supported in Windows PowerShell ISE 2.0 and later. + +The read/write property that gets or sets the text in the editor. - See the [Scripting Example](#scripting-example) later in this topic. +See the [Scripting Example](#scripting-example) later in this topic. ## Scripting Example ```powershell # This illustrates how you can use the length of a line to -# select the entire line and shows how you can make it lowercase. +# select the entire line and shows how you can make it lowercase. # You must run this in the Console pane. It will not run in the Script pane. # Begin by getting a variable that points to the editor. $myEditor = $psISE.CurrentFile.Editor @@ -218,10 +236,10 @@ $myEditor.InsertText("LINE3 `n") $myEditor.InsertText("LINE4 `n") $myEditor.InsertText("LINE5 `n") -# Use the GetLineLength method to get the length of the third line. -$endColumn= $myEditor.GetLineLength(3) +# Use the GetLineLength method to get the length of the third line. +$endColumn = $myEditor.GetLineLength(3) # Select the text in the first three lines. -$myEditor.Select(1,1,3,$endColumn + 1) +$myEditor.Select(1, 1, 3, $endColumn + 1) $selection = $myEditor.SelectedText # Clear all the text in the editor. $myEditor.Clear() @@ -230,10 +248,8 @@ $myEditor.InsertText($selection.ToLower()) ``` ## See Also -- [The ISEFile Object](The-ISEFile-Object.md) -- [The PowerShellTab Object](The-PowerShellTab-Object.md) -- [The Windows PowerShell ISE Scripting Object Model](The-Windows-PowerShell-ISE-Scripting-Object-Model.md) -- [Windows PowerShell ISE Object Model Reference](Windows-PowerShell-ISE-Object-Model-Reference.md) -- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) - +- [The ISEFile Object](The-ISEFile-Object.md) +- [The PowerShellTab Object](The-PowerShellTab-Object.md) +- [Purpose of the Windows PowerShell ISE Scripting Object Model](Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md) +- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) \ No newline at end of file diff --git a/reference/docs-conceptual/core-powershell/ise/The-ISEFile-Object.md b/reference/docs-conceptual/core-powershell/ise/The-ISEFile-Object.md index 804b66a2d8a3..fea8c09b0fbb 100644 --- a/reference/docs-conceptual/core-powershell/ise/The-ISEFile-Object.md +++ b/reference/docs-conceptual/core-powershell/ise/The-ISEFile-Object.md @@ -4,136 +4,136 @@ keywords: powershell,cmdlet title: The ISEFile Object ms.assetid: 1c6d91f3-c556-42a2-a017-79b6b7b4b7db --- - # The ISEFile Object - An **ISEFile** object represents a file in Windows PowerShell® Integrated Scripting Environment (ISE). It is an instance of the Microsoft.PowerShell.Host.ISE.ISEFile class. This topic lists its member methods and member properties. The **$psISE.CurrentFile** and the files in the Files collection in a PowerShell tab are all instances of the Microsoft.PowerShell.Host.ISE.ISEFile class. + +An **ISEFile** object represents a file in Windows PowerShell® Integrated Scripting Environment (ISE). It is an instance of the Microsoft.PowerShell.Host.ISE.ISEFile class. This topic lists its member methods and member properties. The **$psISE.CurrentFile** and the files in the Files collection in a PowerShell tab are all instances of the Microsoft.PowerShell.Host.ISE.ISEFile class. ## Methods ### Save\( \[saveEncoding\] \) - Supported in Windows PowerShell ISE 2.0 and later. - Saves the file to disk. +Supported in Windows PowerShell ISE 2.0 and later. - **\[saveEncoding\]** - optional [System.Text.Encoding](http://msdn.microsoft.com/library/system.text.encoding.aspx) - An optional character encoding parameter to be used for the saved file. The default value is **UTF8**. +Saves the file to disk. - **Exceptions** - - **System.IO.IOException**: The file could not be saved. +**\[saveEncoding\]** - optional [System.Text.Encoding](http://msdn.microsoft.com/library/system.text.encoding.aspx) +An optional character encoding parameter to be used for the saved file. The default value is **UTF8**. -``` +**Exceptions** + +- **System.IO.IOException**: The file could not be saved. + +```powershell # Save the file using the default encoding (UTF8) -$psIse.CurrentFile.Save() +$psISE.CurrentFile.Save() # Save the file as ASCII. -$psIse.CurrentFile.Save( [System.Text.Encoding]::ASCII ) +$psISE.CurrentFile.Save([System.Text.Encoding]::ASCII) # Gets the current encoding. -$myfile=$psIse.CurrentFile +$myfile = $psISE.CurrentFile $myfile.Encoding - ``` ### SaveAs\(filename, \[saveEncoding\]\) - Supported in Windows PowerShell ISE 2.0 and later. - Saves the file with the specified file name and encoding. +Supported in Windows PowerShell ISE 2.0 and later. - **filename** - String - The name to be used to save the file. +Saves the file with the specified file name and encoding. - **\[saveEncoding\]** - optional [System.Text.Encoding](http://msdn.microsoft.com/library/system.text.encoding.aspx) - An optional character encoding parameter to be used for the saved file. The default value is **UTF8**. +**filename** - String +The name to be used to save the file. - **Exceptions** - - **System.ArgumentNullException**: The **filename** parameter is null. +**\[saveEncoding\]** - optional [System.Text.Encoding](http://msdn.microsoft.com/library/system.text.encoding.aspx) +An optional character encoding parameter to be used for the saved file. The default value is **UTF8**. -- **System.ArgumentException**: The **filename** parameter is empty. +**Exceptions** +- **System.ArgumentNullException**: The **filename** parameter is null. +- **System.ArgumentException**: The **filename** parameter is empty. - **System.IO.IOException**: The file could not be saved. -``` -# Save the file with a full path and name. +```powershell +# Save the file with a full path and name. $fullpath = "c:\temp\newname.txt" -$psIse.CurrentFile.SaveAs($fullPath) -# Save the file with a full path and name and explicitly as UTF8. -$psIse.CurrentFile.SaveAs( $fullPath, [System.Text.Encoding]::UTF8 ) - +$psISE.CurrentFile.SaveAs($fullPath) +# Save the file with a full path and name and explicitly as UTF8. +$psISE.CurrentFile.SaveAs($fullPath, [System.Text.Encoding]::UTF8) ``` ## Properties ### DisplayName - Supported in Windows PowerShell ISE 2.0 and later. - The read-only property that gets the string that contains the display name of this file. The name is shown on the **File** tab at the top of the editor. The presence of an asterisk \(\*\) at the end of the name indicates that the file has changes that have not been saved. +Supported in Windows PowerShell ISE 2.0 and later. -``` -# Shows the display name of the file. -$psIse.CurrentFile.DisplayName +The read-only property that gets the string that contains the display name of this file. The name is shown on the **File** tab at the top of the editor. The presence of an asterisk \(\*\) at the end of the name indicates that the file has changes that have not been saved. +```powershell +# Shows the display name of the file. +$psISE.CurrentFile.DisplayName ``` ### Editor - Supported in Windows PowerShell ISE 2.0 and later. - The read-only property that gets the [editor object](The-ISEEditor-Object.md) that is used for the specified file. +Supported in Windows PowerShell ISE 2.0 and later. -``` -# Gets the editor and the text. -$psIse.CurrentFile.Editor.Text +The read-only property that gets the [editor object](The-ISEEditor-Object.md) that is used for the specified file. +```powershell +# Gets the editor and the text. +$psISE.CurrentFile.Editor.Text ``` ### Encoding - Supported in Windows PowerShell ISE 2.0 and later. - The read-only property that gets the original file encoding. This is a **System.Text.Encoding** object. +Supported in Windows PowerShell ISE 2.0 and later. -``` -# Shows the encoding for the file. -$psIse.CurrentFile.Encoding +The read-only property that gets the original file encoding. This is a **System.Text.Encoding** object. +```powershell +# Shows the encoding for the file. +$psISE.CurrentFile.Encoding ``` ### FullPath - Supported in Windows PowerShell ISE 2.0 and later. - The read-only property that gets the string that specifies the full path of the opened file. +Supported in Windows PowerShell ISE 2.0 and later. -``` -# Shows the full path for the file. -$psIse.CurrentFile.FullPath +The read-only property that gets the string that specifies the full path of the opened file. +```powershell +# Shows the full path for the file. +$psISE.CurrentFile.FullPath ``` ### IsSaved - Supported in Windows PowerShell ISE 2.0 and later. - The read-only Boolean property that returns **$true** if the file has been saved after it was last modified. +Supported in Windows PowerShell ISE 2.0 and later. -``` +The read-only Boolean property that returns **$true** if the file has been saved after it was last modified. + +```powershell # Determines whether the file has been saved since it was last modified. -$myfile=$psIse.CurrentFile +$myfile = $psISE.CurrentFile $myfile.IsSaved - ``` ### IsUntitled - Supported in Windows PowerShell ISE 2.0 and later. - The read-only property that returns **$true** if the file has never been given a title. +Supported in Windows PowerShell ISE 2.0 and later. -``` +The read-only property that returns **$true** if the file has never been given a title. + +```powershell # Determines whether the file has never been given a title. $psISE.CurrentFile.IsUntitled $psISE.CurrentFile.SaveAs("temp.txt") $psISE.CurrentFile.IsUntitled - ``` ## See Also -- [The ISEFileCollectionObject](The-ISEFileCollection-Object.md) -- [The Windows PowerShell ISE Scripting Object Model](The-Windows-PowerShell-ISE-Scripting-Object-Model.md) -- [Windows PowerShell ISE Object Model Reference](Windows-PowerShell-ISE-Object-Model-Reference.md) -- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) + +- [The ISEFileCollectionObject](The-ISEFileCollection-Object.md) +- [Purpose of the Windows PowerShell ISE Scripting Object Model](Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md) +- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) \ No newline at end of file diff --git a/reference/docs-conceptual/core-powershell/ise/The-ISEFileCollection-Object.md b/reference/docs-conceptual/core-powershell/ise/The-ISEFileCollection-Object.md index 12a6604cbaa3..7acc34359cf9 100644 --- a/reference/docs-conceptual/core-powershell/ise/The-ISEFileCollection-Object.md +++ b/reference/docs-conceptual/core-powershell/ise/The-ISEFileCollection-Object.md @@ -4,41 +4,42 @@ keywords: powershell,cmdlet title: The ISEFileCollection Object ms.assetid: 0f86a427-ea38-4bce-85f8-06c98d30d508 --- - # The ISEFileCollection Object - The **ISEFileCollection** object is a collection of **ISEFile** objects. An example is the $psISE.CurrentPowerShellTab.Files collection. + +The **ISEFileCollection** object is a collection of **ISEFile** objects. An example is the $psISE.CurrentPowerShellTab.Files collection. ## Methods ### Add\( \[fullPath\] \) - Supported in Windows PowerShell ISE 2.0 and later. - Creates and returns a new untitled file and adds it to the collection. The **IsUntitled** property of the newly created file is **$true**. +Supported in Windows PowerShell ISE 2.0 and later. - **\[fullPath\]** - Optional string - The fully specified path of the file. An exception is generated if you include the **fullPath** parameter and a relative path, or if you use a file name instead of the full path. +Creates and returns a new untitled file and adds it to the collection. The **IsUntitled** property of the newly created file is **$true**. -``` +**\[fullPath\]** - Optional string +The fully specified path of the file. An exception is generated if you include the **fullPath** parameter and a relative path, or if you use a file name instead of the full path. + +```powershell # Adds a new untitled file to the collection of files in the current PowerShell tab. $newFile = $psISE.CurrentPowerShellTab.Files.Add() # Adds a file specified by its full path to the collection of files in the current PowerShell tab. $psISE.CurrentPowerShellTab.Files.Add("$pshome\Examples\profile.ps1") - ``` ### Remove\( File, \[Force\] \) - Supported in Windows PowerShell ISE 2.0 and later. - Removes a specified file from the current PowerShell tab. +Supported in Windows PowerShell ISE 2.0 and later. - **File** - String - The ISEFile file that you want to remove from the collection. If the file has not been saved, this method throws an exception. Use the **Force** switch parameter to force the removal of an unsaved file. +Removes a specified file from the current PowerShell tab. - **\[Force\]** - optional Boolean - If set to **$true**, grants permission to remove the file even if it has not been saved after last use. The default is **$false**. +**File** - String +The ISEFile file that you want to remove from the collection. If the file has not been saved, this method throws an exception. Use the **Force** switch parameter to force the removal of an unsaved file. -``` +**\[Force\]** - optional Boolean +If set to **$true**, grants permission to remove the file even if it has not been saved after last use. The default is **$false**. + +```powershell # Removes the first opened file from the file collection associated with the current PowerShell tab. # If the file has not yet been saved, then an exception is generated. $firstfile = $psISE.CurrentPowerShellTab.Files[0] @@ -50,23 +51,22 @@ $psISE.CurrentPowerShellTab.Files.Remove($firstfile, $true) ``` ### SetSelectedFile\( selectedFile \) - Supported in Windows PowerShell ISE 2.0 and later. - Selects the file that is specified by the **selectedFile** parameter. +Supported in Windows PowerShell ISE 2.0 and later. - **selectedFile** - Microsoft.PowerShell.Host.ISE.ISEFile - The ISEFile file that you want to select. +Selects the file that is specified by the **selectedFile** parameter. -``` +**selectedFile** - Microsoft.PowerShell.Host.ISE.ISEFile +The ISEFile file that you want to select. +```powershell # Selects the specified file. $firstfile = $psISE.CurrentPowerShellTab.Files[0] $psISE.CurrentPowerShellTab.Files.SetSelectedFile($firstfile) - ``` ## See Also -- [The ISEFile Object](The-ISEFile-Object.md) -- [The Windows PowerShell ISE Scripting Object Model](The-Windows-PowerShell-ISE-Scripting-Object-Model.md) -- [Windows PowerShell ISE Object Model Reference](Windows-PowerShell-ISE-Object-Model-Reference.md) -- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) + +- [The ISEFile Object](The-ISEFile-Object.md) +- [Purpose of the Windows PowerShell ISE Scripting Object Model](Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md) +- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) \ No newline at end of file diff --git a/reference/docs-conceptual/core-powershell/ise/The-ISEMenuItem-Object.md b/reference/docs-conceptual/core-powershell/ise/The-ISEMenuItem-Object.md index 2c109843faa8..7b0948cfa73d 100644 --- a/reference/docs-conceptual/core-powershell/ise/The-ISEMenuItem-Object.md +++ b/reference/docs-conceptual/core-powershell/ise/The-ISEMenuItem-Object.md @@ -4,84 +4,86 @@ keywords: powershell,cmdlet title: The ISEMenuItem Object ms.assetid: a16660bd-0aee-46fd-ac17-3f022165d089 --- - # The ISEMenuItem Object - An **ISEMenuItem** object is an instance of the Microsoft.PowerShell.Host.ISE.ISEMenuItem class. All menu objects on the **Add-ons** menu are instances of the **Microsoft.PowerShell.Host.ISE.ISEMenuItem** class. + +An **ISEMenuItem** object is an instance of the Microsoft.PowerShell.Host.ISE.ISEMenuItem class. All menu objects on the **Add-ons** menu are instances of the **Microsoft.PowerShell.Host.ISE.ISEMenuItem** class. ## Properties ### DisplayName - Supported in Windows PowerShell ISE 2.0 and later. - The read-only property that gets the display name of the menu item. +Supported in Windows PowerShell ISE 2.0 and later. -``` +The read-only property that gets the display name of the menu item. + +```powershell # Get the display name of the Add-ons menu item $psISE.CurrentPowerShellTab.AddOnsMenu.SubMenus.Clear() -$psISE.CurrentPowerShellTab.AddOnsMenu.SubMenus.Add("_Process",{get-process},"Alt+P") +$psISE.CurrentPowerShellTab.AddOnsMenu.SubMenus.Add('_Process', {Get-Process}, 'Alt+P') $psISE.CurrentPowerShellTab.AddOnsMenu.DisplayName - ``` ### Action - Supported in Windows PowerShell ISE 2.0 and later. - The read-only property that gets the block of script. It invokes the action when you click the menu item. +Supported in Windows PowerShell ISE 2.0 and later. -``` +The read-only property that gets the block of script. It invokes the action when you click the menu item. + +```powershell # Get the action associated with the first submenu item. $psISE.CurrentPowerShellTab.AddOnsMenu.SubMenus.Clear() -$psISE.CurrentPowerShellTab.AddOnsMenu.SubMenus.Add("_Process",{get-process},"Alt+P") +$psISE.CurrentPowerShellTab.AddOnsMenu.SubMenus.Add('_Process', {Get-Process}, 'Alt+P') $psISE.CurrentPowerShellTab.AddOnsMenu.Submenus[0].Action -# Invoke the script associated with the first submenu item +# Invoke the script associated with the first submenu item $psISE.CurrentPowerShellTab.AddOnsMenu.Submenus[0].Action.Invoke() ``` ### Shortcut - Supported in Windows PowerShell ISE 2.0 and later. - The read-only property that gets the Windows input keyboard shortcut for the menu item. +Supported in Windows PowerShell ISE 2.0 and later. -``` +The read-only property that gets the Windows input keyboard shortcut for the menu item. + +```powershell # Get the shortcut for the first submenu item. $psISE.CurrentPowerShellTab.AddOnsMenu.SubMenus.Clear() -$psISE.CurrentPowerShellTab.AddOnsMenu.SubMenus.Add("_Process",{get-process},"Alt+P") +$psISE.CurrentPowerShellTab.AddOnsMenu.SubMenus.Add('_Process', {Get-Process}, 'Alt+P') $psISE.CurrentPowerShellTab.AddOnsMenu.Submenus[0].Shortcut ``` ### Submenus - Supported in Windows PowerShell ISE 2.0 and later. - The read-only property that gets the [list of submenus](The-ISEMenuItemCollection-Object.md) of the menu item. +Supported in Windows PowerShell ISE 2.0 and later. -``` +The read-only property that gets the [list of submenus](The-ISEMenuItemCollection-Object.md) of the menu item. + +```powershell # List the submenus of the Add-ons menu $psISE.CurrentPowerShellTab.AddOnsMenu.SubMenus.Clear() -$psISE.CurrentPowerShellTab.AddOnsMenu.SubMenus.Add("_Process",{get-process},"Alt+P") +$psISE.CurrentPowerShellTab.AddOnsMenu.SubMenus.Add('_Process', {Get-Process}, 'Alt+P') $psISE.CurrentPowerShellTab.AddOnsMenu.Submenus ``` ## Scripting example - To better understand the use of the Add-ons menu and its scriptable properties, read through the following scripting example. -``` +To better understand the use of the Add-ons menu and its scriptable properties, read through the following scripting example. +```powershell # This is a scripting example that shows the use of the Add-ons menu. # Clear the Add-ons menu if any entries currently exist $psISE.CurrentPowerShellTab.AddOnsMenu.SubMenus.Clear() # Add an Add-ons menu item with an shortcut and fast access key. # Note the use of “_” as opposed to the “&” for mapping to the fast access key letter for the menu item. -$menuAdded = $psISE.CurrentPowerShellTab.AddOnsMenu.SubMenus.Add("_Process",{get-process},"Alt+P") -# Add a nested menu - a parent and a child submenu item. -$parentAdded = $psISE.CurrentPowerShellTab.AddOnsMenu.SubMenus.Add("Parent",$null,$null) -$parentAdded.SubMenus.Add("_Dir",{dir},"Alt+D") - +$menuAdded = $psISE.CurrentPowerShellTab.AddOnsMenu.SubMenus.Add('_Process', {Get-Process}, 'Alt+P') +# Add a nested menu - a parent and a child submenu item. +$parentAdded = $psISE.CurrentPowerShellTab.AddOnsMenu.SubMenus.Add('Parent', $null, $null) +$parentAdded.SubMenus.Add('_Dir', {dir}, 'Alt+D') ``` ## See Also -- [The ISEMenuItemCollection Object](The-ISEMenuItemCollection-Object.md) -- [The Windows PowerShell ISE Scripting Object Model](The-Windows-PowerShell-ISE-Scripting-Object-Model.md) -- [Windows PowerShell ISE Object Model Reference](Windows-PowerShell-ISE-Object-Model-Reference.md) -- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) + +- [The ISEMenuItemCollection Object](The-ISEMenuItemCollection-Object.md) +- [Purpose of the Windows PowerShell ISE Scripting Object Model](Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md) +- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) \ No newline at end of file diff --git a/reference/docs-conceptual/core-powershell/ise/The-ISEMenuItemCollection-Object.md b/reference/docs-conceptual/core-powershell/ise/The-ISEMenuItemCollection-Object.md index 54bb10058793..adb3b4dd6275 100644 --- a/reference/docs-conceptual/core-powershell/ise/The-ISEMenuItemCollection-Object.md +++ b/reference/docs-conceptual/core-powershell/ise/The-ISEMenuItemCollection-Object.md @@ -4,50 +4,49 @@ keywords: powershell,cmdlet title: The ISEMenuItemCollection Object ms.assetid: 0c0f5484-3320-408e-8534-5bd1c8e48512 --- - # The ISEMenuItemCollection Object - An **ISEMenuItemCollection** object is a collection of **ISEMenuItem** objects. It is an instance of the Microsoft.PowerShell.Host.ISE.ISEMenuItemCollection class. An example is the **$psISE.CurrentPowerShellTab.AddOnsMenu.Submenus** object that is used to customize the **Add-On** menu in Windows PowerShell® Integrated Scripting Environment (ISE). + +An **ISEMenuItemCollection** object is a collection of **ISEMenuItem** objects. It is an instance of the Microsoft.PowerShell.Host.ISE.ISEMenuItemCollection class. An example is the **$psISE.CurrentPowerShellTab.AddOnsMenu.Submenus** object that is used to customize the **Add-On** menu in Windows PowerShell® Integrated Scripting Environment (ISE). ## Method ### Add\(string DisplayName, System.Management.Automation.ScriptBlock Action, System.Windows.Input.KeyGesture Shortcut \) - Supported in Windows PowerShell ISE 2.0 and later. - Adds a menu item to the collection. +Supported in Windows PowerShell ISE 2.0 and later. - **DisplayName** - The display name of the menu to be added. +Adds a menu item to the collection. - **Action** - The **System.Management.Automation.ScriptBlock** object that specifies the action that is associated with this menu item. +**DisplayName** +The display name of the menu to be added. - **Shortcut** - The keyboard shortcut for the action. +**Action** +The **System.Management.Automation.ScriptBlock** object that specifies the action that is associated with this menu item. - **Returns** - The ISEMenuItem object that was just added. +**Shortcut** +The keyboard shortcut for the action. -``` +**Returns** +The ISEMenuItem object that was just added. + +```powershell # Create an Add-ons menu with an fast access key and a shortcut. # Note the use of "_" as opposed to the "&" for mapping to the fast access key letter for the menu item. -$menuAdded = $psISE.CurrentPowerShellTab.AddOnsMenu.SubMenus.Add("_Process",{get-process},"Alt+P") +$menuAdded = $psISE.CurrentPowerShellTab.AddOnsMenu.SubMenus.Add('_Process', {Get-Process}, 'Alt+P') ``` ### Clear\(\) - Supported in Windows PowerShell ISE 2.0 and later. - Removes all submenus from the menu item. +Supported in Windows PowerShell ISE 2.0 and later. -``` +Removes all submenus from the menu item. + +```powershell # Remove all custom submenu items from the AddOns menu $psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Clear() - ``` ## See Also -- [The ISEMenuItem Object](The-ISEMenuItem-Object.md) -- [The Windows PowerShell ISE Scripting Object Model](The-Windows-PowerShell-ISE-Scripting-Object-Model.md) -- [Windows PowerShell ISE Object Model Reference](Windows-PowerShell-ISE-Object-Model-Reference.md) -- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) - +- [The ISEMenuItem Object](The-ISEMenuItem-Object.md) +- [Purpose of the Windows PowerShell ISE Scripting Object Model](Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md) +- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) \ No newline at end of file diff --git a/reference/docs-conceptual/core-powershell/ise/The-ISEOptions-Object.md b/reference/docs-conceptual/core-powershell/ise/The-ISEOptions-Object.md index 6bdeacbc4e68..b3a4cc67765b 100644 --- a/reference/docs-conceptual/core-powershell/ise/The-ISEOptions-Object.md +++ b/reference/docs-conceptual/core-powershell/ise/The-ISEOptions-Object.md @@ -4,161 +4,172 @@ keywords: powershell,cmdlet title: The ISEOptions Object ms.assetid: 75e2a76f-f3d1-490b-ad5d-e3829946aabb --- - # The ISEOptions Object - The **ISEOptions** object represents various settings for Windows PowerShell ISE. It is an instance of the **Microsoft.PowerShell.Host.ISE.ISEOptions** class. - The **ISEOptions** object provides the following methods and properties. +The **ISEOptions** object represents various settings for Windows PowerShell ISE. It is an instance of the **Microsoft.PowerShell.Host.ISE.ISEOptions** class. + +The **ISEOptions** object provides the following methods and properties. ## Methods ### RestoreDefaultConsoleTokenColors\(\) - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - Restores the default values of the token colors in the Console pane. +Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. -``` +Restores the default values of the token colors in the Console pane. + +```powershell # Changes the color of the commands in the Console pane to red and then restores it to its default value. -$psISE.Options.ConsoleTokenColors["Command"] = "red" +$psISE.Options.ConsoleTokenColors["Command"] = 'red' $psISE.Options.RestoreDefaultConsoleTokenColors() ``` ### RestoreDefaults\(\) - Supported in Windows PowerShell ISE 2.0 and later. - Restores the default values of all options settings in the Console pane. It also resets the behavior of various warning messages that provide the standard check box to prevent the message from being shown again. +Supported in Windows PowerShell ISE 2.0 and later. -``` +Restores the default values of all options settings in the Console pane. It also resets the behavior of various warning messages that provide the standard check box to prevent the message from being shown again. + +```powershell # Changes the background color in the Console pane and then restores it to its default value. -$psISE.Options.ConsolePaneBackgroundColor = "orange" +$psISE.Options.ConsolePaneBackgroundColor = 'orange' $psISE.Options.RestoreDefaults() ``` ### RestoreDefaultTokenColors\(\) - Supported in Windows PowerShell ISE 2.0 and later. - Restores the default values of the token colors in the Script pane. +Supported in Windows PowerShell ISE 2.0 and later. -``` +Restores the default values of the token colors in the Script pane. + +```powershell # Changes the color of the comments in the Script pane to red and then restores it to its default value. -$psISE.Options.TokenColors["Comment"]="red" +$psISE.Options.TokenColors["Comment"] = 'red' $psISE.Options.RestoreDefaultTokenColors() ``` ### RestoreDefaultXmlTokenColors\(\) - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - Restores the default values of the token colors for XML elements that are displayed in Windows PowerShell ISE. Also see [XmlTokenColors](#xmltokencolors). +Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. -``` +Restores the default values of the token colors for XML elements that are displayed in Windows PowerShell ISE. Also see [XmlTokenColors](#xmltokencolors). + +```powershell # Changes the color of the comments in XML data to red and then restores it to its default value. -$psISE.Options.XmlTokenColors["Comment"]="red" +$psISE.Options.XmlTokenColors["Comment"] = 'red' $psISE.Options.RestoreDefaultXmlTokenColors() ``` ## Properties ### AutoSaveMinuteInterval - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - Specifies the number of minutes between automatic save operations of your files by Windows PowerShell ISE. The default value is 2 minutes. The value is an integer. +Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. -``` +Specifies the number of minutes between automatic save operations of your files by Windows PowerShell ISE. The default value is 2 minutes. The value is an integer. + +```powershell # Changes the number of minutes between automatic save operations to every 3 minutes. $psISE.Options.AutoSaveMinuteInterval = 3 ``` ### CommandPaneBackgroundColor - This feature is present in Windows PowerShell ISE 2.0, but was removed or renamed in later versions of the ISE. For later versions, see [ConsolePaneBackgroundColor](#consolepanebackgroundcolor). - Specifies the background color for the Command pane. It is an instance of the **System.Windows.Media.Color** class. +This feature is present in Windows PowerShell ISE 2.0, but was removed or renamed in later versions of the ISE. For later versions, see [ConsolePaneBackgroundColor](#consolepanebackgroundcolor). -``` +Specifies the background color for the Command pane. It is an instance of the **System.Windows.Media.Color** class. + +```powershell # Changes the background color of the Command pane to orange. -$psISE.Options.CommandPaneBackgroundColor = "orange" +$psISE.Options.CommandPaneBackgroundColor = 'orange' ``` ### CommandPaneUp - This feature is present in Windows PowerShell ISE 2.0, but was removed or renamed in later versions of the ISE. - Specifies whether the Command pane is located above the Output pane. +This feature is present in Windows PowerShell ISE 2.0, but was removed or renamed in later versions of the ISE. -``` +Specifies whether the Command pane is located above the Output pane. + +```powershell # Moves the Command pane to the top of the screen. $psISE.Options.CommandPaneUp = $true - ``` ### ConsolePaneBackgroundColor - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - Specifies the background color for the Console pane. It is an instance of the **System.Windows.Media.Color** class. +Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. -``` +Specifies the background color for the Console pane. It is an instance of the **System.Windows.Media.Color** class. + +```powershell # Changes the background color of the Console pane to red. -$psISE.Options.ConsolePaneBackgroundColor = "red" +$psISE.Options.ConsolePaneBackgroundColor = 'red' ``` ### ConsolePaneForegroundColor - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - Specifies the foreground color of the text in the Console pane. +Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. -``` -# Changes the foreground color of the text in the Console pane to yellow. -$psISE.Options.ConsolePaneForegroundColor = "yellow" +Specifies the foreground color of the text in the Console pane. +```powershell +# Changes the foreground color of the text in the Console pane to yellow. +$psISE.Options.ConsolePaneForegroundColor = 'yellow' ``` ### ConsolePaneTextBackgroundColor - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - Specifies the background color of the text in the Console pane. +Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. -``` +Specifies the background color of the text in the Console pane. + +```powershell # Changes the background color of the Console pane text to pink. -$psISE.Options.ConsolePaneTextBackgroundColor = "pink" +$psISE.Options.ConsolePaneTextBackgroundColor = 'pink' ``` ### ConsoleTokenColors - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - Specifies the colors of the IntelliSense tokens in the Windows PowerShell ISE Console pane. This property is a dictionary object that contains name/value pairs of token types and colors for the Console pane. To change the colors of the IntelliSense tokens in the Script pane, see [TokenColors](#tokencolors). To reset the colors to the default values, see [RestoreDefaultConsoleTokenColors](#restoredefaultconsoletokencolors). Token colors can be set for the following: Attribute, Command, CommandArgument, CommandParameter, Comment, GroupEnd, GroupStart, Keyword, LineContinuation, LoopLabel, Member, NewLine, Number, Operator, Position, StatementSeparator, String, Type, Unknown, Variable. +Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. -``` +Specifies the colors of the IntelliSense tokens in the Windows PowerShell ISE Console pane. This property is a dictionary object that contains name/value pairs of token types and colors for the Console pane. To change the colors of the IntelliSense tokens in the Script pane, see [TokenColors](#tokencolors). To reset the colors to the default values, see [RestoreDefaultConsoleTokenColors](#restoredefaultconsoletokencolors). Token colors can be set for the following: Attribute, Command, CommandArgument, CommandParameter, Comment, GroupEnd, GroupStart, Keyword, LineContinuation, LoopLabel, Member, NewLine, Number, Operator, Position, StatementSeparator, String, Type, Unknown, Variable. + +```powershell # Sets the color of commands to green. -$psISE.Options.ConsoleTokenColors["Command"] = "green" +$psISE.Options.ConsoleTokenColors["Command"] = 'green' # Sets the color of keywords to magenta. -$psISE.Options.ConsoleTokenColors["Keyword"] = "magenta" - +$psISE.Options.ConsoleTokenColors["Keyword"] = 'magenta' ``` ### DebugBackgroundColor - Supported in Windows PowerShell ISE 2.0 and later. - Specifies the background color for the debug text that appears in the Console pane. It is an instance of the **System.Windows.Media.Color** class. +Supported in Windows PowerShell ISE 2.0 and later. -``` +Specifies the background color for the debug text that appears in the Console pane. It is an instance of the **System.Windows.Media.Color** class. + +```powershell # Changes the background color for the debug text that appears in the Console pane to blue. -$psISE.Options.DebugBackgroundColor ='#0000FF' +$psISE.Options.DebugBackgroundColor = '#0000FF' ``` ### DebugForegroundColor - Supported in Windows PowerShell ISE 2.0 and later. - Specifies the foreground color for the debug text that appears in the Console pane. It is an instance of the **System.Windows.Media.Color** class. +Supported in Windows PowerShell ISE 2.0 and later. -``` +Specifies the foreground color for the debug text that appears in the Console pane. It is an instance of the **System.Windows.Media.Color** class. + +```powershell # Changes the foreground color for the debug text that appears in the Console pane to yellow. -$psISE.Options.DebugForegroundColor ="yellow" +$psISE.Options.DebugForegroundColor = 'yellow' ``` ### DefaultOptions - Supported in Windows PowerShell ISE 2.0 and later. - A collection of properties that specify the default values to be used when the Reset methods are used. +Supported in Windows PowerShell ISE 2.0 and later. -``` +A collection of properties that specify the default values to be used when the Reset methods are used. + +```powershell # Displays the name of the default options. This example is from ISE 4.0. $psISE.Options.DefaultOptions @@ -197,337 +208,352 @@ ShowIntellisenseInScriptPane : True UseEnterToSelectInConsolePaneIntellisense : True UseEnterToSelectInScriptPaneIntellisense : True IntellisenseTimeoutInSeconds : 3 - ``` ### ErrorBackgroundColor - Supported in Windows PowerShell ISE 2.0 and later. - Specifies the background color for error text that appears in the Console pane. It is an instance of the **System.Windows.Media.Color** class. +Supported in Windows PowerShell ISE 2.0 and later. -``` +Specifies the background color for error text that appears in the Console pane. It is an instance of the **System.Windows.Media.Color** class. + +```powershell # Changes the background color for the error text that appears in the Console pane to black. -$psISE.Options.ErrorBackgroundColor="black" +$psISE.Options.ErrorBackgroundColor = 'black' ``` ### ErrorForegroundColor - Supported in Windows PowerShell ISE 2.0 and later. - Specifies the foreground color for error text that appears in the Console pane. It is an instance of the **System.Windows.Media.Color** class. +Supported in Windows PowerShell ISE 2.0 and later. -``` +Specifies the foreground color for error text that appears in the Console pane. It is an instance of the **System.Windows.Media.Color** class. + +```powershell # Changes the foreground color for the error text that appears in the console pane to green. -$psISE.Options.ErrorForegroundColor ="green" +$psISE.Options.ErrorForegroundColor = 'green' ``` ### FontName - Supported in Windows PowerShell ISE 2.0 and later. - Specifies the font name currently in use in both the Script pane and the Console pane. +Supported in Windows PowerShell ISE 2.0 and later. -``` +Specifies the font name currently in use in both the Script pane and the Console pane. + +```powershell # Changes the font used in both panes. -$psISE.Options.FontName = "courier new" +$psISE.Options.FontName = 'Courier New' ``` ### FontSize - Supported in Windows PowerShell ISE 2.0 and later. - Specifies the font size as an integer. It is used in the Script pane, the Command pane, and the Output pane. The valid range of values is 8 through 32. +Supported in Windows PowerShell ISE 2.0 and later. -``` +Specifies the font size as an integer. It is used in the Script pane, the Command pane, and the Output pane. The valid range of values is 8 through 32. + +```powershell # Changes the font size in all panes. $psISE.Options.FontSize = 20 - ``` ### IntellisenseTimeoutInSeconds - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - Specifies the number of seconds that IntelliSense uses to try to resolve the currently typed text. After this number of seconds, IntelliSense times out and enables you to continue typing. The default value is 3 seconds. The value is an integer. +Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. -``` +Specifies the number of seconds that IntelliSense uses to try to resolve the currently typed text. After this number of seconds, IntelliSense times out and enables you to continue typing. The default value is 3 seconds. The value is an integer. + +```powershell # Changes the number of seconds for IntelliSense syntax recognition to 5. $psISE.Options.IntellisenseTimeoutInSeconds = 5 ``` ### MruCount - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - Specifies the number of recently opened files that Windows PowerShell ISE tracks and displays at the bottom of the **File Open** menu. The default value is 10. The value is an integer. +Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. -``` +Specifies the number of recently opened files that Windows PowerShell ISE tracks and displays at the bottom of the **File Open** menu. The default value is 10. The value is an integer. + +```powershell # Changes the number of recently used files that appear at the bottom of the File Open menu to 5. $psISE.Options.MruCount = 5 ``` ### OutputPaneBackgroundColor - This feature is present in Windows PowerShell ISE 2.0, but was removed or renamed in later versions of the ISE. For later versions, see [ConsolePaneBackgroundColor](#consolepanebackgroundcolor). - The read/write property that gets or sets the background color for the Output pane itself. It is an instance of the **System.Windows.Media.Color** class. +This feature is present in Windows PowerShell ISE 2.0, but was removed or renamed in later versions of the ISE. For later versions, see [ConsolePaneBackgroundColor](#consolepanebackgroundcolor). -``` -# Changes the background color of the Output pane to gold. -$psISE.Options.OutputPaneForegroundColor = "gold" +The read/write property that gets or sets the background color for the Output pane itself. It is an instance of the **System.Windows.Media.Color** class. +```powershell +# Changes the background color of the Output pane to gold. +$psISE.Options.OutputPaneForegroundColor = 'gold' ``` ### OutputPaneTextForegroundColor - This feature is present in Windows PowerShell ISE 2.0, but was removed or renamed in later versions of the ISE. For later versions, see [ConsolePaneForegroundColor](#consolepaneforegroundcolor). - The read/write property that changes the foreground color of the text in the Output pane in Windows PowerShell ISE 2.0. +This feature is present in Windows PowerShell ISE 2.0, but was removed or renamed in later versions of the ISE. For later versions, see [ConsolePaneForegroundColor](#consolepaneforegroundcolor). -``` -# Changes the foreground color of the text in the Output Pane to blue. -$psISE.Options.OutputPaneTextForegroundColor = "blue" +The read/write property that changes the foreground color of the text in the Output pane in Windows PowerShell ISE 2.0. +```powershell +# Changes the foreground color of the text in the Output Pane to blue. +$psISE.Options.OutputPaneTextForegroundColor = 'blue' ``` ### OutputPaneTextBackgroundColor - This feature is present in Windows PowerShell ISE 2.0, but was removed or renamed in later versions of the ISE. For later versions, see [ConsolePaneTextBackgroundColor](#consolepanetextbackgroundcolor). - The read/write property that changes the background color of the text in the Output pane. +This feature is present in Windows PowerShell ISE 2.0, but was removed or renamed in later versions of the ISE. For later versions, see [ConsolePaneTextBackgroundColor](#consolepanetextbackgroundcolor). -``` +The read/write property that changes the background color of the text in the Output pane. + +```powershell # Changes the background color of the Output pane text to pink. -$psISE.Options.OutputPaneTextBackgroundColor = "pink" +$psISE.Options.OutputPaneTextBackgroundColor = 'pink' ``` ### ScriptPaneBackgroundColor - Supported in Windows PowerShell ISE 2.0 and later. - The read/write property that gets or sets the background color for files. It is an instance of the **System.Windows.Media.Color** class. +Supported in Windows PowerShell ISE 2.0 and later. -``` +The read/write property that gets or sets the background color for files. It is an instance of the **System.Windows.Media.Color** class. +```powershell # Sets the color of the script pane background to yellow. -$psISE.Options.ScriptPaneBackgroundColor = 'yellow' - +$psISE.Options.ScriptPaneBackgroundColor = 'yellow' ``` ### ScriptPaneForegroundColor - Supported in Windows PowerShell ISE 2.0 and later. - The read/write property that gets or sets the foreground color for non-script files in the Script pane. +Supported in Windows PowerShell ISE 2.0 and later. + +The read/write property that gets or sets the foreground color for non-script files in the Script pane. To set the foreground color for script files, use the [TokenColors](#tokencolors). -``` +```powershell # Sets the foreground to color of non-script files in the script pane to green. -$psISE.Options.ScriptPaneBackgroundColor = "green" - +$psISE.Options.ScriptPaneBackgroundColor = 'green' ``` ### SelectedScriptPaneState - Supported in Windows PowerShell ISE 2.0 and later. - The read/write property that gets or sets the position of the Script pane on the display. The string can be either "Maximized", "Top", or "Right". +Supported in Windows PowerShell ISE 2.0 and later. -``` +The read/write property that gets or sets the position of the Script pane on the display. The string can be either 'Maximized', 'Top', or 'Right'. + +```powershell # Moves the Script Pane to the top. -$psISE.Options.SelectedScriptPaneState = "Top" +$psISE.Options.SelectedScriptPaneState = 'Top' # Moves the Script Pane to the right. -$psISE.Options.SelectedScriptPaneState = "Right" +$psISE.Options.SelectedScriptPaneState = 'Right' # Maximizes the Script Pane -$psISE.Options.SelectedScriptPaneState = "Maximized" - +$psISE.Options.SelectedScriptPaneState = 'Maximized' ``` ### ShowDefaultSnippets - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - Specifies whether the **CTRL+J** list of snippets includes the starter set that is included in Windows PowerShell. When set to **$false**, only user-defined snippets appear in the **CTRL+J** list. The default value is **$true**. +Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. -``` +Specifies whether the **CTRL+J** list of snippets includes the starter set that is included in Windows PowerShell. When set to **$false**, only user-defined snippets appear in the **CTRL+J** list. The default value is **$true**. + +```powershell # Hide the default snippets from the CTRL+J list. -$psISe.Options.ShowDefaultSnippets = $false +$psISE.Options.ShowDefaultSnippets = $false ``` ### ShowIntellisenseInConsolePane - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - Specifies whether IntelliSense offers syntax, parameter, and value suggestions in the Console pane. The default value is **$true**. +Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. -``` +Specifies whether IntelliSense offers syntax, parameter, and value suggestions in the Console pane. The default value is **$true**. + +```powershell # Turn off IntelliSense in the console pane. -$psISe.Options.ShowIntellisenseInConsolePane = $false +$psISE.Options.ShowIntellisenseInConsolePane = $false ``` ### ShowIntellisenseInScriptPane - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - Specifies whether IntelliSense offers syntax, parameter, and value suggestions in the Script pane. The default value is **$true**. +Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. -``` +Specifies whether IntelliSense offers syntax, parameter, and value suggestions in the Script pane. The default value is **$true**. + +```powershell # Turn off IntelliSense in the Script pane. -$psISe.Options.ShowIntellisenseInScriptPane = $false +$psISE.Options.ShowIntellisenseInScriptPane = $false ``` ### ShowLineNumbers - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - Specifies whether the Script pane displays line numbers in the left margin. The default value is **$true**. +Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. -``` +Specifies whether the Script pane displays line numbers in the left margin. The default value is **$true**. + +```powershell # Turn off line numbers in the Script pane. -$psISe.Options.ShowLineNumbers = $false +$psISE.Options.ShowLineNumbers = $false ``` ### ShowOutlining - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - Specifies whether the Script pane displays expandable and collapsible brackets next to sections of code in the left margin. When they are displayed, you can click the minus \(-\) icons next to a block of text to collapse it or click the plus \(+\) icon to expand a block of text. The default value is **$true**. +Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. -``` +Specifies whether the Script pane displays expandable and collapsible brackets next to sections of code in the left margin. When they are displayed, you can click the minus \(-\) icons next to a block of text to collapse it or click the plus \(+\) icon to expand a block of text. The default value is **$true**. + +```powershell # Turn off outlining in the Script pane. -$psISe.Options.ShowOutlining = $false +$psISE.Options.ShowOutlining = $false ``` ### ShowToolBar - Supported in Windows PowerShell ISE 2.0 and later. - Specifies whether the ISE toolbar appears at the top of the Windows PowerShell ISE window. The default value is **$true**. +Supported in Windows PowerShell ISE 2.0 and later. -``` +Specifies whether the ISE toolbar appears at the top of the Windows PowerShell ISE window. The default value is **$true**. + +```powershell # Show the toolbar. -$psISe.Options.ShowToolBar = $true +$psISE.Options.ShowToolBar = $true ``` ### ShowWarningBeforeSavingOnRun - Supported in Windows PowerShell ISE 2.0 and later. - Specifies whether a warning message appears when a script is saved automatically before it is run. The default value is **$true**. +Supported in Windows PowerShell ISE 2.0 and later. -``` +Specifies whether a warning message appears when a script is saved automatically before it is run. The default value is **$true**. + +```powershell # Enable the warning message when an attempt # is made to run a script without saving it first. -$psISE.Options.ShowWarningBeforeSavingOnRun=$true - +$psISE.Options.ShowWarningBeforeSavingOnRun = $true ``` ### ShowWarningForDuplicateFiles - Supported in Windows PowerShell ISE 2.0 and later. - Specifies whether a warning message appears when the same file is opened in different PowerShell tabs. If set to **$true**, to open the same file in multiple tabs displays this message: "A copy of this file is open in another Windows PowerShell tab. Changes made to this file will affect all open copies." The default value is **$true**. +Supported in Windows PowerShell ISE 2.0 and later. -``` +Specifies whether a warning message appears when the same file is opened in different PowerShell tabs. If set to **$true**, to open the same file in multiple tabs displays this message: "A copy of this file is open in another Windows PowerShell tab. Changes made to this file will affect all open copies." The default value is **$true**. + +```powershell # Enable the warning message when a file is # opened in multiple PowerShell tabs. $psISE.Options.ShowWarningForDuplicateFiles = $true - ``` ### TokenColors - Supported in Windows PowerShell ISE 2.0 and later. - Specifies the colors of the IntelliSense tokens in the Windows PowerShell ISE Script pane. This property is a dictionary object that contains name/value pairs of token types and colors for the Script pane. To change the colors of the IntelliSense tokens in the Console pane, see [ConsoleTokenColors](#consoletokencolors). To reset the colors to the default values, see [RestoreDefaultTokenColors](#restoredefaulttokencolors). Token colors can be set for the following: Attribute, Command, CommandArgument, CommandParameter, Comment, GroupEnd, GroupStart, Keyword, LineContinuation, LoopLabel, Member, NewLine, Number, Operator, Position, StatementSeparator, String, Type, Unknown, Variable. +Supported in Windows PowerShell ISE 2.0 and later. -``` +Specifies the colors of the IntelliSense tokens in the Windows PowerShell ISE Script pane. This property is a dictionary object that contains name/value pairs of token types and colors for the Script pane. To change the colors of the IntelliSense tokens in the Console pane, see [ConsoleTokenColors](#consoletokencolors). To reset the colors to the default values, see [RestoreDefaultTokenColors](#restoredefaulttokencolors). Token colors can be set for the following: Attribute, Command, CommandArgument, CommandParameter, Comment, GroupEnd, GroupStart, Keyword, LineContinuation, LoopLabel, Member, NewLine, Number, Operator, Position, StatementSeparator, String, Type, Unknown, Variable. + +```powershell # Sets the color of commands to green. $psISE.Options.TokenColors["Command"] = "green" # Sets the color of keywords to magenta. $psISE.Options.TokenColors["Keyword"] = "magenta" - ``` ### UseEnterToSelectInConsolePaneIntellisense - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - Specifies whether you can use the Enter key to select an IntelliSense provided option in the Console pane. The default value is **$true**. +Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. -``` -# Turn off using the ENTER key to select an IntelliSense provided option in the Console pane. -$psISE.Options.UseEnterToSelectInConsolePaneIntellisense=$false +Specifies whether you can use the Enter key to select an IntelliSense provided option in the Console pane. The default value is **$true**. +```powershell +# Turn off using the ENTER key to select an IntelliSense provided option in the Console pane. +$psISE.Options.UseEnterToSelectInConsolePaneIntellisense = $false ``` ### UseEnterToSelectInScriptPaneIntellisense - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - Specifies whether you can use the Enter key to select an IntelliSense-provided option in the Script pane. The default value is **$true**. +Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. -``` -# Turn on using the Enter key to select an IntelliSense provided option in the Console pane. -$psISE.Options.UseEnterToSelectInConsolePaneIntellisense=$true +Specifies whether you can use the Enter key to select an IntelliSense-provided option in the Script pane. The default value is **$true**. +```powershell +# Turn on using the Enter key to select an IntelliSense provided option in the Console pane. +$psISE.Options.UseEnterToSelectInConsolePaneIntellisense = $true ``` ### UseLocalHelp - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - Specifies whether the locally installed Help or the online TechNet Library Help appears when you press F1 with the cursor positioned in a keyword. If set to **$true**, then a pop-up window shows content from the locally installed Help. You can install the Help files by running the `Update-Help` command. If set to **$false**, then your browser opens to a page in the TechNet Library. +Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. -``` +Specifies whether the locally installed Help or the online TechNet Library Help appears when you press F1 with the cursor positioned in a keyword. If set to **$true**, then a pop-up window shows content from the locally installed Help. You can install the Help files by running the `Update-Help` command. If set to **$false**, then your browser opens to a page in the TechNet Library. + +```powershell # Sets the option for the online help to be displayed. -$psISE.Options.UseLocalHelp=$false +$psISE.Options.UseLocalHelp = $false # Sets the option for the local Help to be displayed. -$psISE.Options.UseLocalHelp=$true - +$psISE.Options.UseLocalHelp = $true ``` ### VerboseBackgroundColor - Supported in Windows PowerShell ISE 2.0 and later. - Specifies the background color for verbose text that appears in the Console pane. It is a **System.Windows.Media.Color** object. +Supported in Windows PowerShell ISE 2.0 and later. -``` +Specifies the background color for verbose text that appears in the Console pane. It is a **System.Windows.Media.Color** object. + +```powershell # Changes the background color for verbose text to blue. $psISE.Options.VerboseBackgroundColor ='#0000FF' ``` ### VerboseForegroundColor - Supported in Windows PowerShell ISE 2.0 and later. - Specifies the foreground color for verbose text that appears in the Console pane. It is a **System.Windows.Media.Color** object. +Supported in Windows PowerShell ISE 2.0 and later. -``` +Specifies the foreground color for verbose text that appears in the Console pane. It is a **System.Windows.Media.Color** object. + +```powershell # Changes the foreground color for verbose text to yellow. -$psISE.Options.VerboseForegroundColor ='yellow' +$psISE.Options.VerboseForegroundColor = 'yellow' ``` ### WarningBackgroundColor - Supported in Windows PowerShell ISE 2.0 and later. - Specifies the background color for warning text that appears in the Console pane. It is a **System.Windows.Media.Color** object. +Supported in Windows PowerShell ISE 2.0 and later. -``` +Specifies the background color for warning text that appears in the Console pane. It is a **System.Windows.Media.Color** object. + +```powershell # Changes the background color for warning text to blue. -$psISE.Options.WarningBackgroundColor ='#0000FF' +$psISE.Options.WarningBackgroundColor = '#0000FF' ``` ### WarningForegroundColor - Supported in Windows PowerShell ISE 2.0 and later. - Specifies the foreground color for warning text that appears in the Output pane. It is a **System.Windows.Media.Color** object. +Supported in Windows PowerShell ISE 2.0 and later. -``` +Specifies the foreground color for warning text that appears in the Output pane. It is a **System.Windows.Media.Color** object. + +```powershell # Changes the foreground color for warning text to yellow. -$psISE.Options.WarningForegroundColor ='yellow' +$psISE.Options.WarningForegroundColor = 'yellow' ``` ### XmlTokenColors - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - Specifies a dictionary object that contains name/value pairs of token types and colors for XML content that is displayed in Windows PowerShell ISE. Token colors can be set for the following: Attribute, Command, CommandArgument, CommandParameter, Comment, GroupEnd, GroupStart, Keyword, LineContinuation, LoopLabel, Member, NewLine, Number, Operator, Position, StatementSeparator, String, Type, Unknown, Variable. Also see [RestoreDefaultXmlTokenColors](#restoredefaultxmltokencolors). +Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. -``` +Specifies a dictionary object that contains name/value pairs of token types and colors for XML content that is displayed in Windows PowerShell ISE. Token colors can be set for the following: Attribute, Command, CommandArgument, CommandParameter, Comment, GroupEnd, GroupStart, Keyword, LineContinuation, LoopLabel, Member, NewLine, Number, Operator, Position, StatementSeparator, String, Type, Unknown, Variable. Also see [RestoreDefaultXmlTokenColors](#restoredefaultxmltokencolors). + +```powershell # Sets the color of XML element names to green. -$psISE.Options.XmlTokenColors["ElementName"] = "green" +$psISE.Options.XmlTokenColors["ElementName"] = 'green' # Sets the color of XML comments to magenta. -$psISE.Options.XmlTokenColors["Comment"] = "magenta" - +$psISE.Options.XmlTokenColors["Comment"] = 'magenta' ``` ### Zoom - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - Specifies the relative size of text in both the Console and Script panes. The default value is 100. Smaller values cause the text in Windows PowerShell ISE to appear smaller while larger numbers cause text to appear larger. The value is an integer that ranges from 20 to 400. +Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. -``` +Specifies the relative size of text in both the Console and Script panes. The default value is 100. Smaller values cause the text in Windows PowerShell ISE to appear smaller while larger numbers cause text to appear larger. The value is an integer that ranges from 20 to 400. + +```powershell # Changes the text in the Windows PowerShell ISE to be double its normal size. $psISE.Options.Zoom = 200 ``` ## See Also -- [The Windows PowerShell ISE Scripting Object Model](The-Windows-PowerShell-ISE-Scripting-Object-Model.md) -- [Windows PowerShell ISE Object Model Reference](Windows-PowerShell-ISE-Object-Model-Reference.md) +- [Purpose of the Windows PowerShell ISE Scripting Object Model](Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md) +- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) \ No newline at end of file diff --git a/reference/docs-conceptual/core-powershell/ise/The-ISESnippetCollection-Object.md b/reference/docs-conceptual/core-powershell/ise/The-ISESnippetCollection-Object.md index bd3585eaeb21..7b7b401c9485 100644 --- a/reference/docs-conceptual/core-powershell/ise/The-ISESnippetCollection-Object.md +++ b/reference/docs-conceptual/core-powershell/ise/The-ISESnippetCollection-Object.md @@ -4,30 +4,28 @@ keywords: powershell,cmdlet title: The ISESnippetCollection Object ms.assetid: ae974955-4282-4cbc-8c42-0fff1904ef32 --- - # The ISESnippetCollection Object - The **ISESnippetCollection** object is a collection of **ISESnippet** objects. The files collection that is associated with a **PowerShellTab** object is a member of this class. An example is the **$psISE.CurrentPowerShellTab.Files** collection. + +The **ISESnippetCollection** object is a collection of **ISESnippet** objects. The files collection that is associated with a **PowerShellTab** object is a member of this class. An example is the **$psISE.CurrentPowerShellTab.Files** collection. ## Methods ### Load\( FilePathName \) - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - Loads a .snippets.ps1xml file that contains user-defined snippets. The easiest way to create snippets is to use the New-IseSnippet cmdlet, which automatically stores them in your profile folder so that they are loaded every time that you start Windows PowerShell ISE. +Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - **FilePathName** - String - The path and file name to a .snippets.ps1xml file that contains snippet definitions. +Loads a .snippets.ps1xml file that contains user-defined snippets. The easiest way to create snippets is to use the New-IseSnippet cmdlet, which automatically stores them in your profile folder so that they are loaded every time that you start Windows PowerShell ISE. -``` -# Loads a custom snippet file into the current PowerShell tab. -$SnipFile = Join-Path ( Split-Path $profile) “Snippets\MySnips.snippets.ps1xml” $psISE.CurrentPowerShellTab.Snippets.Add($SnipPath) +**FilePathName** - String +The path and file name to a .snippets.ps1xml file that contains snippet definitions. +```powershell +# Loads a custom snippet file into the current PowerShell tab. +$SnipFile = Join-Path ( Split-Path $profile) 'Snippets\MySnips.snippets.ps1xml' $psISE.CurrentPowerShellTab.Snippets.Add($SnipPath) ``` ## See Also -- [The ISESnippetObject](The-ISESnippetObject.md) -- [The Windows PowerShell ISE Scripting Object Model](The-Windows-PowerShell-ISE-Scripting-Object-Model.md) -- [Windows PowerShell ISE Object Model Reference](Windows-PowerShell-ISE-Object-Model-Reference.md) -- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) - +- [The ISESnippetObject](The-ISESnippetObject.md) +- [Purpose of the Windows PowerShell ISE Scripting Object Model](Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md) +- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) \ No newline at end of file diff --git a/reference/docs-conceptual/core-powershell/ise/The-ISESnippetObject.md b/reference/docs-conceptual/core-powershell/ise/The-ISESnippetObject.md index bf4de9a3718e..98457bbd2e56 100644 --- a/reference/docs-conceptual/core-powershell/ise/The-ISESnippetObject.md +++ b/reference/docs-conceptual/core-powershell/ise/The-ISESnippetObject.md @@ -11,7 +11,7 @@ ms.assetid: 98bc8113-c3cd-4201-bdb9-9d9bdb7e266c ## Properties ### Author - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. + Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. The read-only property that gets the name of the author of the snippet. @@ -22,7 +22,7 @@ $psISE.CurrentPowerShellTab.Snippets.Item(0).Author ``` ### CodeFragment - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. + Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. The read-only property that gets the code fragment to be inserted into the editor. @@ -33,7 +33,7 @@ $psISE.CurrentPowerShellTab.Snippets.Item(0).CodeFragment ``` ### Shortcut - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. + Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. The read-only property that gets the Windows keyboard shortcut for the menu item. @@ -45,9 +45,6 @@ $psISE.CurrentPowerShellTab.AddOnsMenu.Submenus[0].Shortcut ``` ## See Also -- [The ISESnippetCollection Object](The-ISESnippetCollection-Object.md) -- [The Windows PowerShell ISE Scripting Object Model](The-Windows-PowerShell-ISE-Scripting-Object-Model.md) -- [Windows PowerShell ISE Object Model Reference](Windows-PowerShell-ISE-Object-Model-Reference.md) +- [The ISESnippetCollection Object](The-ISESnippetCollection-Object.md) +- [Purpose of the Windows PowerShell ISE Scripting Object Model](purpose-of-the-windows-powershell-ise-scripting-object-model.md) - [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) - - diff --git a/reference/docs-conceptual/core-powershell/ise/The-ObjectModelRoot-Object.md b/reference/docs-conceptual/core-powershell/ise/The-ObjectModelRoot-Object.md index 67a07d7444b4..ff58c348ae09 100644 --- a/reference/docs-conceptual/core-powershell/ise/The-ObjectModelRoot-Object.md +++ b/reference/docs-conceptual/core-powershell/ise/The-ObjectModelRoot-Object.md @@ -3,11 +3,10 @@ ms.date: 2017-08-25 keywords: powershell,cmdlet title: The ObjectModelRoot Object --- - # The ObjectModelRoot Object The **$psISE** object, which is the principal root object in -Windows PowerShell® Integrated Scripting Environment (ISE) +Windows PowerShell® Integrated Scripting Environment (ISE) is an instance of the Microsoft.PowerShell.Host.ISE.ObjectModelRoot class. This topic describes the properties of the **ObjectModelRoot** object. @@ -15,7 +14,7 @@ This topic describes the properties of the **ObjectModelRoot** object. ### CurrentFile -> Supported in Windows PowerShell ISE 2.0 and later. +> Supported in Windows PowerShell ISE 2.0 and later. The read-only property that gets the file, which is associated with this host object that currently has the focus. @@ -29,30 +28,29 @@ The read-only property that gets the PowerShell tab that has the focus. > Supported in Windows PowerShell ISE 2.0 and later. -The read-only property that gets the currently visible -Windows PowerShell ISE add-on tool that is located in +The read-only property that gets the currently visible +Windows PowerShell ISE add-on tool that is located in the horizontal tool pane at the bottom of the editor. ### CurrentVisibleVerticalTool -> Supported in Windows PowerShell ISE 2.0 and later. +> Supported in Windows PowerShell ISE 2.0 and later. The read-only property that gets the currently visible Windows PowerShell ISE add-on tool that is located in the vertical tool pane on the right side of the editor. ### Options -> Supported in Windows PowerShell ISE 2.0 and later. +> Supported in Windows PowerShell ISE 2.0 and later. The read-only property that gets the various options that can change settings in Windows PowerShell ISE. ### PowerShellTabs -> Supported in Windows PowerShell ISE 2.0 and later. +> Supported in Windows PowerShell ISE 2.0 and later. The read-only property that gets the collection of the PowerShell tabs, which are open in Windows PowerShell ISE. By default, this object contains one PowerShell tab. However, you can add more PowerShell tabs to this object by using scripts or by using the menus in Windows PowerShell ISE. ## See Also -- [The Windows PowerShell ISE Scripting Object Model](The-Windows-PowerShell-ISE-Scripting-Object-Model.md) -- [Windows PowerShell ISE Object Model Reference](Windows-PowerShell-ISE-Object-Model-Reference.md) -- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) +- [Purpose of the Windows PowerShell ISE Scripting Object Model](Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md) +- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) \ No newline at end of file diff --git a/reference/docs-conceptual/core-powershell/ise/The-PowerShellTab-Object.md b/reference/docs-conceptual/core-powershell/ise/The-PowerShellTab-Object.md index f4b6d386b491..3ba19c911dff 100644 --- a/reference/docs-conceptual/core-powershell/ise/The-PowerShellTab-Object.md +++ b/reference/docs-conceptual/core-powershell/ise/The-PowerShellTab-Object.md @@ -4,218 +4,226 @@ keywords: powershell,cmdlet title: The PowerShellTab Object ms.assetid: a9b58556-951b-4f48-b3ae-b351b7564360 --- - # The PowerShellTab Object - The **PowerShellTab** object represents a Windows PowerShell runtime environment. + +The **PowerShellTab** object represents a Windows PowerShell runtime environment. ## Methods ### Invoke\( Script \) - Supported in Windows PowerShell ISE 2.0 and later. - Runs the given script in the PowerShell tab. +Supported in Windows PowerShell ISE 2.0 and later. + +Runs the given script in the PowerShell tab. > [!NOTE] > This method only works on other PowerShell tabs, not the PowerShell tab from which it is run. It does not return any object or value. If the code modifies any variable, then those changes persist on the tab against which the command was invoked. - **Script** - System.Management.Automation.ScriptBlock or String - The script block to run. +**Script** - System.Management.Automation.ScriptBlock or String +The script block to run. -``` +```powershell # Manually create a second PowerShell tab before running this script. # Return to the first PowerShell tab and type the following command -$psise.PowerShellTabs[1].Invoke({dir}) +$psISE.PowerShellTabs[1].Invoke({dir}) ``` ### InvokeSynchronous\( Script, \[useNewScope\], millisecondsTimeout \) - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - Runs the given script in the PowerShell tab. +Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. + +Runs the given script in the PowerShell tab. > [!NOTE] > This method only works on other PowerShell tabs, not the PowerShell tab from which it is run. The script block is run and any value that is returned from the script is returned to the run environment from which you invoked the command. If the command takes longer to run than the **millesecondsTimeout** value specifies, then the command fails with an exception: "The operation has timed out." - **Script** - System.Management.Automation.ScriptBlock or String - The script block to run. +**Script** - System.Management.Automation.ScriptBlock or String +The script block to run. - **\[useNewScope\]** - Optional Boolean that defaults to **$true** - If set to **$true**, then a new scope is created within which to run the command. It does not modify the runtime environment of the PowerShell tab that is specified by the command. +**\[useNewScope\]** - Optional Boolean that defaults to **$true** +If set to **$true**, then a new scope is created within which to run the command. It does not modify the runtime environment of the PowerShell tab that is specified by the command. - **\[millisecondsTimeout\]** - Optional integer that defaults to **500**. - If the command does not finish within the specified time, then the command generates a **TimeoutException** with the message "The operation has timed out." +**\[millisecondsTimeout\]** - Optional integer that defaults to **500**. +If the command does not finish within the specified time, then the command generates a **TimeoutException** with the message "The operation has timed out." -``` -# create a new PowerShell tab and then switch back to the first -$PSise.PowerShellTabs.Add() -$psISE.PowerShellTabs.SetSelectedPowerShellTab($psISE.PowerShellTabs[0]) +```powershell +# Create a new PowerShell tab and then switch back to the first +$psISE.PowerShellTabs.Add() +$psISE.PowerShellTabs.SetSelectedPowerShellTab($psISE.PowerShellTabs[0]) # Invoke a simple command on the other tab, in its own scope -$psISE.PowerShellTabs[1].InvokeSynchronous('$x=1',$false) -# You can switch to the other tab and type 'œ$x' to see that the value is saved there. +$psISE.PowerShellTabs[1].InvokeSynchronous('$x=1', $false) +# You can switch to the other tab and type '$x' to see that the value is saved there. -# This example sets a value in the other tab (in a different scope) +# This example sets a value in the other tab (in a different scope) # and returns it through the pipeline to this tab to store in $a -$a=$psISE.PowerShellTabs[1].InvokeSynchronous('$z=3;$z') +$a = $psISE.PowerShellTabs[1].InvokeSynchronous('$z=3;$z') $a # This example runs a command that takes longer than the allowed timeout value # and measures how long it runs so that you can see the impact -measure-command {$psISE.PowerShellTabs[1].InvokeSynchronous("sleep 10",$false,5000)} - +Measure-Command {$psISE.PowerShellTabs[1].InvokeSynchronous('sleep 10', $false, 5000)} ``` ## Properties ### AddOnsMenu - Supported in Windows PowerShell ISE 2.0 and later. - The read-only property that gets the Add-ons menu for the PowerShell tab. +Supported in Windows PowerShell ISE 2.0 and later. -``` +The read-only property that gets the Add-ons menu for the PowerShell tab. + +```powershell # Clear the Add-ons menu if one exists. $psISE.CurrentPowerShellTab.AddOnsMenu.SubMenus.Clear() # Create an AddOns menu with an accessor. # Note the use of "_" as opposed to the "&" for mapping to the fast key letter for the menu item. -$menuAdded = $psISE.CurrentPowerShellTab.AddOnsMenu.SubMenus.Add("_Process",{get-process},"Alt+P") -# Add a nested menu. -$parentAdded = $psISE.CurrentPowerShellTab.AddOnsMenu.SubMenus.Add("Parent",$null,$null) -$parentAdded.SubMenus.Add("_Dir",{dir},"Alt+D") +$menuAdded = $psISE.CurrentPowerShellTab.AddOnsMenu.SubMenus.Add('_Process', {Get-Process}, 'Alt+P') +# Add a nested menu. +$parentAdded = $psISE.CurrentPowerShellTab.AddOnsMenu.SubMenus.Add('Parent', $null, $null) +$parentAdded.SubMenus.Add('_Dir', {dir}, 'Alt+D') # Show the Add-ons menu on the current PowerShell tab. $psISE.CurrentPowerShellTab.AddOnsMenu ``` ### CanInvoke - Supported in Windows PowerShell ISE 2.0 and later. - The read-only Boolean property that returns a **$true** value if a script can be invoked with the [Invoke( Script )](#invoke-script-) method. +Supported in Windows PowerShell ISE 2.0 and later. -``` +The read-only Boolean property that returns a **$true** value if a script can be invoked with the [Invoke( Script )](#invoke-script-) method. + +```powershell # CanInvoke will be false if the PowerShell # tab is running a script that takes a while, and you # check its properties from another PowerShell tab. It is -# always false if checked on the current PowerShell tab. +# always false if checked on the current PowerShell tab. # Manually create a second PowerShell tab before running this script. # Return to the first tab and type -$secondTab = $psise.PowerShellTabs[1] -$secondTab.CanInvoke +$secondTab = $psISE.PowerShellTabs[1] +$secondTab.CanInvoke $secondTab.Invoke({sleep 20}) $secondTab.CanInvoke - ``` ### Consolepane - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. In Windows PowerShell ISE 2.0 this was named **CommandPane**. - The read-only property that gets the Console pane [editor](../ise/The-ISEEditor-Object.md) object. +Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. In Windows PowerShell ISE 2.0 this was named **CommandPane**. -``` +The read-only property that gets the Console pane [editor](../ise/The-ISEEditor-Object.md) object. + +```powershell # Gets the Console Pane editor. $psISE.CurrentPowerShellTab.ConsolePane - ``` ### DisplayName - Supported in Windows PowerShell ISE 2.0 and later. - The read-write property that gets or sets the text that is displayed on the PowerShell tab. By default, tabs are named "PowerShell #", where the # represents a number. +Supported in Windows PowerShell ISE 2.0 and later. -``` -$newTab = $psise.PowerShellTabs.Add() -# Change the DisplayName of the new PowerShell tab. -$newTab.DisplayName="Brand New Tab" +The read-write property that gets or sets the text that is displayed on the PowerShell tab. By default, tabs are named "PowerShell #", where the # represents a number. + +```powershell +$newTab = $psISE.PowerShellTabs.Add() +# Change the DisplayName of the new PowerShell tab. +$newTab.DisplayName = 'Brand New Tab' ``` ### ExpandedScript - Supported in Windows PowerShell ISE 2.0 and later. - The read-write Boolean property that determines whether the Script pane is expanded or hidden. +Supported in Windows PowerShell ISE 2.0 and later. -``` -# Toggle the expanded script property to see its effect. -$PSise.CurrentPowerShellTab.ExpandedScript=!$PSise.CurrentPowerShellTab.ExpandedScript +The read-write Boolean property that determines whether the Script pane is expanded or hidden. +```powershell +# Toggle the expanded script property to see its effect. +$psISE.CurrentPowerShellTab.ExpandedScript = !$psISE.CurrentPowerShellTab.ExpandedScript ``` ### Files - Supported in Windows PowerShell ISE 2.0 and later. - The read-only property that gets the [collection of script files](../ise/The-ISEFileCollection-Object.md) that are open in the PowerShell tab. +Supported in Windows PowerShell ISE 2.0 and later. -``` +The read-only property that gets the [collection of script files](../ise/The-ISEFileCollection-Object.md) that are open in the PowerShell tab. + +```powershell $newFile = $psISE.CurrentPowerShellTab.Files.Add() -$newFile.Editor.Text = "a`r`nb" +$newFile.Editor.Text = "a`r`nb" # Gets the line count $newFile.Editor.LineCount ``` ### Output - This feature is present in Windows PowerShell ISE 2.0, but was removed or renamed in later versions of the ISE. In later versions of Windows PowerShell ISE, you can use the **ConsolePane** object for the same purposes. - The read-only property that gets the Output pane of the current [editor](../ise/The-ISEEditor-Object.md). +This feature is present in Windows PowerShell ISE 2.0, but was removed or renamed in later versions of the ISE. In later versions of Windows PowerShell ISE, you can use the **ConsolePane** object for the same purposes. -``` +The read-only property that gets the Output pane of the current [editor](../ise/The-ISEEditor-Object.md). + +```powershell # Clears the text in the Output pane. -$psise.CurrentPowerShellTab.output.clear() +$psISE.CurrentPowerShellTab.output.clear() ``` ### Prompt - Supported in Windows PowerShell ISE 2.0 and later. - The read-only property that gets the current prompt text. Note: the **Prompt** function can be overridden by the user'™s profile. If the result is other than a simple string, then this property returns nothing. +Supported in Windows PowerShell ISE 2.0 and later. -``` +The read-only property that gets the current prompt text. Note: the **Prompt** function can be overridden by the user'™s profile. If the result is other than a simple string, then this property returns nothing. + +```powershell # Gets the current prompt text. $psISE.CurrentPowerShellTab.Prompt ``` ### ShowCommands - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - The read-write property that indicates if the Commands pane is currently displayed. +Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. -``` +The read-write property that indicates if the Commands pane is currently displayed. + +```powershell # Gets the current status of the Commands pane and stores it in the $a variable $a = $psISE.CurrentPowerShellTab.ShowCommands -# if $a is $false, then turn the Commands pane on by changing the value to $True -if (!$a) {$psISE.CurrentPowerShellTab.ShowCommands=$True} +# if $a is $false, then turn the Commands pane on by changing the value to $true +if (!$a) {$psISE.CurrentPowerShellTab.ShowCommands = $true} ``` ### StatusText - Supported in Windows PowerShell ISE 2.0 and later. - The read-only property that gets the **PowerShellTab** status text. +Supported in Windows PowerShell ISE 2.0 and later. -``` +The read-only property that gets the **PowerShellTab** status text. + +```powershell # Gets the current status text, $psISE.CurrentPowerShellTab.StatusText ``` ### HorizontalAddOnToolsPaneOpened - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - The read-only property that indicates whether the horizontal Add-Ons tool pane is currently open. +Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. -``` -# Gets the current state of the horizontal Add-ons tool pane. +The read-only property that indicates whether the horizontal Add-Ons tool pane is currently open. + +```powershell +# Gets the current state of the horizontal Add-ons tool pane. $psISE.CurrentPowerShellTab.HorizontalAddOnToolsPaneOpened ``` ### VerticalAddOnToolsPaneOpened - Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. - The read-only property that indicates whether the vertical Add-Ons tool pane is currently open. +Supported in Windows PowerShell ISE 3.0 and later, and not present in earlier versions. -``` +The read-only property that indicates whether the vertical Add-Ons tool pane is currently open. + +```powershell # Turns on the Commands pane -$psISE.CurrentPowerShellTab.ShowCommands=$True -# Gets the current state of the vertical Add-ons tool pane. +$psISE.CurrentPowerShellTab.ShowCommands = $true +# Gets the current state of the vertical Add-ons tool pane. $psISE.CurrentPowerShellTab.HorizontalAddOnToolsPaneOpened ``` ## See Also -- [The PowerShellTabCollection Object](The-PowerShellTabCollection-Object.md) -- [The Windows PowerShell ISE Scripting Object Model](../ise/The-Windows-PowerShell-ISE-Scripting-Object-Model.md) -- [Windows PowerShell ISE Object Model Reference](../ise/Windows-PowerShell-ISE-Object-Model-Reference.md) -- [The ISE Object Model Hierarchy](../ise/The-ISE-Object-Model-Hierarchy.md) - +- [The PowerShellTabCollection Object](The-PowerShellTabCollection-Object.md) +- [Purpose of the Windows PowerShell ISE Scripting Object Model](Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md) +- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) \ No newline at end of file diff --git a/reference/docs-conceptual/core-powershell/ise/The-PowerShellTabCollection-Object.md b/reference/docs-conceptual/core-powershell/ise/The-PowerShellTabCollection-Object.md index 3a7fadd415b2..cbdc7b0b4edd 100644 --- a/reference/docs-conceptual/core-powershell/ise/The-PowerShellTabCollection-Object.md +++ b/reference/docs-conceptual/core-powershell/ise/The-PowerShellTabCollection-Object.md @@ -4,62 +4,62 @@ keywords: powershell,cmdlet title: The PowerShellTabCollection Object ms.assetid: 81f4bf4a-83bf-415e-8378-1703792fbb58 --- - # The PowerShellTabCollection Object - The **PowerShellTab** collection object is a collection of **PowerShellTab** objects. Each **PowerShellTab** object functions as a separate runtime environment. It is an instance of Microsoft.PowerShell.Host.ISE.PowerShellTabs class. An example is the **$psISE.PowerShellTabs** object. + +The **PowerShellTab** collection object is a collection of **PowerShellTab** objects. Each **PowerShellTab** object functions as a separate runtime environment. It is an instance of Microsoft.PowerShell.Host.ISE.PowerShellTabs class. An example is the **$psISE.PowerShellTabs** object. ## Methods ### Add\(\) - Supported in Windows PowerShell ISE 2.0 and later. - Adds a new PowerShell tab to the collection. It returns the newly added tab. +Supported in Windows PowerShell ISE 2.0 and later. -``` -$NewTab=$psISE.PowerShellTabs.Add() -$newTab.DisplayName="Brand New Tab" +Adds a new PowerShell tab to the collection. It returns the newly added tab. + +```powershell +$newTab = $psISE.PowerShellTabs.Add() +$newTab.DisplayName = 'Brand New Tab' ``` ### Remove\(Microsoft.PowerShell.Host.ISE.PowerShellTab psTab\) - Supported in Windows PowerShell ISE 2.0 and later. - Removes the tab that is specified by the **psTab** parameter. +Supported in Windows PowerShell ISE 2.0 and later. - **psTab** - The PowerShell tab to remove. +Removes the tab that is specified by the **psTab** parameter. -``` +**psTab** +The PowerShell tab to remove. +```powershell $newTab = $psISE.PowerShellTabs.Add() -Change the DisplayName of the new PowerShell tab. -$newTab.DisplayName="This tab will go away in 5 seconds" -sleep 5 +Change the DisplayName of the new PowerShell tab. +$newTab.DisplayName = 'This tab will go away in 5 seconds' +sleep 5 $psISE.PowerShellTabs.Remove($newTab) ``` ### SetSelectedPowerShellTab\(Microsoft.PowerShell.Host.ISE.PowerShellTab psTab\) - Supported in Windows PowerShell ISE 2.0 and later. - Selects the PowerShell tab that is specified by the **psTab** parameter to make it the currently active PowerShell tab. +Supported in Windows PowerShell ISE 2.0 and later. - **psTab** - The PowerShell tab to select. +Selects the PowerShell tab that is specified by the **psTab** parameter to make it the currently active PowerShell tab. -``` +**psTab** +The PowerShell tab to select. + +```powershell # Save the current tab in a variable and rename it -$OldTab = $psISE.CurrentPowerShellTab -$psISE.CurrentPowerShellTab.DisplayName="Old Tab" +$oldTab = $psISE.CurrentPowerShellTab +$psISE.CurrentPowerShellTab.DisplayName = 'Old Tab' # Create a new tab and give it a new display name $newTab = $psISE.PowerShellTabs.Add() -$newTab.DisplayName="Brand New Tab" +$newTab.DisplayName = 'Brand New Tab' # Switch back to the original tab -$psISE.PowerShellTabs.SelectedPowerShellTab=$oldtab +$psISE.PowerShellTabs.SelectedPowerShellTab = $oldTab ``` ## See Also -- [The PowerShellTab Object](The-PowerShellTab-Object.md) -- [The Windows PowerShell ISE Scripting Object Model](../ise/The-Windows-PowerShell-ISE-Scripting-Object-Model.md) -- [Windows PowerShell ISE Object Model Reference](../ise/Windows-PowerShell-ISE-Object-Model-Reference.md) -- [The ISE Object Model Hierarchy](../ise/The-ISE-Object-Model-Hierarchy.md) - +- [The PowerShellTab Object](The-PowerShellTab-Object.md) +- [Purpose of the Windows PowerShell ISE Scripting Object Model](Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md) +- [The ISE Object Model Hierarchy](The-ISE-Object-Model-Hierarchy.md) \ No newline at end of file diff --git a/reference/docs-conceptual/getting-started/Getting-Ready-to-Use-Windows-PowerShell.md b/reference/docs-conceptual/getting-started/Getting-Ready-to-Use-Windows-PowerShell.md index eea303da14d5..f243fcf9a7da 100644 --- a/reference/docs-conceptual/getting-started/Getting-Ready-to-Use-Windows-PowerShell.md +++ b/reference/docs-conceptual/getting-started/Getting-Ready-to-Use-Windows-PowerShell.md @@ -8,7 +8,7 @@ ms.assetid: 6dc7052d-cc5a-4220-950f-98f963a2b587 # Getting Ready to Use Windows PowerShell When Windows PowerShell is installed and started, consider the following setup options. You can perform these tasks at any time. -- **Install help files.** The cmdlets that are included in Windows PowerShell 3.0 do not come with help files. However, you can use the [Update-Help](/powershell/module/microsoft.powershell.core/update-help) cmdlet to download and install the newest help files on your computer. When the files are installed, you can use the [Get-Help](/powershell/module/microsoft.powershell.core/get-help) cmdlet to display them right at the command line. For more information, see [about_Updatable_Help](/powershell/module/microsoft.powershell.core/about/about_execution_policies). +- **Install help files.** The cmdlets that are included in Windows PowerShell 3.0 do not come with help files. However, you can use the [Update-Help](/powershell/module/microsoft.powershell.core/update-help) cmdlet to download and install the newest help files on your computer. When the files are installed, you can use the [Get-Help](/powershell/module/microsoft.powershell.core/get-help) cmdlet to display them right at the command line. For more information, see [about_Updatable_Help](/powershell/module/microsoft.powershell.core/about/about_updatable_help). If you decide not to install the help files, you can still read the help topics online. To find the online version of any cmdlet help topic, type: `Get-Help -Online`. To browse the Windows PowerShell help topics see the [PowerShell documentation](/powershell/scripting). diff --git a/reference/docs-conceptual/getting-started/cookbooks/Other-Useful-Scripting-Objects.md b/reference/docs-conceptual/getting-started/cookbooks/Other-Useful-Scripting-Objects.md index f25f63ac3aed..e7b194358ed5 100644 --- a/reference/docs-conceptual/getting-started/cookbooks/Other-Useful-Scripting-Objects.md +++ b/reference/docs-conceptual/getting-started/cookbooks/Other-Useful-Scripting-Objects.md @@ -4,32 +4,32 @@ keywords: powershell,cmdlet title: Other Useful Scripting Objects ms.assetid: 4d781196-720b-4ccc-90d2-c570e5e719f5 --- - # Other Useful Scripting Objects - The following objects provide additional scripting functionality in Windows PowerShell ISE. They are not part of the **$psISE** hierarchy. + +The following objects provide additional scripting functionality in Windows PowerShell ISE. They are not part of the **$psISE** hierarchy. ## Useful Scripting objects ### $psUnsupportedConsoleApplications - There are some limitations on how Windows PowerShell ISE interacts with console applications. A command or an automation script that requires user intervention might not work the way it works from the Windows PowerShell console. You might want to block these commands or scripts from running in the Windows PowerShell ISE Command pane. The **$psUnsupportedConsoleApplications** object keeps a list of such commands. If you try to run the commands in this list, you get a message that they are not supported. The following script adds an entry to the list. -``` +There are some limitations on how Windows PowerShell ISE interacts with console applications. A command or an automation script that requires user intervention might not work the way it works from the Windows PowerShell console. You might want to block these commands or scripts from running in the Windows PowerShell ISE Command pane. The **$psUnsupportedConsoleApplications** object keeps a list of such commands. If you try to run the commands in this list, you get a message that they are not supported. The following script adds an entry to the list. + +```powershell # List the unsupported commands -psUnsupportedConsoleApplications +$psUnsupportedConsoleApplications # Add a command to this list -psUnsupportedConsoleApplications.Add(“Mycommand”) -#Show the augmented list of commands -psUnsupportedConsoleApplications - +$psUnsupportedConsoleApplications.Add('Mycommand') +# Show the augmented list of commands +$psUnsupportedConsoleApplications ``` ### $psLocalHelp - This is a dictionary object that maintains a context-sensitive mapping between Help topics and their associated links in the local compiled HTML Help file. It is used to locate the local Help for a particular topic. You can add or delete topics from this list. The following code example shows some example key-value pairs that are contained in **$psLocalHelp**. -``` +This is a dictionary object that maintains a context-sensitive mapping between Help topics and their associated links in the local compiled HTML Help file. It is used to locate the local Help for a particular topic. You can add or delete topics from this list. The following code example shows some example key-value pairs that are contained in **$psLocalHelp**. + +```powershell # See the local help map $psLocalHelp | Format-List - ``` ### Sample Output @@ -39,18 +39,18 @@ $psLocalHelp | Format-List |Key : Add-Computer|Value : WindowsPowerShellHelp.chm::/html/093f660c-b8d5-43cf-aa0c-54e5e54e76f9.htm| |Key : Add-Content|Value : WindowsPowerShellHelp.chm::/html/0c836a1b-f389-4e9a-9325-0f415686d194.htm| - The following script adds an entry to the list. +The following script adds an entry to the list. -``` -$psLocalHelp.Add("get-myNoun","c:\MyFolder\MyHelpChm.chm::/html/0198854a-1298-57ae-aa0c-87b5e5a84712.htm") +```powershell +$psLocalHelp.Add("get-myNoun", "c:\MyFolder\MyHelpChm.chm::/html/0198854a-1298-57ae-aa0c-87b5e5a84712.htm") ``` ### $psOnlineHelp - This is a dictionary object that maintains a context-sensitive mapping between topic titles of Help topics and their associated external URLs. It is used to locate the Help for a particular topic on the web. You can add or delete topics from this list. -``` -$psOnlineHelp | Format-List +This is a dictionary object that maintains a context-sensitive mapping between topic titles of Help topics and their associated external URLs. It is used to locate the Help for a particular topic on the web. You can add or delete topics from this list. +```powershell +$psOnlineHelp | Format-List ``` ### Sample Output @@ -62,11 +62,10 @@ $psOnlineHelp | Format-List The following script adds an entry to the list. -``` -$psOnlineHelp.Add("get-myNoun","http://www.mydomain.com/MyNoun.html") +```powershell +$psOnlineHelp.Add("get-myNoun", "http://www.mydomain.com/MyNoun.html") ``` ## See Also -- [The Windows PowerShell ISE Scripting Object Model](../../core-powershell/ise/The-Windows-PowerShell-ISE-Scripting-Object-Model.md) - +- [Purpose of the Windows PowerShell ISE Scripting Object Model](../../core-powershell/ise/Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md) \ No newline at end of file diff --git a/reference/docs-conceptual/getting-started/fundamental/Exploring-the-Windows-PowerShell-ISE.md b/reference/docs-conceptual/getting-started/fundamental/Exploring-the-Windows-PowerShell-ISE.md index ec303e02f65e..29cd98a0187a 100644 --- a/reference/docs-conceptual/getting-started/fundamental/Exploring-the-Windows-PowerShell-ISE.md +++ b/reference/docs-conceptual/getting-started/fundamental/Exploring-the-Windows-PowerShell-ISE.md @@ -4,23 +4,26 @@ keywords: powershell,cmdlet title: Exploring the Windows PowerShell ISE ms.assetid: e0d2c6e8-5126-40e7-a1e1-d1cff29fe94a --- - # Exploring the Windows PowerShell ISE + You can use the Windows PowerShell® Integrated Scripting Environment (ISE) to create, run, and debug commands and scripts. The Windows PowerShell ISE consists of the menu bar, Windows PowerShell tabs, the toolbar, script tabs, a Script Pane, a Console Pane, a status bar, a text-size slider and context-sensitive Help. > [!NOTE] > Beginning with Windows PowerShell ISE 3.0 the Command and Output Panes were combined into a single Console Pane. ## Menu Bar -The menu bar contains the **File**, **Edit**, **View**, **Tools**, **Debug**, **Add-ons**, and **Help** menus. The buttons on the menus allow you to perform tasks related to writing and running scripts and running commands in the Windows PowerShell ISE. Additionally, an [add-on tool](../../core-powershell/ise/The-ISEAddOnTool-Object.md) may be placed on the menu bar by running scripts that use the [Windows PowerShell ISE Scripting Object Model](../../core-powershell/ise/The-Windows-PowerShell-ISE-Scripting-Object-Model.md). + +The menu bar contains the **File**, **Edit**, **View**, **Tools**, **Debug**, **Add-ons**, and **Help** menus. The buttons on the menus allow you to perform tasks related to writing and running scripts and running commands in the Windows PowerShell ISE. Additionally, an [add-on tool](../../core-powershell/ise/The-ISEAddOnTool-Object.md) may be placed on the menu bar by running scripts that use the [The ISE Object Model Hierarchy](../../core-powershell/ise/The-ISE-Object-Model-Hierarchy.md). > [!NOTE] > In Windows PowerShell ISE 2.0, The **Tools** and **Add-ons** menus were not present. ## Windows PowerShell Tabs + A Windows PowerShell tab is the environment in which a Windows PowerShell script runs. You can open new Windows PowerShell tabs in the Windows PowerShell ISE to create separate environments on your local computer or on remote computers. You may have a maximum of eight PowerShell tabs simultaneously open. ## Toolbar + The following buttons are located on the toolbar. |Button|Function| @@ -35,7 +38,7 @@ The following buttons are located on the toolbar. |**Undo**|Reverses the action that was just performed.| |**Redo**|Performs the action that was just undone.| |**Run Script**|Runs a script.| -|**Run Selction**|Runs a selected portion of a script.| +|**Run Selection**|Runs a selected portion of a script.| |**Stop Execution**|Stops a script that is running.| |**New Remote PowerShell Tab**|Creates a new PowerShell Tab that establishes a session on a remote computer. A dialog box appears and prompts you to enter details required to establish the remote connection.| |**Start PowerShell.exe**|Opens a PowerShell Console.| @@ -44,28 +47,35 @@ The following buttons are located on the toolbar. |**Show Script Pane Maximized**|Maximizes the Script Pane.| ## Script Tab + Displays the name of the script you are editing. You can click a script tab to select the script you want to edit. When you point to the script tab, the fully qualified path to the script file appears in a tooltip. ## Script Pane + Allows you to create and run scripts. You can open, edit and run existing scripts in the Script Pane. ## Output Pane + Displays the results of the commands and scripts you have run. You can also copy and clear the contents in the Output Pane. ## Command Pane + Allows you to write commands. You can run a one line command or a multiline command in the Command Pane. Press SHIFT+ENTER to enter each line of a multiline command, and press ENTER after the last line to execute the multiline command. The prompt displayed on top of the Command Pane shows the path to the current working directory. ## Status Bar + Allows you to see whether the commands and scripts that you run are complete. The status bar is at the very bottom of the display. Selected portions of error messages are displayed on the status bar. ## Text-Size Slider + Increases or decreases the size of the text on the screen. ## Help + Help for Windows PowerShell ISE is available on the Web in the TechNet Library. You can open the Help by clicking **Windows PowerShell ISE Help** on the **Help** menu or by pressing the F1 key anywhere except when the cursor is on a cmdlet name in either the Script Pane or the Console Pane. From the **Help** menu you can also run the Update-Help cmdlet, and display the Command Window which assists you in constructing commands by showing you all of the parameters for a cmdlet and enabling you to fill in the parameters in an easy-to-use form. ## See Also -- [Using the Windows PowerShell ISE](../../core-powershell/ise/Using-the-Windows-PowerShell-ISE.md) +- [Introducing the Windows PowerShell ISE](../../core-powershell/ise/Introducing-the-Windows-PowerShell-ISE.md) \ No newline at end of file diff --git a/reference/docs-conceptual/setup/Accessibility-in-Windows-PowerShell-ISE.md b/reference/docs-conceptual/setup/Accessibility-in-Windows-PowerShell-ISE.md index f4472e0d1349..481bd504b93a 100644 --- a/reference/docs-conceptual/setup/Accessibility-in-Windows-PowerShell-ISE.md +++ b/reference/docs-conceptual/setup/Accessibility-in-Windows-PowerShell-ISE.md @@ -4,8 +4,8 @@ keywords: powershell,cmdlet title: Accessibility in Windows PowerShell ISE ms.assetid: a078f9d1-dd6b-4323-b16d-0622cd993aa8 --- - # Accessibility in Windows PowerShell ISE + This topic describes the accessibility features of Windows PowerShell Integrated Scripting Environment (ISE) that you might find helpful. * [How to change the size and location of the Console and Script Panes](#how-to-change-the-size-and-location-of-the-console-and-script-panes) @@ -27,6 +27,7 @@ Windows PowerShell ISE supports high contrast mode. For the visually impaired, b - Text Size Change ## How to change the size and location of the Console and Script Panes + You can use the following steps to change the size and location of the Console Pane and the Script Pane. When you open the Windows PowerShell ISE again, the size and location changes you made will be retained. ### To resize the Script Pane and Console Pane @@ -36,6 +37,7 @@ You can use the following steps to change the size and location of the Console P 2. When the mouse pointer changes to a two-headed arrow, drag the border to change the size of the pane. ### To move the Script Pane and Console Pane + Do one of the following: - To move the Script Pane above the Console Pane, press **CTRL+1** or, on the toolbar, click the **Show Script Pane Top** icon, or in the **View** menu, click **Show Script Pane Top**. @@ -49,6 +51,7 @@ Do one of the following: - To display the Script Pane when the Console Pane is maximized, on the far right edge of the row of tabs, click the **Show Script Pane** icon, or in the **View** menu, click to select the **Show Script Pane** menu option. ## Keyboard shortcuts for editing text + You can use the following keyboard shortcuts when you edit text. |Action|Keyboard Shortcuts|Use in| @@ -66,6 +69,7 @@ You can use the following keyboard shortcuts when you edit text. |**Undo**|CTRL+Z|Script Pane, Console Pane| ## Keyboard shortcuts for running scripts + You can use the following keyboard shortcuts when you run scripts in the Script Pane. |Action|Keyboard Shortcut| @@ -79,6 +83,7 @@ You can use the following keyboard shortcuts when you run scripts in the Script |**Tab** (to previous script)|CTRL+SHIFT+TAB **Note:** Tab to previous script works when you have only one PowerShell tab open, or if you have more than one PowerShell tab open, and the focus is in the Script Pane.| ## Keyboard shortcuts for customizing the view + You can use the following keyboard shortcuts to customize the view in Windows PowerShell ISE. They are accessible from all the panes in the application. |Action|Keyboard Shortcut| @@ -95,6 +100,7 @@ You can use the following keyboard shortcuts to customize the view in Windows Po |**Zoom Out**|CTRL+MINUS SIGN| ## Keyboard shortcuts for debugging scripts + You can use the following keyboard shortcuts when you debug scripts. |Action|Keyboard Shortcut|Use in| @@ -126,6 +132,7 @@ You can use the following keyboard shortcuts when you debug scripts. |**Display Console Debugging Commands**|H or ?|Console Pane, when debugging a script| ## Keyboard shortcuts for Windows PowerShell tabs + You can use the following keyboard shortcuts when you use Windows PowerShell tabs. |Action|Keyboard Shortcut| @@ -136,6 +143,7 @@ You can use the following keyboard shortcuts when you use Windows PowerShell tab |**Next Windows PowerShell tab**|CTRL+TAB. This shortcut works only when no files are open on any PowerShell tab.| ## Keyboard shortcuts for starting and exiting + You can use the following keyboard shortcuts to start the Windows PowerShell console (PowerShell.exe) or to exit Windows PowerShell ISE. |Action|Keyboard Shortcut| @@ -144,5 +152,5 @@ You can use the following keyboard shortcuts to start the Windows PowerShell con |**Start PowerShell.exe** (Windows PowerShell console)|CTRL+SHIFT+P| ## See Also -- [Using the Windows PowerShell ISE](../core-powershell/ise/Using-the-Windows-PowerShell-ISE.md) +- [Introducing the Windows PowerShell ISE](../core-powershell/ise/Introducing-the-Windows-PowerShell-ISE.md) \ No newline at end of file diff --git a/reference/docs-conceptual/setup/Installing-PowerShell-Core-on-macOS-and-Linux.md b/reference/docs-conceptual/setup/Installing-PowerShell-Core-on-macOS-and-Linux.md index f591964c6df2..e96a186c56da 100644 --- a/reference/docs-conceptual/setup/Installing-PowerShell-Core-on-macOS-and-Linux.md +++ b/reference/docs-conceptual/setup/Installing-PowerShell-Core-on-macOS-and-Linux.md @@ -387,10 +387,21 @@ sudo yum remove powershell ## OpenSUSE 42.2 -> **Note:** When installing PowerShell Core, OpenSUSE may report that nothing provides `libcurl`. -`libcurl` should already be installed on supported versions of OpenSUSE. -Run `zypper search libcurl` to confirm. -The error will present 2 'solutions'. Choose 'Solution 2' to continue installing PowerShell Core. +> **Note:** When installing PowerShell Core, `zypper` may report the following error: +> +> ```text +> Problem: nothing provides libcurl needed by powershell-6.0.1-1.rhel.7.x86_64 +> Solution 1: do not install powershell-6.0.1-1.rhel.7.x86_64 +> Solution 2: break powershell-6.0.1-1.rhel.7.x86_64 by ignoring some of its dependencies +> ``` +> +> In this case, verify that a compatible `libcurl` library is present by checking that the following command shows the `libcurl4` package as installed: +> +> ```sh +> zypper search --file-list --match-exact '/usr/lib64/libcurl.so.4' +> ``` +> +> Then choose the `break powershell-6.0.1-1.rhel.7.x86_64 by ignoring some of its dependencies` solution when installing the `powershell` package. ### Installation via Package Repository (preferred) - OpenSUSE 42.2 diff --git a/reference/docs-conceptual/whats-new/What-s-New-in-the-PowerShell-50-ISE.md b/reference/docs-conceptual/whats-new/What-s-New-in-the-PowerShell-50-ISE.md index 787f84e32762..018a95a6cf8f 100644 --- a/reference/docs-conceptual/whats-new/What-s-New-in-the-PowerShell-50-ISE.md +++ b/reference/docs-conceptual/whats-new/What-s-New-in-the-PowerShell-50-ISE.md @@ -218,7 +218,7 @@ Show-Command is new Windows PowerShell ISE 3.0. ## See also For more information about using Windows PowerShell ISE in Windows PowerShell, see the following links. -- [Using the Windows PowerShell Integrated Scripting Environment](../core-powershell/ise/Using-the-Windows-PowerShell-ISE.md) +- [Exploring the Windows PowerShell Integrated Scripting Environment](../getting-started/fundamental/exploring-the-windows-powershell-ise.md) - [ISE on the TechNet Wiki](http://social.technet.microsoft.com/wiki/search/searchresults.aspx?q=ISE) - [Script Center](http://technet.microsoft.com/scriptcenter/default) diff --git a/wmf/TOC.md b/wmf/TOC.md deleted file mode 100644 index 82501f4ce8ea..000000000000 --- a/wmf/TOC.md +++ /dev/null @@ -1,97 +0,0 @@ -# [Windows Management Framework (WMF) Overview](README.md) - -# [WMF 5.1](5.1/release-notes.md) -## [New Scenarios and Features](5.1/scenarios-features.md) -### [Improvements in Desired State Configuration (DSC)](5.1/DSC-improvements.md) -### [Improvements in the PowerShell Console](5.1/console-improvements.md) -### [Improvements in the PowerShell Engine](5.1/engine-improvements.md) -### [Improvements in Package Management](5.1/package-management-improvements.md) -### [Improvements in JEA](5.1/jea-improvements.md) -### [Catalog cmdlets](5.1/catalog-cmdlets.md) -### [Bugs Fixed in WMF 5.1](5.1/bugfixes.md) -## [Install and Configure](5.1/install-configure.md) -## [Known Issues](5.1/known-issues.md) -## [Compatibility](5.1/Compatibility.md) -## [Product Compatibility](5.1/productincompat.md) - -# [WMF 5.0](5.0/releasenotes.md) -## [Installation Details](5.0/requirements.md) -## [Known Issues and Limitations](5.0/limitation_overview.md) -### [Desired State Configuration (DSC) Known Issues](5.0/limitation_dsc.md) -## [Product Compatibility Status](5.0/productincompat.md) -## [Scenarios Enabled by WMF 5.0]() -### [Just Enough Administration (JEA)](5.0/jea_overview.md) -#### [Creating and Connecting to a JEA Endpoint](5.0/jea_endpoint.md) -#### [Reporting on JEA](5.0/jea_report.md) -### [Creating Custom Types using PowerShell Classes](5.0/class_overview.md) -#### [Define Custom Types](5.0/class_newtype.md) -#### [Declare Base Class](5.0/class_base.md) -#### [Declare Implemented Interface](5.0/class_interface.md) -#### [Call Base Class Constructor](5.0/class_baseconstructor.md) -#### [Call Base Class Method](5.0/class_basemethod.md) -### [Improvements in PowerShell Script Debugging](5.0/debug_overview.md) -### [Improvements in Desired State Configuration (DSC)](5.0/dsc_improvements.md) -#### [Configurations]() -##### [Specifying Cross Node Dependencies](5.0/dsc_waitfor.md) -##### [Encrypted MOFs](5.0/dsc_encryptedmof.md) -##### [Help Support for DSC Configuration](5.0/dsc_confighelp.md) -##### [Authoring Improvements using PowerShell ISE](5.0/dsc_authoring.md) -##### [Allowance for Identical Duplicate Resources in a Configuration](5.0/dsc_identicalduplicate.md) -##### [Import-DscResource Keyword Supports -ModuleVersion Parameter](5.0/dsc_importdscresource.md) -##### [WOW64 Support for Configuration Keyword](5.0/dsc_wow64.md) -#### [Resources]() -##### [Class-based DSC Resources](5.0/dsc_classbasedresource.md) -##### [DSC Resource Script Debugging](5.0/dsc_resourcedebugging.md) -##### [Automatic RunAs Support for DSC Resources](5.0/dsc_runas.md) -##### [Side-By-Side Versioning Support for DSC Resources](5.0/dsc_sxsresource.md) -##### [New In-box Resources](5.0/dsc_newresources.md) -#### [Local Configuration Manager]() -##### [Configure Node with Multiple Configuration Fragments](5.0/dsc_partialconfig.md) -###### [Support for Mixed RefreshModes](5.0/dsc_partialconfig_mixedmode.md) -##### [Configure DSC Engine with New Attribute](5.0/dsc_metaconfiguration.md) -##### [Detailed Information about LCM State](5.0/dsc_lcmstate.md) -##### [Frequencies for RefreshMode and ConfigurationMode need not be Multiple of Each Other](5.0/dsc_freqnomultiple.md) -##### [Additional Value for RefreshMode Property](5.0/dsc_refreshmode.md) -#### [Cmdlets]() -##### [Details about Configuration Status](5.0/dsc_getconfigurationstatus.md) -##### [Test-DscConfiguration Cmdlet Supports Reference Configurations](5.0/dsc_testconfiguration.md) -##### [Direct Access to DSC Resource Methods](5.0/dsc_directaccess.md) -##### [Deliver Configuration Document without Applying](5.0/dsc_publishconfig.md) -##### [Remove DSC Documents](5.0/dsc_removeconfigdoc.md) -##### [Unified and Consistent State and Status Representation](5.0/dsc_statestatus.md) -##### [Set-DscLocalConfigurationManager Cmdlet Supports -Force Parameter](5.0/dsc_setdsclcm.md) -#### [Pull Mode]() -##### [On-demand PULL of DSC Configurations](5.0/dsc_updateconfig.md) -##### [Separation of Node and Configuration IDs](5.0/dsc_nodeid.md) -##### [Separation of Configuration, Resource, and Report Repositories](5.0/dsc_repository.md) -##### [Report Configuration Status to Central Location](5.0/dsc_reporting.md) -### [Audit PowerShell Usage using Transcript and Logging](5.0/audit_overview.md) -#### [Enhanced Transcription Options](5.0/audit_transcript.md) -#### [Script Tracing and Logging](5.0/audit_script.md) -#### [Cryptographic Message Syntax (CMS) Cmdlets](5.0/audit_cms.md) -### [Software Discovery, Install, and Inventory with PackageManagement](5.0/oneget_overview.md) -#### [PackageManagement Cmdlets](5.0/oneget_cmdlets.md) -### [PowerShell Module Discovery, Install, and Inventory with PowerShellGet](5.0/psget_module_overview.md) -#### [Register a PowerShell Repository](5.0/psget_psrepository.md) -#### [Side-by-Side Version Support on PowerShell 5.0 or Newer](5.0/psget_modulesxsinstall.md) -#### [Installation of Module Dependencies](5.0/psget_moduledependency.md) -#### [PowerShellGet Cmdlets for Module Management](5.0/psget_modulecmdlets.md) -### [PowerShell Script Discovery, Install, and Management with PowerShellGet](5.0/psget_script_overview.md) -#### [PowerShellGet Cmdlets for Script Management](5.0/psget_scriptcmdlets.md) -### [New and Updated Cmdlets based on Community Feedback](5.0/feedback_cmdlets.md) -#### [Symbolic Links using Item Cmdlets](5.0/feedback_symbolic.md) -#### [Archive Cmdlets](5.0/feedback_archive.md) -#### [Clipboard Cmdlets](5.0/feedback_clipboard.md) -#### [Convert-String](5.0/feedback_convertstring.md) -#### [Extract and Parse Structured Objects out of String](5.0/feedback_convertfromString.md) -#### [Format-Hex](5.0/feedback_formathex.md) -#### [NoNewLine Parameter](5.0/feedback_nonewline.md) -#### [New-TemporaryFile](5.0/feedback_tempfile.md) -#### [New-Guid](5.0/feedback_newguid.md) -#### [Get-ChildItem has -Depth Parameter](5.0/feedback_getchilditem.md) -#### [Updates to FileInfo object](5.0/feedback_fileinfo.md) -#### [Modules Support for Declaring Version Ranges (1.*, etc)](5.0/feedback_moduleversionranges.md) -### [Information Stream](5.0/informationstream_overview.md) -### [Generate PowerShell Cmdlets based on OData Endpoint](5.0/odata_overview.md) -### [Network Switch Management with PowerShell](5.0/networkswitch_overview.md) -### [Software Inventory Logging (SIL)](5.0/sil_overview.md) diff --git a/wmf/TOC.yml b/wmf/TOC.yml new file mode 100644 index 000000000000..1f2bdbad2282 --- /dev/null +++ b/wmf/TOC.yml @@ -0,0 +1,209 @@ +- name: Windows Management Framework (WMF) Overview + href: README.md +- name: WMF 5.1 + href: 5.1/release-notes.md + items: + - name: New Scenarios and Features + href: 5.1/scenarios-features.md + items: + - name: Improvements in Desired State Configuration (DSC) + href: 5.1/DSC-improvements.md + - name: Improvements in the PowerShell Console + href: 5.1/console-improvements.md + - name: Improvements in the PowerShell Engine + href: 5.1/engine-improvements.md + - name: Improvements in Package Management + href: 5.1/package-management-improvements.md + - name: Improvements in JEA + href: 5.1/jea-improvements.md + - name: Catalog cmdlets + href: 5.1/catalog-cmdlets.md + - name: Bugs Fixed in WMF 5.1 + href: 5.1/bugfixes.md + - name: Install and Configure + href: 5.1/install-configure.md + - name: Known Issues + href: 5.1/known-issues.md + - name: Compatibility + href: 5.1/Compatibility.md + - name: Product Compatibility + href: 5.1/productincompat.md +- name: WMF 5.0 + href: 5.0/releasenotes.md + items: + - name: Installation Details + href: 5.0/requirements.md + - name: Known Issues and Limitations + href: 5.0/limitation_overview.md + items: + - name: Desired State Configuration (DSC) Known Issues + href: 5.0/limitation_dsc.md + - name: Product Compatibility Status + href: 5.0/productincompat.md + - name: Scenarios Enabled by WMF 5.0 + href: '' + items: + - name: Just Enough Administration (JEA) + href: 5.0/jea_overview.md + items: + - name: Creating and Connecting to a JEA Endpoint + href: 5.0/jea_endpoint.md + - name: Reporting on JEA + href: 5.0/jea_report.md + - name: Creating Custom Types using PowerShell Classes + href: 5.0/class_overview.md + items: + - name: Define Custom Types + href: 5.0/class_newtype.md + - name: Declare Base Class + href: 5.0/class_base.md + - name: Declare Implemented Interface + href: 5.0/class_interface.md + - name: Call Base Class Constructor + href: 5.0/class_baseconstructor.md + - name: Call Base Class Method + href: 5.0/class_basemethod.md + - name: Improvements in PowerShell Script Debugging + href: 5.0/debug_overview.md + - name: Improvements in Desired State Configuration (DSC) + href: 5.0/dsc_improvements.md + items: + - name: Configurations + href: '' + items: + - name: Specifying Cross Node Dependencies + href: 5.0/dsc_waitfor.md + - name: Encrypted MOFs + href: 5.0/dsc_encryptedmof.md + - name: Help Support for DSC Configuration + href: 5.0/dsc_confighelp.md + - name: Authoring Improvements using PowerShell ISE + href: 5.0/dsc_authoring.md + - name: Allowance for Identical Duplicate Resources in a Configuration + href: 5.0/dsc_identicalduplicate.md + - name: Import-DscResource Keyword Supports -ModuleVersion Parameter + href: 5.0/dsc_importdscresource.md + - name: WOW64 Support for Configuration Keyword + href: 5.0/dsc_wow64.md + - name: Resources + href: '' + items: + - name: Class-based DSC Resources + href: 5.0/dsc_classbasedresource.md + - name: DSC Resource Script Debugging + href: 5.0/dsc_resourcedebugging.md + - name: Automatic RunAs Support for DSC Resources + href: 5.0/dsc_runas.md + - name: Side-By-Side Versioning Support for DSC Resources + href: 5.0/dsc_sxsresource.md + - name: New In-box Resources + href: 5.0/dsc_newresources.md + - name: Local Configuration Manager + href: '' + items: + - name: Configure Node with Multiple Configuration Fragments + href: 5.0/dsc_partialconfig.md + items: + - name: Support for Mixed RefreshModes + href: 5.0/dsc_partialconfig_mixedmode.md + - name: Configure DSC Engine with New Attribute + href: 5.0/dsc_metaconfiguration.md + - name: Detailed Information about LCM State + href: 5.0/dsc_lcmstate.md + - name: Frequencies for RefreshMode and ConfigurationMode need not be Multiple of Each Other + href: 5.0/dsc_freqnomultiple.md + - name: Additional Value for RefreshMode Property + href: 5.0/dsc_refreshmode.md + - name: Cmdlets + href: '' + items: + - name: Details about Configuration Status + href: 5.0/dsc_getconfigurationstatus.md + - name: Test-DscConfiguration Cmdlet Supports Reference Configurations + href: 5.0/dsc_testconfiguration.md + - name: Direct Access to DSC Resource Methods + href: 5.0/dsc_directaccess.md + - name: Deliver Configuration Document without Applying + href: 5.0/dsc_publishconfig.md + - name: Remove DSC Documents + href: 5.0/dsc_removeconfigdoc.md + - name: Unified and Consistent State and Status Representation + href: 5.0/dsc_statestatus.md + - name: Set-DscLocalConfigurationManager Cmdlet Supports -Force Parameter + href: 5.0/dsc_setdsclcm.md + - name: Pull Mode + href: '' + items: + - name: On-demand PULL of DSC Configurations + href: 5.0/dsc_updateconfig.md + - name: Separation of Node and Configuration IDs + href: 5.0/dsc_nodeid.md + - name: Separation of Configuration, Resource, and Report Repositories + href: 5.0/dsc_repository.md + - name: Report Configuration Status to Central Location + href: 5.0/dsc_reporting.md + - name: Audit PowerShell Usage using Transcript and Logging + href: 5.0/audit_overview.md + items: + - name: Enhanced Transcription Options + href: 5.0/audit_transcript.md + - name: Script Tracing and Logging + href: 5.0/audit_script.md + - name: Cryptographic Message Syntax (CMS) Cmdlets + href: 5.0/audit_cms.md + - name: Software Discovery, Install, and Inventory with PackageManagement + href: 5.0/oneget_overview.md + items: + - name: PackageManagement Cmdlets + href: 5.0/oneget_cmdlets.md + - name: PowerShell Module Discovery, Install, and Inventory with PowerShellGet + href: 5.0/psget_module_overview.md + items: + - name: Register a PowerShell Repository + href: 5.0/psget_psrepository.md + - name: Side-by-Side Version Support on PowerShell 5.0 or Newer + href: 5.0/psget_modulesxsinstall.md + - name: Installation of Module Dependencies + href: 5.0/psget_moduledependency.md + - name: PowerShellGet Cmdlets for Module Management + href: 5.0/psget_modulecmdlets.md + - name: PowerShell Script Discovery, Install, and Management with PowerShellGet + href: 5.0/psget_script_overview.md + items: + - name: PowerShellGet Cmdlets for Script Management + href: 5.0/psget_scriptcmdlets.md + - name: New and Updated Cmdlets based on Community Feedback + href: 5.0/feedback_cmdlets.md + items: + - name: Symbolic Links using Item Cmdlets + href: 5.0/feedback_symbolic.md + - name: Archive Cmdlets + href: 5.0/feedback_archive.md + - name: Clipboard Cmdlets + href: 5.0/feedback_clipboard.md + - name: Convert-String + href: 5.0/feedback_convertstring.md + - name: Extract and Parse Structured Objects out of String + href: 5.0/feedback_convertfromString.md + - name: Format-Hex + href: 5.0/feedback_formathex.md + - name: NoNewLine Parameter + href: 5.0/feedback_nonewline.md + - name: New-TemporaryFile + href: 5.0/feedback_tempfile.md + - name: New-Guid + href: 5.0/feedback_newguid.md + - name: Get-ChildItem has -Depth Parameter + href: 5.0/feedback_getchilditem.md + - name: Updates to FileInfo object + href: 5.0/feedback_fileinfo.md + - name: Modules Support for Declaring Version Ranges (1.*, etc) + href: 5.0/feedback_moduleversionranges.md + - name: Information Stream + href: 5.0/informationstream_overview.md + - name: Generate PowerShell Cmdlets based on OData Endpoint + href: 5.0/odata_overview.md + - name: Network Switch Management with PowerShell + href: 5.0/networkswitch_overview.md + - name: Software Inventory Logging (SIL) + href: 5.0/sil_overview.md diff --git a/wmf/docfx.json b/wmf/docfx.json index baf309eb2474..9b954f0507d8 100644 --- a/wmf/docfx.json +++ b/wmf/docfx.json @@ -10,7 +10,7 @@ } ], "globalMetadata": { - "breadcrumb_path": "/powershell/wmf/bread/toc.json", + "breadcrumb_path": "/powershell/wmf/bread/toc.yml", "uhfHeaderId": "MSDocsHeader-Powershell", "ROBOTS": "INDEX, FOLLOW", "ms.prod": "powershell", From f155d98efbb3030e9144b496d6ef80ab993edb98 Mon Sep 17 00:00:00 2001 From: Mark Kraus Date: Tue, 27 Mar 2018 07:12:47 -0700 Subject: [PATCH 03/21] Document 6.1.0 Web Cmdlets -Resume Feature (#2220) * Update Invoke-RestMethod Syntax * Add -Resume documentation to Invoke-RestMethod * Update Syntax for Invoke-WebRequest * Add -Resume documentation to Invoke-WebRequest --- .../Invoke-RestMethod.md | 64 +++++++++++++++---- .../Invoke-WebRequest.md | 58 ++++++++++++++--- 2 files changed, 103 insertions(+), 19 deletions(-) diff --git a/reference/6/Microsoft.PowerShell.Utility/Invoke-RestMethod.md b/reference/6/Microsoft.PowerShell.Utility/Invoke-RestMethod.md index 5c2087d17fd5..6b8d0c2915f0 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Invoke-RestMethod.md +++ b/reference/6/Microsoft.PowerShell.Utility/Invoke-RestMethod.md @@ -13,7 +13,7 @@ title: Invoke-RestMethod ## Synopsis Sends an HTTP or HTTPS request to a RESTful web service. -## Syntax +## SYNTAX ### StandardMethod (Default) ``` @@ -24,8 +24,9 @@ Invoke-RestMethod [-Method ] [-FollowRelLink] [-MaximumFollowR [-Certificate ] [-SkipCertificateCheck] [-SslProtocol ] [-Token ] [-UserAgent ] [-DisableKeepAlive] [-TimeoutSec ] [-Headers ] [-MaximumRedirection ] [-Proxy ] [-ProxyCredential ] - [-ProxyUseDefaultCredentials] [-Body ] [-ContentType ] [-TransferEncoding ] - [-InFile ] [-OutFile ] [-PassThru] [-PreserveAuthorizationOnRedirect] [-SkipHeaderValidation] + [-ProxyUseDefaultCredentials] [-Body ] [-Form ] [-ContentType ] + [-TransferEncoding ] [-InFile ] [-OutFile ] [-PassThru] [-Resume] + [-PreserveAuthorizationOnRedirect] [-SkipHeaderValidation] ``` ### StandardMethodNoProxy @@ -36,9 +37,9 @@ Invoke-RestMethod [-Method ] [-FollowRelLink] [-MaximumFollowR [-Credential ] [-UseDefaultCredentials] [-CertificateThumbprint ] [-Certificate ] [-SkipCertificateCheck] [-SslProtocol ] [-Token ] [-UserAgent ] [-DisableKeepAlive] [-TimeoutSec ] - [-Headers ] [-MaximumRedirection ] [-NoProxy] [-Body ] [-ContentType ] - [-TransferEncoding ] [-InFile ] [-OutFile ] [-PassThru] - [-PreserveAuthorizationOnRedirect] [-SkipHeaderValidation] + [-Headers ] [-MaximumRedirection ] [-NoProxy] [-Body ] [-Form ] + [-ContentType ] [-TransferEncoding ] [-InFile ] [-OutFile ] [-PassThru] + [-Resume] [-PreserveAuthorizationOnRedirect] [-SkipHeaderValidation] ``` ### CustomMethod @@ -50,8 +51,9 @@ Invoke-RestMethod -CustomMethod [-FollowRelLink] [-MaximumFollowRelLink [-Certificate ] [-SkipCertificateCheck] [-SslProtocol ] [-Token ] [-UserAgent ] [-DisableKeepAlive] [-TimeoutSec ] [-Headers ] [-MaximumRedirection ] [-Proxy ] [-ProxyCredential ] - [-ProxyUseDefaultCredentials] [-Body ] [-ContentType ] [-TransferEncoding ] - [-InFile ] [-OutFile ] [-PassThru] [-PreserveAuthorizationOnRedirect] [-SkipHeaderValidation] + [-ProxyUseDefaultCredentials] [-Body ] [-Form ] [-ContentType ] + [-TransferEncoding ] [-InFile ] [-OutFile ] [-PassThru] [-Resume] + [-PreserveAuthorizationOnRedirect] [-SkipHeaderValidation] ``` ### CustomMethodNoProxy @@ -62,9 +64,9 @@ Invoke-RestMethod -CustomMethod [-FollowRelLink] [-MaximumFollowRelLink [-Credential ] [-UseDefaultCredentials] [-CertificateThumbprint ] [-Certificate ] [-SkipCertificateCheck] [-SslProtocol ] [-Token ] [-UserAgent ] [-DisableKeepAlive] [-TimeoutSec ] - [-Headers ] [-MaximumRedirection ] [-NoProxy] [-Body ] [-ContentType ] - [-TransferEncoding ] [-InFile ] [-OutFile ] [-PassThru] - [-PreserveAuthorizationOnRedirect] [-SkipHeaderValidation] + [-Headers ] [-MaximumRedirection ] [-NoProxy] [-Body ] [-Form ] + [-ContentType ] [-TransferEncoding ] [-InFile ] [-OutFile ] [-PassThru] + [-Resume] [-PreserveAuthorizationOnRedirect] [-SkipHeaderValidation] ``` ## Description @@ -593,6 +595,46 @@ Accept wildcard characters: False ``` +### -Resume +Performs a best effort attempt to resume downloading a partial file. +`-Resume` requires `-OutFile`. + +`-Resume` only operates on the size of the local file and remote file +and performs no other validation that the local file and the remote file are the same. + +If the local file size is smaller than the remote file size, +then the cmdlet will attempt to resume downloading the file +and append the remaining bytes to the end of the file. + +If the local file size is the same as the remote file size, +then no action is taken and the cmdlet assumes the download already complete. + +If the local file size is larger than the remote file size, +then the local file will be overwritten and the entire remote file will be completely re-downloaded. +This behavior is the same as using `-OutFile` without `-Resume`. + +If the remote server does not support download resuming, +then the local file will be overwritten and the entire remote file will be completely re-downloaded. +This behavior is the same as using `-OutFile` without `-Resume`. + +If the local file does not exist, +then the local file will be created and the entire remote file will be completely downloaded. +This behavior is the same as using `-OutFile` without `-Resume`. + +This feature was added in PowerShell 6.1.0. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -SessionVariable Specifies a variable for which this cmdlet creates a web request session and saves it in the value. Enter a variable name without the dollar sign (`$`) symbol. diff --git a/reference/6/Microsoft.PowerShell.Utility/Invoke-WebRequest.md b/reference/6/Microsoft.PowerShell.Utility/Invoke-WebRequest.md index e0fccf97c43c..8c95cf872f41 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Invoke-WebRequest.md +++ b/reference/6/Microsoft.PowerShell.Utility/Invoke-WebRequest.md @@ -23,8 +23,8 @@ Invoke-WebRequest [-UseBasicParsing] [-Uri] [-WebSession ] [-Token ] [-UserAgent ] [-DisableKeepAlive] [-TimeoutSec ] [-Headers ] [-MaximumRedirection ] [-Method ] [-Proxy ] [-ProxyCredential ] [-ProxyUseDefaultCredentials] - [-Body ] [-ContentType ] [-TransferEncoding ] [-InFile ] [-OutFile ] - [-PassThru] [-PreserveAuthorizationOnRedirect] [-SkipHeaderValidation] + [-Body ] [-Form ] [-ContentType ] [-TransferEncoding ] [-InFile ] + [-OutFile ] [-PassThru] [-Resume] [-PreserveAuthorizationOnRedirect] [-SkipHeaderValidation] ``` ### StandardMethodNoProxy @@ -34,8 +34,9 @@ Invoke-WebRequest [-UseBasicParsing] [-Uri] [-WebSession ] [-Certificate ] [-SkipCertificateCheck] [-SslProtocol ] [-Token ] [-UserAgent ] [-DisableKeepAlive] [-TimeoutSec ] [-Headers ] [-MaximumRedirection ] - [-Method ] [-NoProxy] [-Body ] [-ContentType ] [-TransferEncoding ] - [-InFile ] [-OutFile ] [-PassThru] [-PreserveAuthorizationOnRedirect] [-SkipHeaderValidation] + [-Method ] [-NoProxy] [-Body ] [-Form ] [-ContentType ] + [-TransferEncoding ] [-InFile ] [-OutFile ] [-PassThru] [-Resume] + [-PreserveAuthorizationOnRedirect] [-SkipHeaderValidation] ``` ### CustomMethod @@ -46,8 +47,8 @@ Invoke-WebRequest [-UseBasicParsing] [-Uri] [-WebSession ] [-Token ] [-UserAgent ] [-DisableKeepAlive] [-TimeoutSec ] [-Headers ] [-MaximumRedirection ] -CustomMethod [-Proxy ] [-ProxyCredential ] [-ProxyUseDefaultCredentials] - [-Body ] [-ContentType ] [-TransferEncoding ] [-InFile ] [-OutFile ] - [-PassThru] [-PreserveAuthorizationOnRedirect] [-SkipHeaderValidation] + [-Body ] [-Form ] [-ContentType ] [-TransferEncoding ] [-InFile ] + [-OutFile ] [-PassThru] [-Resume] [-PreserveAuthorizationOnRedirect] [-SkipHeaderValidation] ``` ### CustomMethodNoProxy @@ -57,8 +58,9 @@ Invoke-WebRequest [-UseBasicParsing] [-Uri] [-WebSession ] [-Certificate ] [-SkipCertificateCheck] [-SslProtocol ] [-Token ] [-UserAgent ] [-DisableKeepAlive] [-TimeoutSec ] [-Headers ] [-MaximumRedirection ] - -CustomMethod [-NoProxy] [-Body ] [-ContentType ] [-TransferEncoding ] - [-InFile ] [-OutFile ] [-PassThru] [-PreserveAuthorizationOnRedirect] [-SkipHeaderValidation] + -CustomMethod [-NoProxy] [-Body ] [-Form ] [-ContentType ] + [-TransferEncoding ] [-InFile ] [-OutFile ] [-PassThru] [-Resume] + [-PreserveAuthorizationOnRedirect] [-SkipHeaderValidation] ``` ## DESCRIPTION @@ -556,6 +558,46 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -Resume +Performs a best effort attempt to resume downloading a partial file. +`-Resume` requires `-OutFile`. + +`-Resume` only operates on the size of the local file and remote file +and performs no other validation that the local file and the remote file are the same. + +If the local file size is smaller than the remote file size, +then the cmdlet will attempt to resume downloading the file +and append the remaining bytes to the end of the file. + +If the local file size is the same as the remote file size, +then no action is taken and the cmdlet assumes the download already complete. + +If the local file size is larger than the remote file size, +then the local file will be overwritten and the entire remote file will be completely re-downloaded. +This behavior is the same as using `-OutFile` without `-Resume`. + +If the remote server does not support download resuming, +then the local file will be overwritten and the entire remote file will be completely re-downloaded. +This behavior is the same as using `-OutFile` without `-Resume`. + +If the local file does not exist, +then the local file will be created and the entire remote file will be completely downloaded. +This behavior is the same as using `-OutFile` without `-Resume`. + +This feature was added in PowerShell 6.1.0. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -SessionVariable Specifies a variable for which this cmdlet creates a web request session and saves it in the value. Enter a variable name without the dollar sign (`$`) symbol. From eabcf2b9e83a32592bd78da45f2d716ca1d281a7 Mon Sep 17 00:00:00 2001 From: Mark Kraus Date: Wed, 28 Mar 2018 07:22:34 -0700 Subject: [PATCH 04/21] Document New -Form Parameter for Web Cmdlets (#2233) * Add example to Invoke-RestMethod * Document -Form Feature in Invoke-RestMethod * Add Simplified Mulitpart/Form-Data example to Invoke-WebRequest * Document -Form Feature on Invoke-WebRequest --- .../Invoke-RestMethod.md | 88 +++++++++++++++++++ .../Invoke-WebRequest.md | 88 +++++++++++++++++++ 2 files changed, 176 insertions(+) diff --git a/reference/6/Microsoft.PowerShell.Utility/Invoke-RestMethod.md b/reference/6/Microsoft.PowerShell.Utility/Invoke-RestMethod.md index 6b8d0c2915f0..ab7e28b9fadb 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Invoke-RestMethod.md +++ b/reference/6/Microsoft.PowerShell.Utility/Invoke-RestMethod.md @@ -136,6 +136,40 @@ Invoke-RestMethod $url -FollowRelLink -MaximumFollowRelLink 2 Some REST APIs support pagination via Relation Links per [RFC5988](https://tools.ietf.org/html/rfc5988#page-6). Instead of parsing the header to get the URL for the next page, you can have the cmdlet do this for you. This example returns the first two pages of issues from the PowerShell GitHub repository +### Example 4: Simplified Multipart/Form-Data Submission +```powershell +$Uri = 'https://api.contoso.com/v2/profile' +$Form = @{ + firstName = 'John' + lastName = 'Doe' + email = 'john.doe@contoso.com' + avatar = Get-Item -Path 'c:\Pictures\jdoe.png' + birthday = '1980-10-15' + hobbies = 'Hiking','Fishing','Jogging' +} +$Result = Invoke-RestMethod -Uri $Uri -Method Post -Form $Form +``` + +Some APIs require `multipart/form-data` submissions to upload files and mixed content. +This example demonstrates updating a user profile. +The profile form requires these fields: +`firstName`, `lastName`, `email`, `avatar`, `birthday`, and `hobbies`. +The API is expecting an image for the user profile pic to be supplied in the `avatar` field. +The API will also accept multiple `hobbies` entries to be submitted in the same form. + +When creating the `$Form` HashTable, the key names are used as form field names. +By default, the values of the HashTable will be converted to strings. +If a `System.IO.FileInfo` value is present, the file contents will be submitted. +If a collection such as arrays or lists are present, +the form field will be submitted will be submitted multiple times. + +By using `Get-Item` on the `avatar` key, the `FileInfo` object will be set as the value. +The result is that the image data for `jdoe.png` will be submitted. + +By supplying a list to the `hobbies` key, +the `hobbies` field will be present in the submissions +once for each list item. + ## Parameters ### -AllowUnencryptedAuthentication @@ -350,6 +384,60 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -Form +Converts a dictionary to a `multipart/form-data` submission. +`-Form` may not be used with `-Body`. +If `-ContentType` will be ignored. + +The keys of the dictionary will be used as the form field names. +By default, form values will be converted to string values. + +If the value is a `System.IO.FileInfo` object, +then the binary file contents will be submitted. +The name of the file will be submitted as the `filename`. +The MIME will be set as `application/octet-stream`. +`Get-Item` can be used to simplify supplying the `System.IO.FileInfo` object. + +```powershell +$Form = @{ + resume = Get-Item 'c:\Users\jdoe\Documents\John Doe.pdf' +} +``` + +If the value is a collection type, +such Arrays or Lists, +the for field will be submitted multiple times. +The values of the the list will be treated as strings by default. +If the value is a `System.IO.FileInfo` object, +then the binary file contents will be submitted. +Nested collections are not supported. + +```powershell +$Form = @{ + tags = 'Vacation', 'Italy', '2017' + pictures = Get-ChildItem 'c:\Users\jdoe\Pictures\2017-Italy\' +} +``` + +In the above example the `tags` field will be supplied 3 times in the form, +once for each of `Vacation`, `Italy`, and `2017`. +The `pictures` field will also be submitted once for each file in the `2017-Italy` folder. +The binary contents of the files in that folder will be submitted as the values. + +This feature was added in PowerShell 6.1.0. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Headers Specifies the headers of the web request. Enter a hash table or dictionary. diff --git a/reference/6/Microsoft.PowerShell.Utility/Invoke-WebRequest.md b/reference/6/Microsoft.PowerShell.Utility/Invoke-WebRequest.md index 8c95cf872f41..9a110e2f1245 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Invoke-WebRequest.md +++ b/reference/6/Microsoft.PowerShell.Utility/Invoke-WebRequest.md @@ -151,6 +151,40 @@ $Response = Invoke-WebRequest -Body $MultipartContent -Method 'POST' -Uri 'https This example uses the `Invoke-WebRequest` cmdlet upload a file as a `multipart/form-data` submission. The file `c:\document.txt` will be submitted as the form field `document` with the `Content-Type` of `text/plain`. +### Example 5: Simplified Multipart/Form-Data Submission +```powershell +$Uri = 'https://api.contoso.com/v2/profile' +$Form = @{ + firstName = 'John' + lastName = 'Doe' + email = 'john.doe@contoso.com' + avatar = Get-Item -Path 'c:\Pictures\jdoe.png' + birthday = '1980-10-15' + hobbies = 'Hiking','Fishing','Jogging' +} +$Result = Invoke-RestMethod -Uri $Uri -Method Post -Form $Form +``` + +Some APIs require `multipart/form-data` submissions to upload files and mixed content. +This example demonstrates updating a user profile. +The profile form requires these fields: +`firstName`, `lastName`, `email`, `avatar`, `birthday`, and `hobbies`. +The API is expecting an image for the user profile pic to be supplied in the `avatar` field. +The API will also accept multiple `hobbies` entries to be submitted in the same form. + +When creating the `$Form` HashTable, the key names are used as form field names. +By default, the values of the HashTable will be converted to strings. +If a `System.IO.FileInfo` value is present, the file contents will be submitted. +If a collection such as arrays or lists are present, +the form field will be submitted will be submitted multiple times. + +By using `Get-Item` on the `avatar` key, the `FileInfo` object will be set as the value. +The result is that the image data for `jdoe.png` will be submitted. + +By supplying a list to the `hobbies` key, +the `hobbies` field will be present in the submissions +once for each list item. + ## PARAMETERS ### -AllowUnencryptedAuthentication @@ -346,6 +380,60 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -Form +Converts a dictionary to a `multipart/form-data` submission. +`-Form` may not be used with `-Body`. +If `-ContentType` will be ignored. + +The keys of the dictionary will be used as the form field names. +By default, form values will be converted to string values. + +If the value is a `System.IO.FileInfo` object, +then the binary file contents will be submitted. +The name of the file will be submitted as the `filename`. +The MIME will be set as `application/octet-stream`. +`Get-Item` can be used to simplify supplying the `System.IO.FileInfo` object. + +```powershell +$Form = @{ + resume = Get-Item 'c:\Users\jdoe\Documents\John Doe.pdf' +} +``` + +If the value is a collection type, +such Arrays or Lists, +the for field will be submitted multiple times. +The values of the the list will be treated as strings by default. +If the value is a `System.IO.FileInfo` object, +then the binary file contents will be submitted. +Nested collections are not supported. + +```powershell +$Form = @{ + tags = 'Vacation', 'Italy', '2017' + pictures = Get-ChildItem 'c:\Users\jdoe\Pictures\2017-Italy\' +} +``` + +In the above example the `tags` field will be supplied 3 times in the form, +once for each of `Vacation`, `Italy`, and `2017`. +The `pictures` field will also be submitted once for each file in the `2017-Italy` folder. +The binary contents of the files in that folder will be submitted as the values. + +This feature was added in PowerShell 6.1.0. + +```yaml +Type: IDictionary +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Headers Specifies the headers of the web request. Enter a hash table or dictionary. From 9be49f403cc36a2409ad614b4710f42aa71ff2b8 Mon Sep 17 00:00:00 2001 From: Klaudia Algiz Date: Wed, 28 Mar 2018 15:38:43 -0700 Subject: [PATCH 05/21] Update docs with the info about session configurations created by Enable-PSRemoting cmdlet. (#2252) --- .../About/about_Session_Configurations.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reference/6/Microsoft.PowerShell.Core/About/about_Session_Configurations.md b/reference/6/Microsoft.PowerShell.Core/About/about_Session_Configurations.md index be4f6b35dade..918779f91ed1 100644 --- a/reference/6/Microsoft.PowerShell.Core/About/about_Session_Configurations.md +++ b/reference/6/Microsoft.PowerShell.Core/About/about_Session_Configurations.md @@ -195,7 +195,9 @@ supported versions of Windows, you must change the security descriptors of the session configurations to allow remote access. To enable remote access to the session configurations on the computer, use the -Enable-PSRemoting cmdlet. +Enable-PSRemoting cmdlet. This cmdlet creates two session configurations: +- with the name defined as: "PowerShell." + "current PowerShell version" +- with name "PowerShell.6", untied to any specific PowerShell version. Also, by default, only members of the Administrators group on the computer have Execute permission to the default session configurations, but you can From 8d0649b6551a974bad82204939094d0c4a95d00b Mon Sep 17 00:00:00 2001 From: Mark Kraus Date: Fri, 30 Mar 2018 17:03:26 -0500 Subject: [PATCH 06/21] Document PowerShell/PowerShell#6018 --- reference/6/Microsoft.PowerShell.Utility/Invoke-RestMethod.md | 2 +- reference/6/Microsoft.PowerShell.Utility/Invoke-WebRequest.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/6/Microsoft.PowerShell.Utility/Invoke-RestMethod.md b/reference/6/Microsoft.PowerShell.Utility/Invoke-RestMethod.md index ab7e28b9fadb..44b14964ead2 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Invoke-RestMethod.md +++ b/reference/6/Microsoft.PowerShell.Utility/Invoke-RestMethod.md @@ -776,7 +776,7 @@ Indicates the cmdlet should add headers to the request without validation. This switch should be used for sites that require header values that do not conform to standards. Specifying this switch disables validation to allow the value to be passed unchecked. When specified, all headers are added without validation. -This will disable validation for values passed to both the **-Headers** and **-UserAgent** parameters. +This will disable validation for values passed to the **-ContentType**, **-Headers** and **-UserAgent** parameters. ```yaml Type: SwitchParameter diff --git a/reference/6/Microsoft.PowerShell.Utility/Invoke-WebRequest.md b/reference/6/Microsoft.PowerShell.Utility/Invoke-WebRequest.md index 9a110e2f1245..9e694c272cb5 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Invoke-WebRequest.md +++ b/reference/6/Microsoft.PowerShell.Utility/Invoke-WebRequest.md @@ -738,7 +738,7 @@ Indicates the cmdlet should add headers to the request without validation. This switch should be used for sites that require header values that do not conform to standards. Specifying this switch disables validation to allow the value to be passed unchecked. When specified, all headers are added without validation. -This will disable validation for values passed to both the **-Headers** and **-UserAgent** parameters. +This will disable validation for values passed to the **-ContentType**, **-Headers** and **-UserAgent** parameters. ```yaml Type: SwitchParameter From 4eb81a5b4ef2c0b076ff674ce23893c64d3bfea9 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Tue, 10 Apr 2018 00:47:11 +0900 Subject: [PATCH 07/21] update documentation to reflect that -ConfigurationName can be used with SSH (#2318) --- .../6/Microsoft.PowerShell.Core/Enter-PSSession.md | 8 ++++++-- .../6/Microsoft.PowerShell.Core/Invoke-Command.md | 13 ++++++++----- .../6/Microsoft.PowerShell.Core/New-PSSession.md | 10 +++++++--- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/reference/6/Microsoft.PowerShell.Core/Enter-PSSession.md b/reference/6/Microsoft.PowerShell.Core/Enter-PSSession.md index 9140e98aeb32..b688a08912cf 100644 --- a/reference/6/Microsoft.PowerShell.Core/Enter-PSSession.md +++ b/reference/6/Microsoft.PowerShell.Core/Enter-PSSession.md @@ -68,7 +68,8 @@ Enter-PSSession -ContainerId [-ConfigurationName ] [-RunAsAdmin ### HostName ``` -Enter-PSSession [-HostName] [-Port ] [-UserName ] [-KeyFilePath ] [-SSHTransport] [] +Enter-PSSession [-HostName] [-Port ] [-UserName ] [-KeyFilePath ] [-SSHTransport] + [-ConfigurationName ] [] ``` ## DESCRIPTION @@ -304,6 +305,9 @@ Specifies the session configuration that is used for the interactive session. Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: http://schemas.microsoft.com/powershell. +When used with SSH, this specifies the subsystem to use on the target as defined in sshd_config. +The default value for SSH is the `powershell` subsystem. + The session configuration for a session is located on the remote computer. If the specified session configuration does not exist on the remote computer, the command fails. @@ -313,7 +317,7 @@ For more information, see about_Preference_Variables. ```yaml Type: String -Parameter Sets: ComputerName, Uri, VMId, VMName, ContainerId +Parameter Sets: ComputerName, Uri, VMId, VMName, ContainerId, HostName Aliases: Required: False diff --git a/reference/6/Microsoft.PowerShell.Core/Invoke-Command.md b/reference/6/Microsoft.PowerShell.Core/Invoke-Command.md index e380b61572b1..e205a87e3502 100644 --- a/reference/6/Microsoft.PowerShell.Core/Invoke-Command.md +++ b/reference/6/Microsoft.PowerShell.Core/Invoke-Command.md @@ -116,9 +116,9 @@ Invoke-Command [-ConfigurationName ] [-ThrottleLimit ] [-AsJob] [ ### HostName ``` -Invoke-Command -ScriptBlock -HostName [-Port ] [-AsJob] -[-HideComputerName] [-UserName ] [-KeyFilePath ] [-SSHTransport] [-RemoteDebug] -[-InputObject ] [-ArgumentList ] [] +Invoke-Command [-ConfigurationName ] -ScriptBlock -HostName [-Port ] + [-AsJob] [-HideComputerName] [-UserName ] [-KeyFilePath ] [-SSHTransport] [-RemoteDebug] + [-InputObject ] [-ArgumentList ] [] ``` ### FilePathHostName @@ -703,6 +703,9 @@ Specifies the session configuration that is used for the new **PSSession**. Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: http://schemas.microsoft.com/PowerShell. +When used with SSH, this specifies the subsystem to use on the target as defined in sshd_config. +The default value for SSH is the `powershell` subsystem. + The session configuration for a session is located on the remote computer. If the specified session configuration does not exist on the remote computer, the command fails. @@ -712,7 +715,7 @@ For more information, see about_Preference_Variables. ```yaml Type: String -Parameter Sets: ComputerName, FilePathComputerName, Uri, FilePathUri, VMId, VMName, FilePathVMId, FilePathVMName, ContainerId, FilePathContainerId +Parameter Sets: ComputerName, FilePathComputerName, Uri, FilePathUri, VMId, VMName, FilePathVMId, FilePathVMName, ContainerId, FilePathContainerId, HostName Aliases: Required: False @@ -1245,7 +1248,7 @@ Accept wildcard characters: False ``` ### -SSHConnection -This parameter takes an array of hashtables where each hashtable contains one or more connection parameters needed to establish a Secure Shell (SSH) connection (HostName, Port, UserName, KeyFilePath). +This parameter takes an array of hashtables where each hashtable contains one or more connection parameters needed to establish a Secure Shell (SSH) connection (HostName, Port, UserName, KeyFilePath, Subsystem). The hashtable connection parameters are the same as defined for the HostName parameter set. diff --git a/reference/6/Microsoft.PowerShell.Core/New-PSSession.md b/reference/6/Microsoft.PowerShell.Core/New-PSSession.md index 5da5b8e546e9..61c3ac999bbf 100644 --- a/reference/6/Microsoft.PowerShell.Core/New-PSSession.md +++ b/reference/6/Microsoft.PowerShell.Core/New-PSSession.md @@ -57,7 +57,8 @@ New-PSSession [-Name ] [-ConfigurationName ] -ContainerId [-Name ] [-Port ] [-UserName ] [-KeyFilePath ] [-SSHTransport] [] +New-PSSession [-HostName] [-Name ] [-Port ] [-UserName ] [-KeyFilePath + [-ConfigurationName ] [-SSHTransport] [] ``` ### SSHConnection @@ -367,6 +368,9 @@ Specifies the session configuration that is used for the new **PSSession**. Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: http://schemas.microsoft.com/PowerShell. +When used with SSH, this specifies the subsystem to use on the target as defined in sshd_config. +The default value for SSH is the `powershell` subsystem. + The session configuration for a session is located on the remote computer. If the specified session configuration does not exist on the remote computer, the command fails. @@ -376,7 +380,7 @@ For more information, see [about_Preference_Variables](About/about_Preference_Va ```yaml Type: String -Parameter Sets: ComputerName, VMName, Uri, VMId, ContainerId +Parameter Sets: ComputerName, VMName, Uri, VMId, ContainerId, HostName Aliases: Required: False @@ -770,7 +774,7 @@ Accept wildcard characters: False ``` ### -SSHConnection -This parameter takes an array of hashtables where each hashtable contains one or more connection parameters needed to establish a Secure Shell (SSH) connection (HostName, Port, UserName, KeyFilePath). +This parameter takes an array of hashtables where each hashtable contains one or more connection parameters needed to establish a Secure Shell (SSH) connection (HostName, Port, UserName, KeyFilePath, Subsystem). The hashtable connection parameters are the same as defined for the **HostName** parameter set. From 72b311d1ae0f1f94959654e2b48c842f9ed44dfe Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Tue, 10 Apr 2018 00:48:30 +0900 Subject: [PATCH 08/21] update doc to reflect change in telemety opt out (#2316) --- .../whats-new/What-s-New-in-PowerShell-Core-60.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 ff53ed9b13eb..519f0c54bbbe 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 @@ -378,9 +378,8 @@ For a complete list of fixes and changes, check out our [changelog][] on GitHub. - the OS platform (`$PSVersionTable.OSDescription`) - the exact version of PowerShell (`$PSVersionTable.GitCommitId`) -If you want to opt-out of this telemetry, simply delete `$PSHome\DELETE_ME_TO_DISABLE_CONSOLEHOST_TELEMETRY` -or create `POWERSHELL_TELEMETRY_OPTOUT` environment variable with one of the following values: `true`, `1` or `yes`. -Deleting this file or creating the variable bypasses all telemetry even before the first run of PowerShell. +If you want to opt-out of this telemetry, simply create `POWERSHELL_TELEMETRY_OPTOUT` environment variable with one of the following values: `true`, `1` or `yes`. +Creating the variable bypasses all telemetry even before the first run of PowerShell. We also plan on exposing this telemetry data and the insights we glean from the telemetry in the [community dashboard][community-dashboard]. You can find out more about how we use this data in this [blog post][telemetry-blog]. From e97859d08b78117d0c6da247d4c55e86bed5cc44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20W=C3=A5hlin?= Date: Mon, 9 Apr 2018 18:05:44 +0200 Subject: [PATCH 09/21] Add -Not Feature to Where-Object (#2292) Fix #2199 --- .../Microsoft.PowerShell.Core/Where-Object.md | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/reference/6/Microsoft.PowerShell.Core/Where-Object.md b/reference/6/Microsoft.PowerShell.Core/Where-Object.md index d9a313bec6ee..3286162117a9 100644 --- a/reference/6/Microsoft.PowerShell.Core/Where-Object.md +++ b/reference/6/Microsoft.PowerShell.Core/Where-Object.md @@ -20,6 +20,11 @@ Selects objects from a collection based on their property values. Where-Object [-InputObject ] [-Property] [[-Value] ] [-EQ] [] ``` +### NotSet +``` +Where-Object [-Property] -Not [-InputObject ] [] +``` + ### ScriptBlockSet ``` Where-Object [-InputObject ] [-FilterScript] [] @@ -854,6 +859,25 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -Not +Indicates that this cmdlet gets objects if the property does not exist or has a value of null or false. + +For example: `Get-Service | where -Not "DependentServices"` + +This parameter was introduced in Windows PowerShell 6.1. + +```yaml +Type: SwitchParameter +Parameter Sets: Not +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -NotContains Indicates that this cmdlet gets objects if none of the items in the property value is an exact match for the specified value. From fb78f5decdfdd5f79d018a4f9e65bde1a3a4756f Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Tue, 10 Apr 2018 23:16:45 +0900 Subject: [PATCH 10/21] Update docs for support of new hostname format (#2321) * update remote cmdlets for new hostname syntax * update Enter-PSSession as well --- .../6/Microsoft.PowerShell.Core/Enter-PSSession.md | 8 ++++++-- .../6/Microsoft.PowerShell.Core/Invoke-Command.md | 11 ++++++++--- .../6/Microsoft.PowerShell.Core/New-PSSession.md | 14 ++++++++++---- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/reference/6/Microsoft.PowerShell.Core/Enter-PSSession.md b/reference/6/Microsoft.PowerShell.Core/Enter-PSSession.md index b688a08912cf..218d8496ae63 100644 --- a/reference/6/Microsoft.PowerShell.Core/Enter-PSSession.md +++ b/reference/6/Microsoft.PowerShell.Core/Enter-PSSession.md @@ -155,14 +155,14 @@ You can also use the **Exit** keyword to end the interactive session. ### Example 6: Start an interactive session using SSH ``` -PS C:\> Enter-PSSession -HostName LinuxServer01 -UserName UserA +PS C:\> Enter-PSSession -HostName UserA@LinuxServer01 ``` This example shows how to start an interactive session using Secure Shell (SSH). If SSH is configured on the remote computer to prompt for passwords then you will get a password prompt. Otherwise you will have to use SSH key based user authentication. ### Example 7: Start an interactive session using SSH and specify the Port and user authentication key ``` -PS C:\> Enter-PSSession -HostName LinuxServer02 -UserName UserA -Port 22 -KeyFilePath c:\\userAKey_rsa +PS C:\> Enter-PSSession -HostName UserA@LinuxServer02:22 -KeyFilePath c:\\userAKey_rsa ``` This example shows how to start an interactive session using SSH. It uses the *Port* parameter to specify the port to use and the *KeyFilePath* parameter to specify an RSA key used to authenticate the user on the remote computer. @@ -423,6 +423,10 @@ Accept wildcard characters: False ### -HostName Specifies a computer name for a Secure Shell (SSH) based connection. This is similar to the *ComputerName* parameter except that the connection to the remote computer is made using SSH rather than Windows WinRM. +This parameter supports specifying the user name and/or port as part of the host name parameter value using +the form `user@hostname:port`. +The user name and/or port specified as part of the host name takes precedent over the `-UserName` and `-Port` parameters, if specified. +This allows passing multiple computer names to this parameter where some have specific user names and/or ports, while others use the user name and/or port from the `-UserName` and `-Port` parameters. This parameter was introduced in PowerShell 6.0. diff --git a/reference/6/Microsoft.PowerShell.Core/Invoke-Command.md b/reference/6/Microsoft.PowerShell.Core/Invoke-Command.md index e205a87e3502..7d278959a200 100644 --- a/reference/6/Microsoft.PowerShell.Core/Invoke-Command.md +++ b/reference/6/Microsoft.PowerShell.Core/Invoke-Command.md @@ -491,21 +491,21 @@ To get the results of commands and scripts that run in disconnected sessions, us ### Example 17: Run a command on a remote computer using SSH ``` -PS C:\> Invoke-Command -HostName LinuxServer01 -UserName UserA -ScriptBlock { Get-MailBox * } +PS C:\> Invoke-Command -HostName UserA@LinuxServer01 -ScriptBlock { Get-MailBox * } ``` This example shows how to run a command on a remote computer using Secure Shell (SSH). If SSH is configured on the remote computer to prompt for passwords then you will get a password prompt. Otherwise you will have to use SSH key based user authentication. ### Example 18: Run a command on a remote computer using SSH and specify a user authentication key ``` -PS C:\> Invoke-Command -HostName LinuxServer01 -UserName UserA -ScriptBlock { Get-MailBox * } -KeyFilePath c:\\userAKey_rsa +PS C:\> Invoke-Command -HostName UserA@LinuxServer01 -ScriptBlock { Get-MailBox * } -KeyFilePath c:\\userAKey_rsa ``` This example shows how to run a command on a remote computer using SSH and specifying a key file for user authentication. You will not get a password prompt unless the key authentication fails and the remote computer is configured to allow basic password authentication. ### Example 19: Run a script file on multiple remote computers using SSH as a job ``` -PS C:\> $sshConnections = @{ HostName="WinServer1"; UserName="domain\userA"; KeyFilePath="c:\users\UserA\id_rsa" }, @{ HostName="LinuxServer5"; UserName="UserB"; KeyFilePath="c:\UserB\\id_rsa } +PS C:\> $sshConnections = @{ HostName="WinServer1"; UserName="domain\userA"; KeyFilePath="c:\users\UserA\id_rsa" }, @{ HostName="UserB@LinuxServer5"; KeyFilePath="c:\UserB\\id_rsa } PS C:\> $results = Invoke-Command -FilePath c:\Scripts\CollectEvents.ps1 -SSHConnection $sshConnections ``` @@ -1171,6 +1171,10 @@ Accept wildcard characters: False ### -HostName Specifies an array of computer names for a Secure Shell (SSH) based connection. This is similar to the ComputerName parameter except that the connection to the remote computer is made using SSH rather than Windows WinRM. +This parameter supports specifying the user name and/or port as part of the host name parameter value using +the form `user@hostname:port`. +The user name and/or port specified as part of the host name takes precedent over the `-UserName` and `-Port` parameters, if specified. +This allows passing multiple computer names to this parameter where some have specific user names and/or ports, while others use the user name and/or port from the `-UserName` and `-Port` parameters. This parameter was introduced in PowerShell 6.0. @@ -1251,6 +1255,7 @@ Accept wildcard characters: False This parameter takes an array of hashtables where each hashtable contains one or more connection parameters needed to establish a Secure Shell (SSH) connection (HostName, Port, UserName, KeyFilePath, Subsystem). The hashtable connection parameters are the same as defined for the HostName parameter set. +Note that the order of the keys in the hashtable result in user name and port being used for the connection where the last one specified is used. For example, if you use `@{UserName="first";HostName="second@host"}`, then the user name `second` will be used. However, if you use `@{HostName="second@host:22";Port=23}`, then port 23 will be used. The SSHConnection parameter is useful for creating multiple sessions where each session requires different connection information. diff --git a/reference/6/Microsoft.PowerShell.Core/New-PSSession.md b/reference/6/Microsoft.PowerShell.Core/New-PSSession.md index 61c3ac999bbf..bf826664115c 100644 --- a/reference/6/Microsoft.PowerShell.Core/New-PSSession.md +++ b/reference/6/Microsoft.PowerShell.Core/New-PSSession.md @@ -214,19 +214,19 @@ The value of the SessionOption parameter is the **SessionOption** object in the ### Example 12: Create a session using SSH ``` -PS C:\> New-PSSession -HostName LinuxServer01 -UserName UserA +PS C:\> New-PSSession -HostName UserA@LinuxServer01 ``` This example shows how to create a new **PSSession** using Secure Shell (SSH). If SSH is configured on the remote computer to prompt for passwords then you will get a password prompt. Otherwise you will have to use SSH key based user authentication. ### Example 13: Create a session using SSH and specify the port and user authentication key ``` -PS C:\> New-PSSession -HostName LinuxServer01 -UserName UserA -Port 22 -KeyFilePath c:\\userAKey_rsa +PS C:\> New-PSSession -HostName UserA@LinuxServer01:22 -KeyFilePath c:\\userAKey_rsa ``` This example shows how to create a **PSSession** using Secure Shell (SSH). It uses the *Port* parameter to specify the port to use and the *KeyFilePath* parameter to specify an RSA key used to identify and authenticate the user on the remote computer. ### Example 14: Create multiple sessions using SSH ``` -PS C:\> $sshConnections = @{ HostName="WinServer1"; UserName="domain\userA"; KeyFilePath="c:\users\UserA\id_rsa" }, @{ HostName="LinuxServer5"; UserName="UserB"; KeyFilePath="c:\UserB\\id_rsa } +PS C:\> $sshConnections = @{ HostName="WinServer1"; UserName="domain\userA"; KeyFilePath="c:\users\UserA\id_rsa" }, @{ HostName="UserB@LinuxServer5"; KeyFilePath="c:\UserB\\id_rsa } PS C:\> New-PSSession -SSHConnection $sshConnections ``` This example shows how to create multiple sessions using Secure Shell (SSH) and the **SSHConnection** parameter set. The *SSHConnection* parameter takes an array of hash tables that contain connection information for each session. Note that this example requires that the target remote computers have SSH configured to support key based user authentication. @@ -697,6 +697,10 @@ Accept wildcard characters: False ### -HostName Specifies an array of computer names for a Secure Shell (SSH) based connection. This is similar to the ComputerName parameter except that the connection to the remote computer is made using SSH rather than Windows WinRM. +This parameter supports specifying the user name and/or port as part of the host name parameter value using +the form `user@hostname:port`. +The user name and/or port specified as part of the host name takes precedent over the `-UserName` and `-Port` parameters, if specified. +This allows passing multiple computer names to this parameter where some have specific user names and/or ports, while others use the user name and/or port from the `-UserName` and `-Port` parameters. This parameter was introduced in PowerShell 6.0. @@ -777,10 +781,12 @@ Accept wildcard characters: False This parameter takes an array of hashtables where each hashtable contains one or more connection parameters needed to establish a Secure Shell (SSH) connection (HostName, Port, UserName, KeyFilePath, Subsystem). The hashtable connection parameters are the same as defined for the **HostName** parameter set. +Note that the order of the keys in the hashtable result in user name and port being used for the connection where the last one specified is used. For example, if you use `@{UserName="first";HostName="second@host"}`, then the user name `second` will be used. However, if you use `@{HostName="second@host:22";Port=23}`, then port 23 will be used. + +This parameter was introduced in PowerShell 6.0. The *SSHConnection* parameter is useful for creating multiple sessions where each session requires different connection information. -This parameter was introduced in PowerShell 6.0. ```yaml Type: hashtable From 7d0fb6e57a4e439dd0eb982cb7fe17fd62eb64c3 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Tue, 10 Apr 2018 23:18:02 +0900 Subject: [PATCH 11/21] update doc on new -workingdirectory parameter (#2320) --- .../6/Microsoft.PowerShell.Core/About/about_pwsh.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/reference/6/Microsoft.PowerShell.Core/About/about_pwsh.md b/reference/6/Microsoft.PowerShell.Core/About/about_pwsh.md index 96b5f918b08c..a52991f9e586 100644 --- a/reference/6/Microsoft.PowerShell.Core/About/about_pwsh.md +++ b/reference/6/Microsoft.PowerShell.Core/About/about_pwsh.md @@ -31,6 +31,7 @@ pwsh[.exe] [-NoProfile] [-OutputFormat {Text | XML}] [-WindowStyle