diff --git a/.openpublishing.redirection.json b/.openpublishing.redirection.json index daed14f40454..dfd5a347b34e 100644 --- a/.openpublishing.redirection.json +++ b/.openpublishing.redirection.json @@ -15,6 +15,21 @@ "redirect_url": "/powershell/wmf/readme", "redirect_document_id": "False" }, + { + "source_path": "reference/docs-conceptual/core-powershell/console-guide.md", + "redirect_url": "/powershell/scripting/core-powershell/console/powershell.exe-command-line-help", + "redirect_document_id": "False" + }, + { + "source_path": "reference/docs-conceptual/core-powershell/ise-guide.md", + "redirect_url": "/powershell/scripting/core-powershell/ise/introducing-the-windows-powershell-ise", + "redirect_document_id": "False" + }, + { + "source_path": "reference/docs-conceptual/getting-started/understanding-concepts-reference.md", + "redirect_url": "/powershell/scripting/getting-started/fundamental/about-windows-powershell", + "redirect_document_id": "False" + }, { "source_path": "reference/virtual-directory/index.md", "redirect_url": "/powershell/scripting/powershell-scripting", diff --git a/dsc/DSCAutomationHostEnabled.md b/dsc/DSCAutomationHostEnabled.md index 4a573f9de473..f433c4edf8fd 100644 --- a/dsc/DSCAutomationHostEnabled.md +++ b/dsc/DSCAutomationHostEnabled.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSCAutomationHostEnabled registry key diff --git a/dsc/DscForEngineers.md b/dsc/DscForEngineers.md index 024fd629cbfb..07977850c493 100644 --- a/dsc/DscForEngineers.md +++ b/dsc/DscForEngineers.md @@ -1,6 +1,5 @@ --- ms.date: 2017-10-13 -author: eslesar;mgreenegit ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Desired State Configuration Overview for Decision Makers @@ -112,15 +111,15 @@ Configuration Sample_Share # implement the logic of "how" to execute a task xSmbShare MySMBShare { - Ensure = "Present" + Ensure = "Present" Name = "MyShare" - Path = "C:\Demo\Temp" + Path = "C:\Demo\Temp" ReadAccess = "Alice" FullAccess = "Bob" Description = "This is an updated description for this share" } } -} +} #Run the function to compile the configuration Sample_Share #Pass the configuration to the nodes we defined and configure them diff --git a/dsc/PackageManagementDscResource.md b/dsc/PackageManagementDscResource.md index 9117da548e95..3e5bf9eebb4e 100644 --- a/dsc/PackageManagementDscResource.md +++ b/dsc/PackageManagementDscResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSC PackageManagement Resource diff --git a/dsc/PackageManagementSourceDscResource.md b/dsc/PackageManagementSourceDscResource.md index cadb83c4408f..8b87a836e99a 100644 --- a/dsc/PackageManagementSourceDscResource.md +++ b/dsc/PackageManagementSourceDscResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSC PackageManagementSource Resource diff --git a/dsc/archiveResource.md b/dsc/archiveResource.md index f3b6cb13e50b..9362dbdd4ace 100644 --- a/dsc/archiveResource.md +++ b/dsc/archiveResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSC Archive Resource @@ -12,7 +11,7 @@ title: DSC Archive Resource The Archive resource in Windows PowerShell Desired State Configuration (DSC) provides a mechanism to unpack archive (.zip) files at a specific path. -## Syntax +## Syntax ```MOF Archive [string] #ResourceName { @@ -28,15 +27,15 @@ Archive [string] #ResourceName ## Properties -| Property | Description | -|---|---| -| Destination| Specifies the location where you want to ensure the archive contents are extracted.| -| Path| Specifies the source path of the archive file.| -| __Checksum__| Defines the type to use when determining whether two files are the same. If __Checksum__ is not specified, only the file or directory name is used for comparison. Valid values include: SHA-1, SHA-256, SHA-512, createdDate, modifiedDate, none (default). If you specify __Checksum__ without __Validate__, the configuration will fail.| -| Ensure| Determines whether to check if the content of the archive exists at the __Destination__. Set this property to __Present__ to ensure the contents exist. Set it to __Absent__ to ensure they do not exist. The default value is __Present__.| -| DependsOn | Indicates that the configuration of another resource must run before this resource is configured. For example, if the ID of the resource configuration script block that you want to run first is ResourceName and its type is __ResourceType__, the syntax for using this property is `DependsOn = "[ResourceType]ResourceName"`.| -| Validate| Uses the Checksum property to determine if the archive matches the signature. If you specify Checksum without Validate, the configuration will fail. If you specify Validate without Checksum, a SHA-256 checksum is used by default.| -| Force| Certain file operations (such as overwriting a file or deleting a directory that is not empty) will result in an error. Using the Force property overrides such errors. The default value is False.| +| Property | Description | +|---|---| +| Destination| Specifies the location where you want to ensure the archive contents are extracted.| +| Path| Specifies the source path of the archive file.| +| __Checksum__| Defines the type to use when determining whether two files are the same. If __Checksum__ is not specified, only the file or directory name is used for comparison. Valid values include: SHA-1, SHA-256, SHA-512, createdDate, modifiedDate, none (default). If you specify __Checksum__ without __Validate__, the configuration will fail.| +| Ensure| Determines whether to check if the content of the archive exists at the __Destination__. Set this property to __Present__ to ensure the contents exist. Set it to __Absent__ to ensure they do not exist. The default value is __Present__.| +| DependsOn | Indicates that the configuration of another resource must run before this resource is configured. For example, if the ID of the resource configuration script block that you want to run first is ResourceName and its type is __ResourceType__, the syntax for using this property is `DependsOn = "[ResourceType]ResourceName"`.| +| Validate| Uses the Checksum property to determine if the archive matches the signature. If you specify Checksum without Validate, the configuration will fail. If you specify Validate without Checksum, a SHA-256 checksum is used by default.| +| Force| Certain file operations (such as overwriting a file or deleting a directory that is not empty) will result in an error. Using the Force property overrides such errors. The default value is False.| ## Example @@ -47,6 +46,6 @@ Archive ArchiveExample { Ensure = "Present" # You can also set Ensure to "Absent" Path = "C:\Users\Public\Documents\Test.zip" Destination = "C:\Users\Public\Documents\ExtractionPath" -} +} ``` diff --git a/dsc/authoringResource.md b/dsc/authoringResource.md index 01ea11d28003..fb3b6d256d33 100644 --- a/dsc/authoringResource.md +++ b/dsc/authoringResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Build Custom Windows PowerShell Desired State Configuration Resources @@ -16,9 +15,9 @@ Windows PowerShell Desired State Configuration (DSC) has built-in resources that A DSC resource is a Windows PowerShell module. The module contains both the schema (the definition of the configurable properties) and the implementation (the code that does the actual work specified by a configuration) for the resource. A DSC resource schema can be defined in a MOF file, and the implementation is performed by a script module. Beginning with the support of PowerShell classes in version 5, the schema and implementation can both be defined in a class. The following topics describe in more detail how to create DSC resources. -* [Writing a custom DSC resource with MOF](authoringResourceMOF.md) -* [Implementing a DSC resource in C#](authoringResourceMofCS.md) -* [Writing a custom DSC resource with PowerShell classes](authoringResourceClass.md) -* [Composite resources: Using a DSC configuration as a resource](authoringResourceComposite.md) -* [Using the Resource Designer tool](authoringResourceMofDesigner.md) +* [Writing a custom DSC resource with MOF](authoringResourceMOF.md) +* [Implementing a DSC resource in C#](authoringResourceMofCS.md) +* [Writing a custom DSC resource with PowerShell classes](authoringResourceClass.md) +* [Composite resources: Using a DSC configuration as a resource](authoringResourceComposite.md) +* [Using the Resource Designer tool](authoringResourceMofDesigner.md) diff --git a/dsc/authoringResourceClass.md b/dsc/authoringResourceClass.md index b2b1eeeb9d85..9b0fe40312a9 100644 --- a/dsc/authoringResourceClass.md +++ b/dsc/authoringResourceClass.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Writing a custom DSC resource with PowerShell classes diff --git a/dsc/authoringResourceComposite.md b/dsc/authoringResourceComposite.md index d80c6983b814..ae15b6ca8e62 100644 --- a/dsc/authoringResourceComposite.md +++ b/dsc/authoringResourceComposite.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Composite resources--Using a DSC configuration as a resource diff --git a/dsc/authoringResourceMOF.md b/dsc/authoringResourceMOF.md index 22e0d855381d..083e56bdfd58 100644 --- a/dsc/authoringResourceMOF.md +++ b/dsc/authoringResourceMOF.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Writing a custom DSC resource with MOF diff --git a/dsc/authoringResourceMofCS.md b/dsc/authoringResourceMofCS.md index 29e07ced8e7f..71a937078713 100644 --- a/dsc/authoringResourceMofCS.md +++ b/dsc/authoringResourceMofCS.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Authoring a DSC resource in C# diff --git a/dsc/authoringResourceMofDesigner.md b/dsc/authoringResourceMofDesigner.md index 9bf59707ba0d..16d205f1f9f9 100644 --- a/dsc/authoringResourceMofDesigner.md +++ b/dsc/authoringResourceMofDesigner.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Using the Resource Designer tool diff --git a/dsc/azureDsc.md b/dsc/azureDsc.md index 9d4fa6dd3ebe..28e88a4e9ee7 100644 --- a/dsc/azureDsc.md +++ b/dsc/azureDsc.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Using DSC on Microsoft Azure diff --git a/dsc/bootstrapDsc.md b/dsc/bootstrapDsc.md index e4ec966f0256..d59e1b218145 100644 --- a/dsc/bootstrapDsc.md +++ b/dsc/bootstrapDsc.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Configure a virtual machines at initial boot-up by using DSC diff --git a/dsc/builtInResource.md b/dsc/builtInResource.md index 735c92ac786d..0450ff90ba49 100644 --- a/dsc/builtInResource.md +++ b/dsc/builtInResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Built-In Windows PowerShell Desired State Configuration Resources diff --git a/dsc/compositeConfigs.md b/dsc/compositeConfigs.md index f29aa951ba0c..ada75d00a383 100644 --- a/dsc/compositeConfigs.md +++ b/dsc/compositeConfigs.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Nesting configurations diff --git a/dsc/configData.md b/dsc/configData.md index 62bcd1520241..514c8d06c62f 100644 --- a/dsc/configData.md +++ b/dsc/configData.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Using configuration data diff --git a/dsc/configDataCredentials.md b/dsc/configDataCredentials.md index 9e6efcebcc77..2ab781b0faae 100644 --- a/dsc/configDataCredentials.md +++ b/dsc/configDataCredentials.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Credentials Options in Configuration Data @@ -18,7 +17,10 @@ To suppress these error and warning messages use the DSC configuration data keyw * **PsDscAllowPlainTextPassword** * **PsDscAllowDomainUser** ->**Notes:**

Storing/transmitting plaintext passwords unencrypted is generally not secure. Securing credentials by using the techniques covered later in this topic is recommended.

The Azure Automation DSC service allows you to centrally manage credentials to be compiled in configurations and stored securely. For information, see: [Compiling DSC Configurations / Credential Assets](https://docs.microsoft.com/en-in/azure/automation/automation-dsc-compile#credential-assets)

+> [!NOTE] +> Storing/transmitting plaintext passwords unencrypted is generally not secure. Securing credentials by using the techniques covered later in this topic is recommended. +> The Azure Automation DSC service allows you to centrally manage credentials to be compiled in configurations and stored securely. +> For information, see: [Compiling DSC Configurations / Credential Assets](/azure/automation/automation-dsc-compile#credential-assets) The following is an example of passing plain text credentials: @@ -133,7 +135,8 @@ see [Running DSC with user credentials](runAsUser.md). Newer resources and custom resources can use this automatic property instead of creating their own property for credentials. ->**Note:** the design of some resources are to use multiple credentials for a specific reason, and they will have their own credential properties. +> [!NOTE] +> The design of some resources are to use multiple credentials for a specific reason, and they will have their own credential properties. To find the available credential properties on a resource use either `Get-DscResource -Name ResourceName -Syntax` @@ -228,8 +231,8 @@ for node 'localhost'. ``` This example has two issues: -1. An error explains that plain text passwords are not recommended -2. A warning advises against using a domain credential +1. An error explains that plain text passwords are not recommended +2. A warning advises against using a domain credential ## PsDscAllowPlainTextPassword @@ -276,10 +279,11 @@ $cred = Get-Credential -UserName contoso\genericuser -Message "Password please" DomainCredentialExample -DomainCredential $cred -ConfigurationData $cd ``` ->**Note:** `NodeName` cannot equal asterisk, a specific node name is mandatory. +> [!NOTE] +> `NodeName` cannot equal asterisk, a specific node name is mandatory. + +**Microsoft advises to avoid plain text passwords due to the significant security risk.** -**Microsoft advises to avoid plain text passwords -due to the significant security risk.** An exception would be when using the Azure Automation DSC service, only because the data is always stored encrypted (in transit, at rest in the service, and at rest on the node). @@ -291,8 +295,7 @@ still generates the warning that using a domain account for a credential is not Using a local account eliminates potential exposure of domain credentials that could be used on other servers. -**When using credentials with DSC resources, -prefer a local account over a domain account when possible.** +**When using credentials with DSC resources, prefer a local account over a domain account when possible.** If there is a '\' or '@' in the `Username` property of the credential, then DSC will treat it as a domain account. diff --git a/dsc/configHelp.md b/dsc/configHelp.md index 2aa7790b5d3f..c4b84abf93f1 100644 --- a/dsc/configHelp.md +++ b/dsc/configHelp.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Writing help for DSC configurations diff --git a/dsc/configurations.md b/dsc/configurations.md index d30cde9ba65b..8e374a7ba176 100644 --- a/dsc/configurations.md +++ b/dsc/configurations.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSC Configurations diff --git a/dsc/crossNodeDependencies.md b/dsc/crossNodeDependencies.md index 37e7a1bf7d2d..30c5253800a6 100644 --- a/dsc/crossNodeDependencies.md +++ b/dsc/crossNodeDependencies.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Specifying cross-node dependencies diff --git a/dsc/debugResource.md b/dsc/debugResource.md index 5d3d467bc782..56b723e4508d 100644 --- a/dsc/debugResource.md +++ b/dsc/debugResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Debugging DSC resources diff --git a/dsc/decisionMaker.md b/dsc/decisionMaker.md index 4698a44a2d1d..0ccd3492ed9f 100644 --- a/dsc/decisionMaker.md +++ b/dsc/decisionMaker.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Desired State Configuration Overview for Decision Makers diff --git a/dsc/directCallResource.md b/dsc/directCallResource.md index 5609691d6407..755d03c2f7b6 100644 --- a/dsc/directCallResource.md +++ b/dsc/directCallResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Calling DSC resource methods directly diff --git a/dsc/docfx.json b/dsc/docfx.json index 8a0ca570ced8..8d4d435b0573 100644 --- a/dsc/docfx.json +++ b/dsc/docfx.json @@ -13,7 +13,6 @@ "breadcrumb_path":"bread/toc.json", "uhfHeaderId": "MSDocsHeader-Powershell", "layout": "conceptual", - "ms.locale": "en-us", "ROBOTS": "INDEX, FOLLOW", "ms.prod": "powershell", "ms.technology": "dsc", diff --git a/dsc/dscCiCd.md b/dsc/dscCiCd.md index 37e2fbe01912..b6fa3b662e17 100644 --- a/dsc/dscCiCd.md +++ b/dsc/dscCiCd.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Building a Continuous Integration and Continuous Deployment pipeline with DSC diff --git a/dsc/dscExamples.md b/dsc/dscExamples.md index 0cce01d20e70..abf3d75fc0d2 100644 --- a/dsc/dscExamples.md +++ b/dsc/dscExamples.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSC Examples diff --git a/dsc/enactingConfigurations.md b/dsc/enactingConfigurations.md index b036558181e0..ad90ea1563b5 100644 --- a/dsc/enactingConfigurations.md +++ b/dsc/enactingConfigurations.md @@ -1,6 +1,5 @@ --- ms.date: 2017-10-16 -author: eslesar;mgreenegit ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Enacting configurations @@ -27,7 +26,7 @@ For example, if the configuration MOF is located at `C:\DSC\Configurations\local you would apply it to the local machine with the following command: `Start-DscConfiguration -Path 'C:\DSC\Configurations'` -> __Note__: By default, DSC runs a configuration as a background job. To run the configuration interactively, call the +> __Note__: By default, DSC runs a configuration as a background job. To run the configuration interactively, call the >[Start-DscConfiguration](https://technet.microsoft.com/library/dn521623.aspx) with the __-Wait__ parameter. ## Pull mode diff --git a/dsc/environmentResource.md b/dsc/environmentResource.md index cdd5db82550b..bed250e387ff 100644 --- a/dsc/environmentResource.md +++ b/dsc/environmentResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSC Environment Resource diff --git a/dsc/fileResource.md b/dsc/fileResource.md index 32d8087cf889..ad322b80d5eb 100644 --- a/dsc/fileResource.md +++ b/dsc/fileResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSC File Resource diff --git a/dsc/gettingStarted.md b/dsc/gettingStarted.md index 5628584a0d58..b9f2608ecb1b 100644 --- a/dsc/gettingStarted.md +++ b/dsc/gettingStarted.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Getting Started with PowerShell Desired State Configuration diff --git a/dsc/groupSetResource.md b/dsc/groupSetResource.md index 938f782ba871..a4a73cc370f7 100644 --- a/dsc/groupSetResource.md +++ b/dsc/groupSetResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup description: Provides a mechanism to manage local groups on the target node. diff --git a/dsc/lnxArchiveResource.md b/dsc/lnxArchiveResource.md index 34d293deb9af..76e1123c1bea 100644 --- a/dsc/lnxArchiveResource.md +++ b/dsc/lnxArchiveResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSC for Linux nxArchive Resource diff --git a/dsc/lnxBuiltInResources.md b/dsc/lnxBuiltInResources.md index 346a682f54e7..69c0e03b0d1f 100644 --- a/dsc/lnxBuiltInResources.md +++ b/dsc/lnxBuiltInResources.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Built-In Desired State Configuration Resources for Linux diff --git a/dsc/lnxEnvironmentResource.md b/dsc/lnxEnvironmentResource.md index 502d7e85d97e..6d2200230525 100644 --- a/dsc/lnxEnvironmentResource.md +++ b/dsc/lnxEnvironmentResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSC for Linux nxEnvironment Resource diff --git a/dsc/lnxFileLineResource.md b/dsc/lnxFileLineResource.md index 89ba684c6ab1..e918d19399c3 100644 --- a/dsc/lnxFileLineResource.md +++ b/dsc/lnxFileLineResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSC for Linux nxFileLine Resource diff --git a/dsc/lnxFileResource.md b/dsc/lnxFileResource.md index 8efc800fb76e..3ef39b207ff6 100644 --- a/dsc/lnxFileResource.md +++ b/dsc/lnxFileResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSC for Linux nxFile Resource diff --git a/dsc/lnxGettingStarted.md b/dsc/lnxGettingStarted.md index f95069df5f21..83340b3c701b 100644 --- a/dsc/lnxGettingStarted.md +++ b/dsc/lnxGettingStarted.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Get started with Desired State Configuration (DSC) for Linux diff --git a/dsc/lnxGroupResource.md b/dsc/lnxGroupResource.md index b4ce43e5d6c7..ff1fc9fb5536 100644 --- a/dsc/lnxGroupResource.md +++ b/dsc/lnxGroupResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSC for Linux nxGroup Resource diff --git a/dsc/lnxPackageResource.md b/dsc/lnxPackageResource.md index 58c7928bb681..3caf6a2f5af7 100644 --- a/dsc/lnxPackageResource.md +++ b/dsc/lnxPackageResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSC for Linux nxPackage Resource diff --git a/dsc/lnxScriptResource.md b/dsc/lnxScriptResource.md index c37bb344d0ac..5242a682b36c 100644 --- a/dsc/lnxScriptResource.md +++ b/dsc/lnxScriptResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSC for Linux nxScript Resource diff --git a/dsc/lnxServiceResource.md b/dsc/lnxServiceResource.md index 80ad7cd6d660..9aa349140482 100644 --- a/dsc/lnxServiceResource.md +++ b/dsc/lnxServiceResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSC for Linux nxService Resource diff --git a/dsc/lnxSshAuthorizedKeysResource.md b/dsc/lnxSshAuthorizedKeysResource.md index e1555dbe7357..687a17e039f1 100644 --- a/dsc/lnxSshAuthorizedKeysResource.md +++ b/dsc/lnxSshAuthorizedKeysResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSC for Linux nxSshAuthorizedKeys Resource diff --git a/dsc/lnxUserResource.md b/dsc/lnxUserResource.md index 12cb1b5502eb..3506ec8c5f9e 100644 --- a/dsc/lnxUserResource.md +++ b/dsc/lnxUserResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSC for Linux nxUser Resource diff --git a/dsc/logResource.md b/dsc/logResource.md index 6d620d08621b..3005c026e1ce 100644 --- a/dsc/logResource.md +++ b/dsc/logResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSC Log Resource diff --git a/dsc/metaConfig.md b/dsc/metaConfig.md index 6992810d6307..64f864bd5556 100644 --- a/dsc/metaConfig.md +++ b/dsc/metaConfig.md @@ -1,6 +1,5 @@ --- ms.date: 2017-10-11 -author: eslesar;mgreenegit ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Configuring the Local Configuration Manager @@ -46,7 +45,7 @@ configuration LCMConfig RefreshMode = 'Push' } } -} +} ``` The process of applying settings to LCM is similar to applying a DSC configuration. @@ -144,7 +143,7 @@ you create a **ConfigurationRepositoryWeb** block. A **ConfigurationRepositoryWeb** defines the following properties. |Property|Type|Description| -|---|---|---| +|---|---|---| |AllowUnsecureConnection|bool|Set to **$TRUE** to allow connections from the node to the server without authentication. Set to **$FALSE** to require authentication.| |CertificateID|string|The thumbprint of a certificate used to authenticate to the server.| |ConfigurationNames|String[]|An array of names of configurations to be pulled by the target node. These are used only if the node is registered with the pull service by using a **RegistrationKey**. For more information, see [Setting up a pull client with configuration names](pullClientConfigNames.md).| @@ -211,7 +210,7 @@ see [DSC Partial configurations](partialConfigs.md). **PartialConfiguration** defines the following properties. |Property|Type|Description| -|---|---|---| +|---|---|---| |ConfigurationSource|string[]|An array of names of configuration servers, previously defined in **ConfigurationRepositoryWeb** and **ConfigurationRepositoryShare** blocks, where the partial configuration is pulled from.| |DependsOn|string{}|A list of names of other configurations that must be completed before this partial configuration is applied.| |Description|string|Text used to describe the partial configuration.| @@ -221,11 +220,11 @@ see [DSC Partial configurations](partialConfigs.md). __Note:__ partial configurations are supported with Azure Automation DSC, but only one configuration can be pulled from each automation account per node. -## See Also +## See Also ### Concepts [Desired State Configuration Overview](overview.md) - + [Getting started with Azure Automation DSC](https://docs.microsoft.com/en-us/azure/automation/automation-dsc-getting-started) ### Other Resources diff --git a/dsc/metaConfig4.md b/dsc/metaConfig4.md index 32644e5ff88b..467225674575 100644 --- a/dsc/metaConfig4.md +++ b/dsc/metaConfig4.md @@ -1,6 +1,5 @@ --- ms.date: 2017-10-12 -author: eslesar;mgreenegit ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Windows PowerShell 4.0 Desired State Configuration Local Configuration Manager (LCM) diff --git a/dsc/msft-dsclocalconfigurationmanager-applyconfiguration.md b/dsc/msft-dsclocalconfigurationmanager-applyconfiguration.md index 93483f161a97..29b6184c204d 100644 --- a/dsc/msft-dsclocalconfigurationmanager-applyconfiguration.md +++ b/dsc/msft-dsclocalconfigurationmanager-applyconfiguration.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: ApplyConfiguration method of the MSFT_DSCLocalConfigurationManager class diff --git a/dsc/msft-dsclocalconfigurationmanager-disabledebugconfiguration.md b/dsc/msft-dsclocalconfigurationmanager-disabledebugconfiguration.md index 171847d508bc..69a69fc2e037 100644 --- a/dsc/msft-dsclocalconfigurationmanager-disabledebugconfiguration.md +++ b/dsc/msft-dsclocalconfigurationmanager-disabledebugconfiguration.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DisableDebugConfiguration method of the MSFT_DSCLocalConfigurationManager class diff --git a/dsc/msft-dsclocalconfigurationmanager-enabledebugconfiguration.md b/dsc/msft-dsclocalconfigurationmanager-enabledebugconfiguration.md index 43fbc2fbccc8..a3fdefad9f01 100644 --- a/dsc/msft-dsclocalconfigurationmanager-enabledebugconfiguration.md +++ b/dsc/msft-dsclocalconfigurationmanager-enabledebugconfiguration.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: EnableDebugConfiguration method of the MSFT_DSCLocalConfigurationManager class diff --git a/dsc/msft-dsclocalconfigurationmanager-getconfiguration.md b/dsc/msft-dsclocalconfigurationmanager-getconfiguration.md index 6f78a4ea05ef..22d0b4484eed 100644 --- a/dsc/msft-dsclocalconfigurationmanager-getconfiguration.md +++ b/dsc/msft-dsclocalconfigurationmanager-getconfiguration.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: GetConfiguration method of the MSFT_DSCLocalConfigurationManager class diff --git a/dsc/msft-dsclocalconfigurationmanager-getconfigurationresultoutput.md b/dsc/msft-dsclocalconfigurationmanager-getconfigurationresultoutput.md index 25d759826769..a33ad24c8294 100644 --- a/dsc/msft-dsclocalconfigurationmanager-getconfigurationresultoutput.md +++ b/dsc/msft-dsclocalconfigurationmanager-getconfigurationresultoutput.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: GetConfigurationResultOutput method of the MSFT_DSCLocalConfigurationManager class diff --git a/dsc/msft-dsclocalconfigurationmanager-getconfigurationstatus.md b/dsc/msft-dsclocalconfigurationmanager-getconfigurationstatus.md index cddda3642bf9..5b2ff8bfe2e9 100644 --- a/dsc/msft-dsclocalconfigurationmanager-getconfigurationstatus.md +++ b/dsc/msft-dsclocalconfigurationmanager-getconfigurationstatus.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: GetConfigurationStatus method of the MSFT_DSCLocalConfigurationManager class diff --git a/dsc/msft-dsclocalconfigurationmanager-getmetaconfiguration.md b/dsc/msft-dsclocalconfigurationmanager-getmetaconfiguration.md index 88e502e3ac3f..129212e51841 100644 --- a/dsc/msft-dsclocalconfigurationmanager-getmetaconfiguration.md +++ b/dsc/msft-dsclocalconfigurationmanager-getmetaconfiguration.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: GetMetaConfiguration method of the MSFT_DSCLocalConfigurationManager class diff --git a/dsc/msft-dsclocalconfigurationmanager-performrequiredconfigurationchecks.md b/dsc/msft-dsclocalconfigurationmanager-performrequiredconfigurationchecks.md index b04d4ec0170d..46ebed5960e4 100644 --- a/dsc/msft-dsclocalconfigurationmanager-performrequiredconfigurationchecks.md +++ b/dsc/msft-dsclocalconfigurationmanager-performrequiredconfigurationchecks.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: PerformRequiredConfigurationChecks method of the MSFT_DSCLocalConfigurationManager class diff --git a/dsc/msft-dsclocalconfigurationmanager-removeconfiguration.md b/dsc/msft-dsclocalconfigurationmanager-removeconfiguration.md index 9d25e2d934b3..16df11d6bd12 100644 --- a/dsc/msft-dsclocalconfigurationmanager-removeconfiguration.md +++ b/dsc/msft-dsclocalconfigurationmanager-removeconfiguration.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: RemoveConfiguration method of the MSFT_DSCLocalConfigurationManager class diff --git a/dsc/msft-dsclocalconfigurationmanager-resourceget.md b/dsc/msft-dsclocalconfigurationmanager-resourceget.md index b9c3153b8f08..3476d34f39dc 100644 --- a/dsc/msft-dsclocalconfigurationmanager-resourceget.md +++ b/dsc/msft-dsclocalconfigurationmanager-resourceget.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: ResourceGet method of the MSFT_DSCLocalConfigurationManager class diff --git a/dsc/msft-dsclocalconfigurationmanager-resourceset.md b/dsc/msft-dsclocalconfigurationmanager-resourceset.md index 746fe8bb4e0a..48daddbc27ff 100644 --- a/dsc/msft-dsclocalconfigurationmanager-resourceset.md +++ b/dsc/msft-dsclocalconfigurationmanager-resourceset.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: ResourceSet method of the MSFT_DSCLocalConfigurationManager class diff --git a/dsc/msft-dsclocalconfigurationmanager-resourcetest.md b/dsc/msft-dsclocalconfigurationmanager-resourcetest.md index fc842ffdf86a..fb0375f263fd 100644 --- a/dsc/msft-dsclocalconfigurationmanager-resourcetest.md +++ b/dsc/msft-dsclocalconfigurationmanager-resourcetest.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: ResourceTest method of the MSFT_DSCLocalConfigurationManager class diff --git a/dsc/msft-dsclocalconfigurationmanager-rollback.md b/dsc/msft-dsclocalconfigurationmanager-rollback.md index 6f0c058dbb1f..6392f5ab3e99 100644 --- a/dsc/msft-dsclocalconfigurationmanager-rollback.md +++ b/dsc/msft-dsclocalconfigurationmanager-rollback.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: RollBack method of the MSFT_DSCLocalConfigurationManager class diff --git a/dsc/msft-dsclocalconfigurationmanager-sendconfiguration.md b/dsc/msft-dsclocalconfigurationmanager-sendconfiguration.md index 5a6bd3462d4c..41ebd15265b5 100644 --- a/dsc/msft-dsclocalconfigurationmanager-sendconfiguration.md +++ b/dsc/msft-dsclocalconfigurationmanager-sendconfiguration.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: SendConfiguration method of the MSFT_DSCLocalConfigurationManager class diff --git a/dsc/msft-dsclocalconfigurationmanager-sendconfigurationapply.md b/dsc/msft-dsclocalconfigurationmanager-sendconfigurationapply.md index 1d062f91bbf2..1856e4ab7a32 100644 --- a/dsc/msft-dsclocalconfigurationmanager-sendconfigurationapply.md +++ b/dsc/msft-dsclocalconfigurationmanager-sendconfigurationapply.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: SendConfigurationApply method of the MSFT_DSCLocalConfigurationManager class diff --git a/dsc/msft-dsclocalconfigurationmanager-sendconfigurationapplyasync.md b/dsc/msft-dsclocalconfigurationmanager-sendconfigurationapplyasync.md index cd39f3189fd5..0486adafae62 100644 --- a/dsc/msft-dsclocalconfigurationmanager-sendconfigurationapplyasync.md +++ b/dsc/msft-dsclocalconfigurationmanager-sendconfigurationapplyasync.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: SendConfigurationApplyAsync method of the MSFT_DSCLocalConfigurationManager class diff --git a/dsc/msft-dsclocalconfigurationmanager-sendmetaconfigurationapply.md b/dsc/msft-dsclocalconfigurationmanager-sendmetaconfigurationapply.md index e74c01f11840..f9f52773014b 100644 --- a/dsc/msft-dsclocalconfigurationmanager-sendmetaconfigurationapply.md +++ b/dsc/msft-dsclocalconfigurationmanager-sendmetaconfigurationapply.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: SendMetaConfigurationApply method of the MSFT_DSCLocalConfigurationManager class diff --git a/dsc/msft-dsclocalconfigurationmanager-stopconfiguration.md b/dsc/msft-dsclocalconfigurationmanager-stopconfiguration.md index 2920060425d7..29ec1b689e76 100644 --- a/dsc/msft-dsclocalconfigurationmanager-stopconfiguration.md +++ b/dsc/msft-dsclocalconfigurationmanager-stopconfiguration.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: StopConfiguration method of the MSFT_DSCLocalConfigurationManager class diff --git a/dsc/msft-dsclocalconfigurationmanager-testconfiguration.md b/dsc/msft-dsclocalconfigurationmanager-testconfiguration.md index 551d26e2c7e3..b9c2557aed72 100644 --- a/dsc/msft-dsclocalconfigurationmanager-testconfiguration.md +++ b/dsc/msft-dsclocalconfigurationmanager-testconfiguration.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: TestConfiguration method of the MSFT_DSCLocalConfigurationManager class diff --git a/dsc/msft-dsclocalconfigurationmanager.md b/dsc/msft-dsclocalconfigurationmanager.md index c5a764680e84..31272389e85e 100644 --- a/dsc/msft-dsclocalconfigurationmanager.md +++ b/dsc/msft-dsclocalconfigurationmanager.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: MSFT_DSCLocalConfigurationManager class diff --git a/dsc/nanoDsc.md b/dsc/nanoDsc.md index b66ea720d6b1..07ff9160b5fd 100644 --- a/dsc/nanoDsc.md +++ b/dsc/nanoDsc.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Using DSC on Nano Server diff --git a/dsc/overview.md b/dsc/overview.md index f60e77da4c37..edfaafe7638f 100644 --- a/dsc/overview.md +++ b/dsc/overview.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Windows PowerShell Desired State Configuration Overview diff --git a/dsc/packageResource.md b/dsc/packageResource.md index fceef095449c..7a3b27f5af90 100644 --- a/dsc/packageResource.md +++ b/dsc/packageResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSC Package Resource diff --git a/dsc/partialConfigs.md b/dsc/partialConfigs.md index 1ed916c1d422..e75790fb5821 100644 --- a/dsc/partialConfigs.md +++ b/dsc/partialConfigs.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: PowerShell Desired State Configuration partial configurations diff --git a/dsc/processSetResource.md b/dsc/processSetResource.md index 3c75a3444d16..bc08e284ae08 100644 --- a/dsc/processSetResource.md +++ b/dsc/processSetResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSC ProcessSet Resource diff --git a/dsc/pullClient.md b/dsc/pullClient.md index d795ea432738..611d95840b39 100644 --- a/dsc/pullClient.md +++ b/dsc/pullClient.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Setting up a DSC pull client diff --git a/dsc/pullClientConfigID.md b/dsc/pullClientConfigID.md index d66b6d440e1f..8734c3902cd7 100644 --- a/dsc/pullClientConfigID.md +++ b/dsc/pullClientConfigID.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Setting up a pull client using configuration ID diff --git a/dsc/pullClientConfigID4.md b/dsc/pullClientConfigID4.md index 19699aea09f0..44423b8af9ef 100644 --- a/dsc/pullClientConfigID4.md +++ b/dsc/pullClientConfigID4.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Setting up a pull client using configuration ID in PowerShell 4.0 diff --git a/dsc/pullClientConfigNames.md b/dsc/pullClientConfigNames.md index 5cc594a88f82..0bba50910c7b 100644 --- a/dsc/pullClientConfigNames.md +++ b/dsc/pullClientConfigNames.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Setting up a pull client using configuration names diff --git a/dsc/pullServer.md b/dsc/pullServer.md index 4d331893fe9d..8d6be97ab283 100644 --- a/dsc/pullServer.md +++ b/dsc/pullServer.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Setting up a DSC web pull server diff --git a/dsc/pullServerSMB.md b/dsc/pullServerSMB.md index e2a33b257152..46164c051d97 100644 --- a/dsc/pullServerSMB.md +++ b/dsc/pullServerSMB.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Setting up a DSC SMB pull server diff --git a/dsc/queryServerNodes.md b/dsc/queryServerNodes.md index e010f183e321..24cf59764d69 100644 --- a/dsc/queryServerNodes.md +++ b/dsc/queryServerNodes.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSC function to query node information from pull server. diff --git a/dsc/quickStart.md b/dsc/quickStart.md index 702df60ddc5d..e67a6ab45d54 100644 --- a/dsc/quickStart.md +++ b/dsc/quickStart.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Desired State Configuration Quick Start diff --git a/dsc/registryResource.md b/dsc/registryResource.md index 7873455f5736..963e5ae225e9 100644 --- a/dsc/registryResource.md +++ b/dsc/registryResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSC Registry Resource diff --git a/dsc/reportServer.md b/dsc/reportServer.md index 1e1fface368e..225ca13f683f 100644 --- a/dsc/reportServer.md +++ b/dsc/reportServer.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Using a DSC report server diff --git a/dsc/resourceAuthoringChecklist.md b/dsc/resourceAuthoringChecklist.md index 016972497b81..63271524614a 100644 --- a/dsc/resourceAuthoringChecklist.md +++ b/dsc/resourceAuthoringChecklist.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Resource authoring checklist diff --git a/dsc/resources.md b/dsc/resources.md index ca7f8e027e82..1eb299d04034 100644 --- a/dsc/resources.md +++ b/dsc/resources.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSC Resources diff --git a/dsc/runAsUser.md b/dsc/runAsUser.md index e7eae34079cc..0161d5880579 100644 --- a/dsc/runAsUser.md +++ b/dsc/runAsUser.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Running DSC with user credentials diff --git a/dsc/scriptResource.md b/dsc/scriptResource.md index 57d83484638f..c10a1e8ca73e 100644 --- a/dsc/scriptResource.md +++ b/dsc/scriptResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSC Script Resource diff --git a/dsc/secureMOF.md b/dsc/secureMOF.md index 1fc354b06969..3e3505500462 100644 --- a/dsc/secureMOF.md +++ b/dsc/secureMOF.md @@ -1,6 +1,5 @@ --- ms.date: 2017-10-31 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Securing the MOF File @@ -99,7 +98,7 @@ The following example: 3. imports the public key certificate into the **my** certificate store on the **Authoring node**. #### On the Target Node: create and export the certificate ->Authoring Node: Windows Server 2016 and Windows 10 +>Target Node: Windows Server 2016 and Windows 10 ```powershell # note: These steps need to be performed in an Administrator PowerShell session @@ -109,7 +108,7 @@ $cert | Export-Certificate -FilePath "$env:temp\DscPublicKey.cer" -Force ``` Once exported, the ```DscPublicKey.cer``` would need to be copied to the **Authoring Node**. ->Authoring Node: Windows Server 2012 R2/Windows 8.1 and earlier +>Target Node: Windows Server 2012 R2/Windows 8.1 and earlier Because the New-SelfSignedCertificate cmdlet on Windows Operating Systems prior to Windows 10 and Windows Server 2016 do not support the **Type** parameter, an alternate method of creating this certificate is required on these operating systems. In this case you can use ```makecert.exe``` or ```certutil.exe``` to create the certificate. @@ -127,7 +126,6 @@ New-SelfsignedCertificateEx ` -FriendlyName 'DSC Credential Encryption certificate' ` -Exportable ` -StoreLocation 'LocalMachine' ` - -StoreName 'My' ` -KeyLength 2048 ` -ProviderName 'Microsoft Enhanced Cryptographic Provider v1.0' ` -AlgorithmName 'RSA' ` diff --git a/dsc/secureServer.md b/dsc/secureServer.md index ae8b72abd232..fd07448a0b2b 100644 --- a/dsc/secureServer.md +++ b/dsc/secureServer.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Pull server best practices diff --git a/dsc/separatingEnvData.md b/dsc/separatingEnvData.md index cb229942ea49..67bbb51e1128 100644 --- a/dsc/separatingEnvData.md +++ b/dsc/separatingEnvData.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Separating configuration and environment data diff --git a/dsc/serviceResource.md b/dsc/serviceResource.md index ae78593551e2..a17cacbc4fc8 100644 --- a/dsc/serviceResource.md +++ b/dsc/serviceResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSC Service Resource diff --git a/dsc/serviceSetResource.md b/dsc/serviceSetResource.md index 72c4450ebca2..37693ebf36f3 100644 --- a/dsc/serviceSetResource.md +++ b/dsc/serviceSetResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSC ServiceSet Resource diff --git a/dsc/singleInstance.md b/dsc/singleInstance.md index 55827993e962..c124b72f0b0a 100644 --- a/dsc/singleInstance.md +++ b/dsc/singleInstance.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Writing a single-instance DSC resource (best practice) diff --git a/dsc/sxsResource.md b/dsc/sxsResource.md index 5163ecae4f45..05529c9e8497 100644 --- a/dsc/sxsResource.md +++ b/dsc/sxsResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Using resources with multiple versions diff --git a/dsc/troubleshooting.md b/dsc/troubleshooting.md index 9c32abfaaf84..56281c9f3f67 100644 --- a/dsc/troubleshooting.md +++ b/dsc/troubleshooting.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Troubleshooting DSC diff --git a/dsc/userResource.md b/dsc/userResource.md index f2bf53ba5dfb..3fee140743f1 100644 --- a/dsc/userResource.md +++ b/dsc/userResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSC User Resource diff --git a/dsc/waitForAllResource.md b/dsc/waitForAllResource.md index fb8f6357d039..d242f4ea8e11 100644 --- a/dsc/waitForAllResource.md +++ b/dsc/waitForAllResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSC WaitForAll Resource diff --git a/dsc/waitForAnyResource.md b/dsc/waitForAnyResource.md index a051e0447383..08aced75cc0a 100644 --- a/dsc/waitForAnyResource.md +++ b/dsc/waitForAnyResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSC WaitForAny Resource diff --git a/dsc/waitForSomeResource.md b/dsc/waitForSomeResource.md index 82b23aca68bc..46505c636f0d 100644 --- a/dsc/waitForSomeResource.md +++ b/dsc/waitForSomeResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSC WaitForSome Resource diff --git a/dsc/whitepapers.md b/dsc/whitepapers.md index ccff72f051f5..96c7ab036c86 100644 --- a/dsc/whitepapers.md +++ b/dsc/whitepapers.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: Whitepapers diff --git a/dsc/windowsFeatureSetResource.md b/dsc/windowsFeatureSetResource.md index a3edba4cf56f..7e5ba1e7ef38 100644 --- a/dsc/windowsFeatureSetResource.md +++ b/dsc/windowsFeatureSetResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSC WindowsFeatureSet Resource diff --git a/dsc/windowsOptionalFeatureResource.md b/dsc/windowsOptionalFeatureResource.md index 09b91140c92a..0b6d7775c878 100644 --- a/dsc/windowsOptionalFeatureResource.md +++ b/dsc/windowsOptionalFeatureResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSC WindowsOptionalFeature Resource diff --git a/dsc/windowsOptionalFeatureSetResource.md b/dsc/windowsOptionalFeatureSetResource.md index 6fa9fc8fe1bd..df794644d0ab 100644 --- a/dsc/windowsOptionalFeatureSetResource.md +++ b/dsc/windowsOptionalFeatureSetResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSC WindowsOptionalFeatureSet Resource diff --git a/dsc/windowsPackageCabResource.md b/dsc/windowsPackageCabResource.md index aa01ee632bd2..9e9da0869527 100644 --- a/dsc/windowsPackageCabResource.md +++ b/dsc/windowsPackageCabResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSC WindowsPackageCab Resource diff --git a/dsc/windowsProcessResource.md b/dsc/windowsProcessResource.md index 3bc9d43a38db..e96a07109630 100644 --- a/dsc/windowsProcessResource.md +++ b/dsc/windowsProcessResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSC WindowsProcess Resource diff --git a/dsc/windowsfeatureResource.md b/dsc/windowsfeatureResource.md index 344c32529e68..54cc943eee23 100644 --- a/dsc/windowsfeatureResource.md +++ b/dsc/windowsfeatureResource.md @@ -1,6 +1,5 @@ --- ms.date: 2017-06-12 -author: eslesar ms.topic: conceptual keywords: dsc,powershell,configuration,setup title: DSC WindowsFeature Resource diff --git a/gallery/index.md b/gallery/index.md deleted file mode 100644 index d52e9bb0f2ae..000000000000 --- a/gallery/index.md +++ /dev/null @@ -1,3 +0,0 @@ ---- -redirect_url: readme ---- diff --git a/jea/index.md b/jea/index.md deleted file mode 100644 index 5d11197e6073..000000000000 --- a/jea/index.md +++ /dev/null @@ -1,3 +0,0 @@ ---- -redirect_url: overview ---- diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_Requires.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_Requires.md index c2e71e2f1753..469c02279ace 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_Requires.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_Requires.md @@ -98,19 +98,6 @@ For example, #Requires -ShellId MyLocalShell ``` --RunAsAdministrator - -When this switch parameter is added to your requires statement, it specifies -that the Windows PowerShell session in which you are running the script must -be started with elevated user rights (Run as Administrator). This switch was -introduced in PowerShell 4. - -For example, - -```powershell -#Requires -RunAsAdministrator -``` - ### EXAMPLES The following script has two \#Requires statements. If the requirements diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_WS-Management_Cmdlets.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_WS-Management_Cmdlets.md index 1b6877370de4..1c2f2843c295 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_WS-Management_Cmdlets.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_WS-Management_Cmdlets.md @@ -185,8 +185,6 @@ http://go.microsoft.com/fwlink/?LinkId=142329 [Set-WSManQuickConfig](../../Microsoft.WSMan.Management/Set-WSManQuickConfig.md) -[Set-WSManSessionOption](../../Microsoft.WSMan.Management/Set-WSManSessionOption.md) - [Test-WSMan](../../Microsoft.WSMan.Management/Test-WSMan.md) # KEYWORDS diff --git a/reference/4.0/Microsoft.PowerShell.Core/About/about_Requires.md b/reference/4.0/Microsoft.PowerShell.Core/About/about_Requires.md index c2e71e2f1753..0a46dc1445d9 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/About/about_Requires.md +++ b/reference/4.0/Microsoft.PowerShell.Core/About/about_Requires.md @@ -102,8 +102,7 @@ For example, When this switch parameter is added to your requires statement, it specifies that the Windows PowerShell session in which you are running the script must -be started with elevated user rights (Run as Administrator). This switch was -introduced in PowerShell 4. +be started with elevated user rights (Run as Administrator). For example, diff --git a/reference/4.0/Microsoft.PowerShell.Core/About/about_WS-Management_Cmdlets.md b/reference/4.0/Microsoft.PowerShell.Core/About/about_WS-Management_Cmdlets.md index 1b6877370de4..1c2f2843c295 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/About/about_WS-Management_Cmdlets.md +++ b/reference/4.0/Microsoft.PowerShell.Core/About/about_WS-Management_Cmdlets.md @@ -185,8 +185,6 @@ http://go.microsoft.com/fwlink/?LinkId=142329 [Set-WSManQuickConfig](../../Microsoft.WSMan.Management/Set-WSManQuickConfig.md) -[Set-WSManSessionOption](../../Microsoft.WSMan.Management/Set-WSManSessionOption.md) - [Test-WSMan](../../Microsoft.WSMan.Management/Test-WSMan.md) # KEYWORDS diff --git a/reference/4.0/Microsoft.PowerShell.Core/About/about_desiredstateconfiguration.md b/reference/4.0/Microsoft.PowerShell.Core/About/about_desiredstateconfiguration.md index 986f4d855fbc..81758fca1960 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/About/about_desiredstateconfiguration.md +++ b/reference/4.0/Microsoft.PowerShell.Core/About/about_desiredstateconfiguration.md @@ -30,13 +30,6 @@ For detailed information about DSC, see [PowerShell Desired State Configuration Overview](http://go.microsoft.com/fwlink/?LinkId=311940) in the TechNet Library. -## DEVELOPING DSC RESOURCES WITH CLASSES - -Starting in PowerShell 5.0, you can develop DSC resources by using classes. -For more information, see [about_Classes](about_Classes.md), and -[Writing a custom DSC resource with PowerShell classes](http://technet.microsoft.com/library/dn948461.aspx) -on Microsoft TechNet. - ## USING DSC To use DSC to configure your environment, first define a PowerShell diff --git a/reference/5.0/Microsoft.PowerShell.Core/About/about_Requires.md b/reference/5.0/Microsoft.PowerShell.Core/About/about_Requires.md index c2e71e2f1753..0a46dc1445d9 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/About/about_Requires.md +++ b/reference/5.0/Microsoft.PowerShell.Core/About/about_Requires.md @@ -102,8 +102,7 @@ For example, When this switch parameter is added to your requires statement, it specifies that the Windows PowerShell session in which you are running the script must -be started with elevated user rights (Run as Administrator). This switch was -introduced in PowerShell 4. +be started with elevated user rights (Run as Administrator). For example, diff --git a/reference/5.0/Microsoft.PowerShell.Core/About/about_WS-Management_Cmdlets.md b/reference/5.0/Microsoft.PowerShell.Core/About/about_WS-Management_Cmdlets.md index 1b6877370de4..1c2f2843c295 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/About/about_WS-Management_Cmdlets.md +++ b/reference/5.0/Microsoft.PowerShell.Core/About/about_WS-Management_Cmdlets.md @@ -185,8 +185,6 @@ http://go.microsoft.com/fwlink/?LinkId=142329 [Set-WSManQuickConfig](../../Microsoft.WSMan.Management/Set-WSManQuickConfig.md) -[Set-WSManSessionOption](../../Microsoft.WSMan.Management/Set-WSManSessionOption.md) - [Test-WSMan](../../Microsoft.WSMan.Management/Test-WSMan.md) # KEYWORDS diff --git a/reference/5.0/PSReadline/Remove-PSReadlineKeyHandler.md b/reference/5.0/PSReadline/Remove-PSReadlineKeyHandler.md index bd237daac096..3edb58c919f1 100644 --- a/reference/5.0/PSReadline/Remove-PSReadlineKeyHandler.md +++ b/reference/5.0/PSReadline/Remove-PSReadlineKeyHandler.md @@ -26,12 +26,12 @@ Create a key binding by running the Set-PSReadlineKeyHandler cmdlet. ## EXAMPLES ### Example 1: Remove a binding -``` -PS C:\> Remove-PSReadlineKeyHandler -Chord "Shift+Ctrl+B" +```powershell +Remove-PSReadlineKeyHandler -Chord Ctrl+Shift+B ``` This command removes the binding from the key combination, or chord, Ctrl+Shift+B. -The Ctrl+Shift+B chord is created in the Set-PSReadlineKeyHandler topic. +The Ctrl+Shift+B chord is created in the `Set-PSReadlineKeyHandler` topic. ## PARAMETERS diff --git a/reference/5.0/PSReadline/Set-PSReadlineKeyHandler.md b/reference/5.0/PSReadline/Set-PSReadlineKeyHandler.md index fc00b5c9d45b..0383b1f133ac 100644 --- a/reference/5.0/PSReadline/Set-PSReadlineKeyHandler.md +++ b/reference/5.0/PSReadline/Set-PSReadlineKeyHandler.md @@ -41,11 +41,11 @@ PS C:\> Set-PSReadlineKeyHandler -Chord UpArrow -Function HistorySearchBackward This command binds the up arrow key to the function HistorySearchBackward, which uses the currently-entered command line as the start of the search string when it is searching through command history. ### Example 2: Bind a key to a script block -``` -PS C:\> Set-PSReadlineKeyHandler -Chord Shift+Ctrl+B -ScriptBlock { - [PSConsoleUtilities.PSConsoleReadLine]::RevertLine() - [PSConsoleUtilities.PSConsoleReadLine]::Insert('build') - [PSConsoleUtilities.PSConsoleReadLine]::AcceptLine() +```powershell +Set-PSReadlineKeyHandler -Chord Ctrl+Shift+B -ScriptBlock { + [Microsoft.PowerShell.PSConsoleReadLine]::RevertLine() + [Microsoft.PowerShell.PSConsoleReadLine]::Insert('build') + [Microsoft.PowerShell.PSConsoleReadLine]::AcceptLine() } ``` diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Requires.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Requires.md index c2e71e2f1753..0a46dc1445d9 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Requires.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Requires.md @@ -102,8 +102,7 @@ For example, When this switch parameter is added to your requires statement, it specifies that the Windows PowerShell session in which you are running the script must -be started with elevated user rights (Run as Administrator). This switch was -introduced in PowerShell 4. +be started with elevated user rights (Run as Administrator). For example, diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_WS-Management_Cmdlets.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_WS-Management_Cmdlets.md index 1b6877370de4..1c2f2843c295 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_WS-Management_Cmdlets.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_WS-Management_Cmdlets.md @@ -185,8 +185,6 @@ http://go.microsoft.com/fwlink/?LinkId=142329 [Set-WSManQuickConfig](../../Microsoft.WSMan.Management/Set-WSManQuickConfig.md) -[Set-WSManSessionOption](../../Microsoft.WSMan.Management/Set-WSManSessionOption.md) - [Test-WSMan](../../Microsoft.WSMan.Management/Test-WSMan.md) # KEYWORDS diff --git a/reference/5.1/Microsoft.PowerShell.Core/New-PSSessionOption.md b/reference/5.1/Microsoft.PowerShell.Core/New-PSSessionOption.md index cf625d218b25..82c7ae329fd3 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/New-PSSessionOption.md +++ b/reference/5.1/Microsoft.PowerShell.Core/New-PSSessionOption.md @@ -34,7 +34,7 @@ Because all of the properties can be edited, you can use the resulting object as You can also save a session option object in the **$PSSessionOption** preference variable. The values of this variable establish new default values for the session options. -They effective when no session options are set for the session and they take precedence over options set in the session configuration, but you can override them by specifying session options or a session option object in a cmdlet that creates a session. +They are effective when no session options are set for the session and they take precedence over options set in the session configuration, but you can override them by specifying session options or a session option object in a cmdlet that creates a session. For more information about the **$PSSessionOption** preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). When you use a session option object in a cmdlet that creates a session, the session option values take precedence over default values for sessions set in the $PSSessionOption preference variable and in the session configuration. diff --git a/reference/5.1/PSReadline/Remove-PSReadlineKeyHandler.md b/reference/5.1/PSReadline/Remove-PSReadlineKeyHandler.md index 8a94a74668c4..50d31ee3863f 100644 --- a/reference/5.1/PSReadline/Remove-PSReadlineKeyHandler.md +++ b/reference/5.1/PSReadline/Remove-PSReadlineKeyHandler.md @@ -26,12 +26,12 @@ Create a key binding by running the Set-PSReadlineKeyHandler cmdlet. ## EXAMPLES ### Example 1: Remove a binding -``` -PS C:\> Remove-PSReadlineKeyHandler -Chord "Shift+Ctrl+B" +```powershell +Remove-PSReadlineKeyHandler -Chord Ctrl+Shift+B ``` This command removes the binding from the key combination, or chord, Ctrl+Shift+B. -The Ctrl+Shift+B chord is created in the Set-PSReadlineKeyHandler topic. +The Ctrl+Shift+B chord is created in the `Set-PSReadlineKeyHandler` topic. ## PARAMETERS diff --git a/reference/5.1/PSReadline/Set-PSReadlineKeyHandler.md b/reference/5.1/PSReadline/Set-PSReadlineKeyHandler.md index 5e4b96db7bfc..9abafec5d5e6 100644 --- a/reference/5.1/PSReadline/Set-PSReadlineKeyHandler.md +++ b/reference/5.1/PSReadline/Set-PSReadlineKeyHandler.md @@ -41,11 +41,11 @@ PS C:\> Set-PSReadlineKeyHandler -Chord UpArrow -Function HistorySearchBackward This command binds the up arrow key to the function HistorySearchBackward, which uses the currently-entered command line as the start of the search string when it is searching through command history. ### Example 2: Bind a key to a script block -``` -PS C:\> Set-PSReadlineKeyHandler -Chord Shift+Ctrl+B -ScriptBlock { - [PSConsoleUtilities.PSConsoleReadLine]::RevertLine() - [PSConsoleUtilities.PSConsoleReadLine]::Insert('build') - [PSConsoleUtilities.PSConsoleReadLine]::AcceptLine() +```powershell +Set-PSReadlineKeyHandler -Chord Ctrl+Shift+B -ScriptBlock { + [Microsoft.PowerShell.PSConsoleReadLine]::RevertLine() + [Microsoft.PowerShell.PSConsoleReadLine]::Insert('build') + [Microsoft.PowerShell.PSConsoleReadLine]::AcceptLine() } ``` diff --git a/reference/6/Microsoft.PowerShell.Core/About/about_Language_Modes.md b/reference/6/Microsoft.PowerShell.Core/About/about_Language_Modes.md index c53e1e438e24..c12aefe01cec 100644 --- a/reference/6/Microsoft.PowerShell.Core/About/about_Language_Modes.md +++ b/reference/6/Microsoft.PowerShell.Core/About/about_Language_Modes.md @@ -251,4 +251,3 @@ NoLanguage session, PowerShell returns the ScriptsNotAllowed error message. - [about_Session_Configuration_Files](about_Session_Configuration_Files.md) - [about_Session_Configurations](about_Session_Configurations.md) -- [about_Windows_RT](about_Windows_RT.md) diff --git a/reference/6/Microsoft.PowerShell.Core/About/about_Logging.md b/reference/6/Microsoft.PowerShell.Core/About/about_Logging.md index f22df57b0193..463b605af0b0 100644 --- a/reference/6/Microsoft.PowerShell.Core/About/about_Logging.md +++ b/reference/6/Microsoft.PowerShell.Core/About/about_Logging.md @@ -148,7 +148,7 @@ sudo log stream --predicate 'process == "pwsh"' --info On Windows, logging is configured by creating ETW trace listeners or by using the Event Viewer to enable Analytic logging. On Linux and MacOS, logging is -configured using the file `PowerShellProperties.json`. The rest of this section +configured using the file `powershell.config.json`. The rest of this section will discuss configuring PowerShell logging on non-Windows system. By default, PowerShell enables informational logging to the operational @@ -157,7 +157,7 @@ marked as operational and has a log (trace) level greater then informational will be logged. Occasionally, diagnoses may require additional log output, such as verbose log output or enabling analytic log output. -The file `PowerShellProperties.json` is a JSON formatted file residing in the +The file `powershell.config.json` is a JSON formatted file residing in the PowerShell $PSHOME directory. Each installation of PowerShell uses it's own copy of this file. For normal operation, this file is left unchanged but it can be useful for diagnosis or for distinguishing between multiple PowerShell diff --git a/reference/6/Microsoft.PowerShell.Core/About/about_Requires.md b/reference/6/Microsoft.PowerShell.Core/About/about_Requires.md index 93f468542189..c0f7610b59b2 100644 --- a/reference/6/Microsoft.PowerShell.Core/About/about_Requires.md +++ b/reference/6/Microsoft.PowerShell.Core/About/about_Requires.md @@ -102,8 +102,7 @@ For example, When this switch parameter is added to your requires statement, it specifies that the Windows PowerShell session in which you are running the script must -be started with elevated user rights (Run as Administrator). This switch was -introduced in PowerShell 4. +be started with elevated user rights (Run as Administrator). For example, diff --git a/reference/6/Microsoft.PowerShell.Core/New-ModuleManifest.md b/reference/6/Microsoft.PowerShell.Core/New-ModuleManifest.md index a5a12f94a2f7..8a8bb3a5f233 100644 --- a/reference/6/Microsoft.PowerShell.Core/New-ModuleManifest.md +++ b/reference/6/Microsoft.PowerShell.Core/New-ModuleManifest.md @@ -47,7 +47,7 @@ Unless specified in the parameter description, if you omit a parameter from the In Windows PowerShell 2.0, **New-ModuleManifest** prompts you for the values of frequently used parameters that are not specified in the command, in addition to required parameter values. Starting in Windows PowerShell 3.0, it prompts only when required parameter values are not specified. -Module manifest (.psd1) file encoding depends on environment: if it is PowerShell Core running on Linux then encoding is UTF-8 (no BOM); otherwise encoding is UTF-16 (with BOM). +Module manifest (.psd1) file encoding is UTF-8 (no BOM) on all platforms. ## EXAMPLES diff --git a/reference/6/Microsoft.PowerShell.Core/Providers/Environment-Provider.md b/reference/6/Microsoft.PowerShell.Core/Providers/Environment-Provider.md index 9081a845cfad..9374699d9809 100644 --- a/reference/6/Microsoft.PowerShell.Core/Providers/Environment-Provider.md +++ b/reference/6/Microsoft.PowerShell.Core/Providers/Environment-Provider.md @@ -13,39 +13,36 @@ online version: https://go.microsoft.com/fwlink/?linkid=834944 ## Provider name - Environment + Environment ## Drives - `Env:` + `Env:` ## Short description - Provides access to the Windows environment variables. + Provides access to the Windows environment variables. ## Detailed description - The Windows PowerShell **Environment** provider lets you get, add, change, clear, and delete Windows environment variables in Windows PowerShell. + The Windows PowerShell **Environment** provider lets you get, add, change, clear, and delete Windows environment variables in Windows PowerShell. - The **Environment** provider is a flat namespace that contains only objects that represent the environment variables. The variables have no child items. + The **Environment** provider is a flat namespace that contains only objects that represent the environment variables. The variables have no child items. - Each environment variable is an instance of the [System.Collections.DictionaryEntry](https://msdn.microsoft.com/library/system.collections.dictionaryentry) class. The name of the variable is the dictionary key. The value of the environment variable is the dictionary value. + Each environment variable is an instance of the [System.Collections.DictionaryEntry](https://msdn.microsoft.com/library/system.collections.dictionaryentry) class. The name of the variable is the dictionary key. The value of the environment variable is the dictionary value. - The **Environment** provider exposes its data store in the `Env:` drive. To work with environment variables, change your location to the `Env:` drive (`set-location Env:`), or work from another Windows PowerShell drive. To reference an environment variable from another location, use the `Env:` drive name in the path. + The **Environment** provider exposes its data store in the `Env:` drive. To work with environment variables, change your location to the `Env:` drive (`set-location Env:`), or work from another Windows PowerShell drive. To reference an environment variable from another location, use the `Env:` drive name in the path. - The **Environment** provider supports all the cmdlets that contain the *Item* noun except for [Invoke-Item](../../Microsoft.PowerShell.Management/Invoke-Item.md). And, it supports the [Get-Content](../../Microsoft.PowerShell.Management/Get-Content.md) and [Set-Content](../../Microsoft.PowerShell.Management/Set-Content.md) cmdlets. However, it does not support the cmdlets that contain the *ItemProperty* noun, and it does not support the `-Filter` parameter in any cmdlet. - - Environment variables must conform to the usual naming standards. Additionally, the name cannot include the equal sign (`=`). - - Changes to the environment variables affect the current session only. To save the changes, add the changes to the Windows PowerShell profile, or use [Export-Console](there-should-be-an-external-link) to save the current session. + The **Environment** provider supports all the cmdlets that contain the *Item* noun except for [Invoke-Item](../../Microsoft.PowerShell.Management/Invoke-Item.md). And, it supports the [Get-Content](../../Microsoft.PowerShell.Management/Get-Content.md) and [Set-Content](../../Microsoft.PowerShell.Management/Set-Content.md) cmdlets. However, it does not support the cmdlets that contain the *ItemProperty* noun, and it does not support the `-Filter` parameter in any cmdlet. + Environment variables must conform to the usual naming standards. Additionally, the name cannot include the equal sign (`=`). ## Capabilities - ShouldProcess + ShouldProcess ## Examples @@ -56,13 +53,13 @@ online version: https://go.microsoft.com/fwlink/?linkid=834944 #### Example 1 - This command changes the current location to the `Env:` drive: + This command changes the current location to the `Env:` drive: ```powershell Set-Location Env: ``` - You can use this command from any drive in Windows PowerShell. To return to a file system drive, type the drive name. For example, type: + You can use this command from any drive in Windows PowerShell. To return to a file system drive, type the drive name. For example, type: ```powershell Set-Location c: ``` @@ -73,18 +70,18 @@ Set-Location c: #### Example 1 - This command lists all the environment variables in the current session: + This command lists all the environment variables in the current session: ```powershell Get-ChildItem -Path Env: ``` - You can use this command from any Windows PowerShell drive. + You can use this command from any Windows PowerShell drive. #### Example 2 - This command gets the `WINDIR` environment Variable: + This command gets the `WINDIR` environment Variable: ```powershell Get-ChildItem -Path Env:windir @@ -93,14 +90,14 @@ Get-ChildItem -Path Env:windir #### Example 3 - This command gets a list of all the environment variables in the current session and then sorts them by name: + This command gets a list of all the environment variables in the current session and then sorts them by name: ```powershell Get-ChildItem | Sort-Object -Property name ``` - By default, the environment variables appear in the order that Windows PowerShell discovers them. This command is submitted in the `Env:` drive. -When you run this command from another drive, add the `-Path` parameter with a value of `Env:`. + By default, the environment variables appear in the order that Windows PowerShell discovers them. This command is submitted in the `Env:` drive. +When you run this command from another drive, add the `-Path` parameter with a value of `Env:`. ### Creating a new environment variable @@ -108,14 +105,14 @@ When you run this command from another drive, add the `-Path` parameter with a v #### Example 1 - This command creates the `USERMODE` environment variable with a value of "Non-Admin": + This command creates the `USERMODE` environment variable with a value of "Non-Admin": ```powershell New-Item -Path . -Name USERMODE -Value Non-Admin ``` - Because the current location is in the `Env:` drive, the value of the `-Path` parameter is a dot (`.`). The dot represents the current location. -If you are not in the `Env:` drive, the value of the `-Path` parameter would be `Env:`. + Because the current location is in the `Env:` drive, the value of the `-Path` parameter is a dot (`.`). The dot represents the current location. +If you are not in the `Env:` drive, the value of the `-Path` parameter would be `Env:`. ### Displaying the properties and methods of environment variables @@ -123,32 +120,32 @@ If you are not in the `Env:` drive, the value of the `-Path` parameter would be #### Example 1 - This command uses the [Get-ChildItem](../../Microsoft.PowerShell.Management/Get-ChildItem.md) cmdlet to get all the environment variables: + This command uses the [Get-ChildItem](../../Microsoft.PowerShell.Management/Get-ChildItem.md) cmdlet to get all the environment variables: ```powershell Get-ChildItem -Path Env: | Get-Member ``` - The pipeline operator (`|`) sends the results to [Get-Member](../../Microsoft.PowerShell.Utility/Get-Member.md), which displays the methods and properties of the object. -When you pipe a collection of objects to [Get-Member](../../Microsoft.PowerShell.Utility/Get-Member.md), such as the collection of environment variables in the `Env:` drive, [Get-Member](../../Microsoft.PowerShell.Utility/Get-Member.md) evaluates each object in the collection separately. [Get-Member](../../Microsoft.PowerShell.Utility/Get-Member.md) then returns information about each object type that it finds. If all the objects are of the same type, it returns information about the single object type. In this case, all the environment variables are [DictionaryEntry](https://msdn.microsoft.com/library/system.collections.dictionaryentry) objects. -To get information about the collection of [DictionaryEntry](https://msdn.microsoft.com/library/system.collections.dictionaryentry) objects, use the `-InputObject` parameter of [Get-Member](../../Microsoft.PowerShell.Utility/Get-Member.md). For example, type: + The pipeline operator (`|`) sends the results to [Get-Member](../../Microsoft.PowerShell.Utility/Get-Member.md), which displays the methods and properties of the object. +When you pipe a collection of objects to [Get-Member](../../Microsoft.PowerShell.Utility/Get-Member.md), such as the collection of environment variables in the `Env:` drive, [Get-Member](../../Microsoft.PowerShell.Utility/Get-Member.md) evaluates each object in the collection separately. [Get-Member](../../Microsoft.PowerShell.Utility/Get-Member.md) then returns information about each object type that it finds. If all the objects are of the same type, it returns information about the single object type. In this case, all the environment variables are [DictionaryEntry](https://msdn.microsoft.com/library/system.collections.dictionaryentry) objects. +To get information about the collection of [DictionaryEntry](https://msdn.microsoft.com/library/system.collections.dictionaryentry) objects, use the `-InputObject` parameter of [Get-Member](../../Microsoft.PowerShell.Utility/Get-Member.md). For example, type: ```powershell Get-Member -InputObject (Get-ChildItem Env:) ``` -When you use the `-InputObject` parameter, [Get-Member](../../Microsoft.PowerShell.Utility/Get-Member.md) evaluates the collection, not the objects in the collection. +When you use the `-InputObject` parameter, [Get-Member](../../Microsoft.PowerShell.Utility/Get-Member.md) evaluates the collection, not the objects in the collection. #### Example 2 - This command lists the values of the properties of the `WINDIR` environment Variable: + This command lists the values of the properties of the `WINDIR` environment Variable: ```powershell Get-Item Env:windir | Format-List -Property * ``` - It uses the [Get-Item](../../Microsoft.PowerShell.Management/Get-Item.md) cmdlet to get an object that represents the `WINDIR` environment variable. The pipeline operator (`|`) sends the results to the [Format-List](../../Microsoft.PowerShell.Utility/Format-List.md) command. It uses the `-Property` parameter with a wildcard character (`*`) to format and display the values of all the properties of the `WINDIR` environment variable. + It uses the [Get-Item](../../Microsoft.PowerShell.Management/Get-Item.md) cmdlet to get an object that represents the `WINDIR` environment variable. The pipeline operator (`|`) sends the results to the [Format-List](../../Microsoft.PowerShell.Utility/Format-List.md) command. It uses the `-Property` parameter with a wildcard character (`*`) to format and display the values of all the properties of the `WINDIR` environment variable. ### Changing the properties of an environment variable @@ -156,19 +153,19 @@ Get-Item Env:windir | Format-List -Property * #### Example 1 - This command uses the [Rename-Item](../../Microsoft.PowerShell.Management/Rename-Item.md) cmdlet to change the name of the `USERMODE` environment variable that you created to `USERROLE`: + This command uses the [Rename-Item](../../Microsoft.PowerShell.Management/Rename-Item.md) cmdlet to change the name of the `USERMODE` environment variable that you created to `USERROLE`: ```powershell Rename-Item -Path Env:USERMODE -NewName USERROLE ``` - This change affects the **Name**, **Key**, and **PSPath** properties of the [DictionaryEntry](https://msdn.microsoft.com/library/system.collections.dictionaryentry) object. -Do not change the name of an environment variable that the system uses. Although these changes affect only the current session, they might cause the system or a program to operate incorrectly. + This change affects the **Name**, **Key**, and **PSPath** properties of the [DictionaryEntry](https://msdn.microsoft.com/library/system.collections.dictionaryentry) object. +Do not change the name of an environment variable that the system uses. Although these changes affect only the current session, they might cause the system or a program to operate incorrectly. #### Example 2 - This command uses the [Set-Item](../../Microsoft.PowerShell.Management/Set-Item.md) cmdlet to change the value of the `USERROLE` environment variable to "Administrator": + This command uses the [Set-Item](../../Microsoft.PowerShell.Management/Set-Item.md) cmdlet to change the value of the `USERROLE` environment variable to "Administrator": ```powershell Set-Item -Path Env:USERROLE -Value Administrator @@ -180,7 +177,7 @@ Set-Item -Path Env:USERROLE -Value Administrator #### Example 1 - This command copies the value of the `USERROLE` environment variable to the `USERROLE2` environment Variable: + This command copies the value of the `USERROLE` environment variable to the `USERROLE2` environment Variable: ```powershell Copy-Item -Path Env:USERROLE -Destination Env:USERROLE2 @@ -192,18 +189,18 @@ Copy-Item -Path Env:USERROLE -Destination Env:USERROLE2 #### Example 1 - This command deletes the `USERROLE2` environment variable from the current session: + This command deletes the `USERROLE2` environment variable from the current session: ```powershell Remove-Item -Path Env:USERROLE2 ``` - You can use this command in any Windows PowerShell drive. If you are in the `Env:` drive, you can omit the drive name from the path. + You can use this command in any Windows PowerShell drive. If you are in the `Env:` drive, you can omit the drive name from the path. #### Example 2 - This command deletes the `USERROLE` environment variable. + This command deletes the `USERROLE` environment variable. ```powershell Clear-Item -Path Env:USERROLE diff --git a/reference/6/Microsoft.PowerShell.Core/Providers/FileSystem-Provider/Add-Content-for-FileSystem.md b/reference/6/Microsoft.PowerShell.Core/Providers/FileSystem-Provider/Add-Content-for-FileSystem.md index ece5a6b15211..0866984673d1 100644 --- a/reference/6/Microsoft.PowerShell.Core/Providers/FileSystem-Provider/Add-Content-for-FileSystem.md +++ b/reference/6/Microsoft.PowerShell.Core/Providers/FileSystem-Provider/Add-Content-for-FileSystem.md @@ -8,198 +8,187 @@ online version: http://go.microsoft.com/fwlink/?LinkId=834948 --- # Add-Content for FileSystem -Appends content, such as words or data, to a file. +Appends content, such as words or data, to a file. -## Syntax +## Syntax -``` -Add-Content [-Encoding { | | | | | | | | | | }] [-Force] [-Stream ] [-Confirm] [-WhatIf] [-UseTransaction] [] +``` +Add-Content [-Encoding { | | | | | | | | | | }] [-Force] [-Stream ] [-Confirm] [-WhatIf] [] -``` +``` -## Description - In file system drives, the [Add-Content](../../../Microsoft.PowerShell.Management/Add-Content.md) cmdlet appends the content you specify to the end of a file. This cmdlet is not valid on folders. +## Description + In file system drives, the [Add-Content](../../../Microsoft.PowerShell.Management/Add-Content.md) cmdlet appends the content you specify to the end of a file. This cmdlet is not valid on folders. - Note: This custom cmdlet help file explains how the [Add-Content](../../../Microsoft.PowerShell.Management/Add-Content.md) cmdlet works in a file system drive. For information about the [Add-Content](../../../Microsoft.PowerShell.Management/Add-Content.md) cmdlet in all drives, type "[Get-Help](../../Get-Help.md)[Add-Content](../../../Microsoft.PowerShell.Management/Add-Content.md) -Path $null" or see [Add-Content](../../../Microsoft.PowerShell.Management/Add-Content.md) at http://go.microsoft.com/fwlink/?LinkID=113278. + Note: This custom cmdlet help file explains how the [Add-Content](../../../Microsoft.PowerShell.Management/Add-Content.md) cmdlet works in a file system drive. For information about the [Add-Content](../../../Microsoft.PowerShell.Management/Add-Content.md) cmdlet in all drives, type "[Get-Help](../../Get-Help.md)[Add-Content](../../../Microsoft.PowerShell.Management/Add-Content.md) -Path $null" or see [Add-Content](../../../Microsoft.PowerShell.Management/Add-Content.md) at http://go.microsoft.com/fwlink/?LinkID=113278. -## Parameters +## Parameters -### -Encoding - Specifies the file encoding. The default is ASCII. +### -Encoding + Specifies the file encoding. The default is ASCII. - Valid values are: + Valid values are: - -- ASCII: Uses the encoding for the ASCII (7-bit) character set. + -- ASCII: Uses the encoding for the ASCII (7-bit) character set. - -- BigEndianUnicode: Encodes in UTF-16 format using the big-endian byte order. + -- BigEndianUnicode: Encodes in UTF-16 format using the big-endian byte order. - -- Byte: Encodes a set of characters into a sequence of bytes. + -- Byte: Encodes a set of characters into a sequence of bytes. - -- String: Uses the encoding type for a string. + -- String: Uses the encoding type for a string. - -- Unicode: Encodes in UTF-16 format using the little-endian byte order. + -- Unicode: Encodes in UTF-16 format using the little-endian byte order. - -- UTF7: Encodes in UTF-7 format. + -- UTF7: Encodes in UTF-7 format. - -- UTF8: Encodes in UTF-8 format. + -- UTF8: Encodes in UTF-8 format. - -- Unknown: The encoding type is unknown or invalid. The data can be treated as binary. + -- Unknown: The encoding type is unknown or invalid. The data can be treated as binary. - Encoding is a dynamic parameter that the FileSystem provider adds to the [Add-Content](../../../Microsoft.PowerShell.Management/Add-Content.md) cmdlet. This parameter works only in file system drives. + Encoding is a dynamic parameter that the FileSystem provider adds to the [Add-Content](../../../Microsoft.PowerShell.Management/Add-Content.md) cmdlet. This parameter works only in file system drives. -||| -|-|-| -|Required?|false| -|Position?|named| -|Default Value|ASCII| -|Accept Pipeline Input?|false| -|Accept Wildcard Characters?|false| +||| +|-|-| +|Required?|false| +|Position?|named| +|Default Value|ASCII| +|Accept Pipeline Input?|false| +|Accept Wildcard Characters?|false| -### -Force - Adds contents to files even if they are read-only. Without this parameter, read-only files are not affected. +### -Force + Adds contents to files even if they are read-only. Without this parameter, read-only files are not affected. -||| -|-|-| -|Required?|false| -|Position?|named| -|Default Value|False| -|Accept Pipeline Input?|false| -|Accept Wildcard Characters?|false| +||| +|-|-| +|Required?|false| +|Position?|named| +|Default Value|False| +|Accept Pipeline Input?|false| +|Accept Wildcard Characters?|false| -### -Stream - Adds the content to the specified alternate data stream. If the stream does not yet, exist, [Add-Content](../../../Microsoft.PowerShell.Management/Add-Content.md) creates it. Enter the stream name. Wildcards are not supported. +### -Stream + Adds the content to the specified alternate data stream. If the stream does not yet, exist, [Add-Content](../../../Microsoft.PowerShell.Management/Add-Content.md) creates it. Enter the stream name. Wildcards are not supported. - Stream is a dynamic parameter that the FileSystem provider adds to the [Add-Content](../../../Microsoft.PowerShell.Management/Add-Content.md) cmdlet. This parameter works only in file system drives. + Stream is a dynamic parameter that the FileSystem provider adds to the [Add-Content](../../../Microsoft.PowerShell.Management/Add-Content.md) cmdlet. This parameter works only in file system drives. - This parameter is introduced in Windows PowerShell 3.0. + This parameter is introduced in Windows PowerShell 3.0. -||| -|-|-| -|Required?|false| -|Position?|named| -|Default Value|| -|Accept Pipeline Input?|false| -|Accept Wildcard Characters?|false| +||| +|-|-| +|Required?|false| +|Position?|named| +|Default Value|| +|Accept Pipeline Input?|false| +|Accept Wildcard Characters?|false| -### -Confirm - Prompts you for confirmation before executing the command. +### -Confirm + Prompts you for confirmation before executing the command. -||| -|-|-| -|Required?|false| -|Position?|named| -|Default Value|| -|Accept Pipeline Input?|false| -|Accept Wildcard Characters?|false| +||| +|-|-| +|Required?|false| +|Position?|named| +|Default Value|| +|Accept Pipeline Input?|false| +|Accept Wildcard Characters?|false| -### -WhatIf - Describes what would happen if you executed the command without actually executing the command. +### -WhatIf + Describes what would happen if you executed the command without actually executing the command. -||| -|-|-| -|Required?|false| -|Position?|named| -|Default Value|| -|Accept Pipeline Input?|false| -|Accept Wildcard Characters?|false| +||| +|-|-| +|Required?|false| +|Position?|named| +|Default Value|| +|Accept Pipeline Input?|false| +|Accept Wildcard Characters?|false| -### -UseTransaction - Includes the command in the active transaction. This parameter is valid only when a transaction is in progress. For more information, see [about_Transactions](../../About/about_Transactions.md). +### + This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, -OutVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](../../About/about_CommonParameters.md). -||| -|-|-| -|Required?|false| -|Position?|named| -|Default Value|| -|Accept Pipeline Input?|false| -|Accept Wildcard Characters?|false| +## Inputs and Outputs + The input type is the type of the objects that you can pipe to the cmdlet. The return type is the type of the objects that the cmdlet returns. -### - This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, -OutVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](../../About/about_CommonParameters.md). +||| +|-|-| +|Inputs|Sytem.Object[], System.String[], System.Management.Automation.PSCredential

You can pipe the value (object), a path, or a credential object to Add-Contnet.| +|Outputs|None or System.String

When you use the Passthru parameter, Add-Content generates a System.String object representing the content. Otherwise, this cmdlet does not generate any output.| -## Inputs and Outputs - The input type is the type of the objects that you can pipe to the cmdlet. The return type is the type of the objects that the cmdlet returns. +## Example 1 -||| -|-|-| -|Inputs|Sytem.Object[], System.String[], System.Management.Automation.PSCredential

You can pipe the value (object), a path, or a credential object to Add-Contnet.| -|Outputs|None or System.String

When you use the Passthru parameter, Add-Content generates a System.String object representing the content. Otherwise, this cmdlet does not generate any output.| +``` +C:\PS>Add-Content -Path *.txt -Exclude help* -Value "END" -## Example 1 +Description +----------- +This command adds "END" to all text files in the current directory, except for those with file names that begin with "help." -``` -C:\PS>Add-Content -Path *.txt -Exclude help* -Value "END" +``` -Description ------------ -This command adds "END" to all text files in the current directory, except for those with file names that begin with "help." +## Example 2 -``` +``` +C:\PS>Add-Content -Path file1.log, file2.log -Value (get-date) -PassThru -## Example 2 +Description +----------- +This command adds the date to the end of the File1.log and File2.log files and then displays the date at the command line. -``` -C:\PS>Add-Content -Path file1.log, file2.log -Value (get-date) -PassThru +The command uses the Get-Date cmdlet to get the date, and it uses the Value parameter to pass the date to Add-Content. The PassThru parameter sends the added content through the pipeline. Because there is no other cmdlet to receive the passed content, it is displayed at the command line. -Description ------------ -This command adds the date to the end of the File1.log and File2.log files and then displays the date at the command line. +``` -The command uses the Get-Date cmdlet to get the date, and it uses the Value parameter to pass the date to Add-Content. The PassThru parameter sends the added content through the pipeline. Because there is no other cmdlet to receive the passed content, it is displayed at the command line. +## Example 3 -``` +``` +C:\PS>Add-Content -Path monthly.txt -Value (Get-Content c:\rec1\weekly.txt) -## Example 3 +Description +----------- +This command adds the contents of the Weekly.txt file to the end of the Monthly.txt file. It uses the Get-Content cmdlet to get the contents of the Weekly.txt file, and it uses the Value parameter to pass the content of weekly.txt to Add-Content. The parentheses ensure that the Get-Content command is complete before the Add-Content command begins. -``` -C:\PS>Add-Content -Path monthly.txt -Value (Get-Content c:\rec1\weekly.txt) +You can also copy the content of Weekly.txt to a variable, such as $w, and then use the Value parameter to pass the variable to Add-Content. In that case, the command would be "add-content -path monthly.txt -value $w". -Description ------------ -This command adds the contents of the Weekly.txt file to the end of the Monthly.txt file. It uses the Get-Content cmdlet to get the contents of the Weekly.txt file, and it uses the Value parameter to pass the content of weekly.txt to Add-Content. The parentheses ensure that the Get-Content command is complete before the Add-Content command begins. +``` -You can also copy the content of Weekly.txt to a variable, such as $w, and then use the Value parameter to pass the variable to Add-Content. In that case, the command would be "add-content -path monthly.txt -value $w". +## Example 4 -``` +``` +C:\PS>Add-Content -Value (Get-Content test.log) -Path C:\tests\test134\logs\test134.log -## Example 4 +Description +----------- +This command creates a new directory and file and copies the content of an existing file to the newly created file. -``` -C:\PS>Add-Content -Value (Get-Content test.log) -Path C:\tests\test134\logs\test134.log +This command uses the Add-Content cmdlet to add the content. The value of the Value parameter is a Get-Content command that gets content from an existing file, Test.log. -Description ------------ -This command creates a new directory and file and copies the content of an existing file to the newly created file. +The value of the path parameter is a path that does not exist when the command runs. In this example, only the C:\Tests directories exist. The command creates the remaining directories and the Test134.log file. -This command uses the Add-Content cmdlet to add the content. The value of the Value parameter is a Get-Content command that gets content from an existing file, Test.log. +The Force parameter is not required for this command. Add-Content creates directories to complete a path even without the Force parameter. -The value of the path parameter is a path that does not exist when the command runs. In this example, only the C:\Tests directories exist. The command creates the remaining directories and the Test134.log file. +``` -The Force parameter is not required for this command. Add-Content creates directories to complete a path even without the Force parameter. +## Example 5 -``` +``` +C:\PS>Get-Content test.xml | Add-Content final.xml -Force -Encoding UTF8 -## Example 5 +Description +----------- +This command appends the contents of the final.xml file to the contents of the test.xml file. -``` -C:\PS>Get-Content test.xml | Add-Content final.xml -Force -Encoding UTF8 +The command uses the Force parameter so that the command is successful even if the Final.xml file is read-only. It uses the Encoding parameter to specify an encoding of UTF-8. -Description ------------ -This command appends the contents of the final.xml file to the contents of the test.xml file. +``` -The command uses the Force parameter so that the command is successful even if the Final.xml file is read-only. It uses the Encoding parameter to specify an encoding of UTF-8. - -``` - -## See Also - [FileSystem Provider](../FileSystem-Provider.md) - [Clear-Content](../../../Microsoft.PowerShell.Management/Clear-Content.md) - [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) - [Get-ChildItem](../../../Microsoft.PowerShell.Management/Get-ChildItem.md) - [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) - [Get-Item](../../../Microsoft.PowerShell.Management/Get-Item.md) - [Remove-Item](../../../Microsoft.PowerShell.Management/Remove-Item.md) - [Set-Content](../../../Microsoft.PowerShell.Management/Set-Content.md) +## See Also + [FileSystem Provider](../FileSystem-Provider.md) + [Clear-Content](../../../Microsoft.PowerShell.Management/Clear-Content.md) + [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) + [Get-ChildItem](../../../Microsoft.PowerShell.Management/Get-ChildItem.md) + [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) + [Get-Item](../../../Microsoft.PowerShell.Management/Get-Item.md) + [Remove-Item](../../../Microsoft.PowerShell.Management/Remove-Item.md) + [Set-Content](../../../Microsoft.PowerShell.Management/Set-Content.md) [Test-Path](../../../Microsoft.PowerShell.Management/Test-Path.md) diff --git a/reference/6/Microsoft.PowerShell.Core/Providers/FileSystem-Provider/Get-ChildItem-for-FileSystem.md b/reference/6/Microsoft.PowerShell.Core/Providers/FileSystem-Provider/Get-ChildItem-for-FileSystem.md index 31d62bc5d9ab..6bdb07292604 100644 --- a/reference/6/Microsoft.PowerShell.Core/Providers/FileSystem-Provider/Get-ChildItem-for-FileSystem.md +++ b/reference/6/Microsoft.PowerShell.Core/Providers/FileSystem-Provider/Get-ChildItem-for-FileSystem.md @@ -8,286 +8,275 @@ online version: http://go.microsoft.com/fwlink/?LinkId=834950 --- # Get-ChildItem for FileSystem -Gets the files and folders in a file system drive. +Gets the files and folders in a file system drive. -## Syntax +## Syntax -``` -Get-ChildItem [-Attributes ] [-Directory] [-File] [-Force] [-Hidden] [-ReadOnly] [-System] [-UseTransaction] [] +``` +Get-ChildItem [-Attributes ] [-Directory] [-File] [-Force] [-Hidden] [-ReadOnly] [-System] [] -``` +``` -## Description - In a file system drive, the [Get-ChildItem](../../../Microsoft.PowerShell.Management/Get-ChildItem.md) cmdlet gets the directories, subdirectories, and files. In a file system directory, it gets subdirectories and files. +## Description + In a file system drive, the [Get-ChildItem](../../../Microsoft.PowerShell.Management/Get-ChildItem.md) cmdlet gets the directories, subdirectories, and files. In a file system directory, it gets subdirectories and files. - By default, [Get-ChildItem](../../../Microsoft.PowerShell.Management/Get-ChildItem.md) gets non-hidden items, but you can use the Directory, File, Hidden, ReadOnly, and System parameters to get only items with these attributes. To create a complex attribute search, use the Attributes parameter. If you use these parameters, [Get-ChildItem](../../../Microsoft.PowerShell.Management/Get-ChildItem.md) gets only the items that meet all search conditions, as though the parameters were connected by an AND operator. + By default, [Get-ChildItem](../../../Microsoft.PowerShell.Management/Get-ChildItem.md) gets non-hidden items, but you can use the Directory, File, Hidden, ReadOnly, and System parameters to get only items with these attributes. To create a complex attribute search, use the Attributes parameter. If you use these parameters, [Get-ChildItem](../../../Microsoft.PowerShell.Management/Get-ChildItem.md) gets only the items that meet all search conditions, as though the parameters were connected by an AND operator. - Note: This custom cmdlet help file explains how the [Get-ChildItem](../../../Microsoft.PowerShell.Management/Get-ChildItem.md) cmdlet works in a file system drive. For information about the [Get-ChildItem](../../../Microsoft.PowerShell.Management/Get-ChildItem.md) cmdlet in all drives, type "[Get-Help](../../Get-Help.md)[Get-ChildItem](../../../Microsoft.PowerShell.Management/Get-ChildItem.md) -Path $null" or see [Get-ChildItem](../../../Microsoft.PowerShell.Management/Get-ChildItem.md) at http://go.microsoft.com/fwlink/?LinkID=113308. + Note: This custom cmdlet help file explains how the [Get-ChildItem](../../../Microsoft.PowerShell.Management/Get-ChildItem.md) cmdlet works in a file system drive. For information about the [Get-ChildItem](../../../Microsoft.PowerShell.Management/Get-ChildItem.md) cmdlet in all drives, type "[Get-Help](../../Get-Help.md)[Get-ChildItem](../../../Microsoft.PowerShell.Management/Get-ChildItem.md) -Path $null" or see [Get-ChildItem](../../../Microsoft.PowerShell.Management/Get-ChildItem.md) at http://go.microsoft.com/fwlink/?LinkID=113308. -## Parameters +## Parameters -### -Attributes - Gets files and folders with the specified attributes. This parameter supports all attributes and lets you specify complex combinations of attributes. +### -Attributes + Gets files and folders with the specified attributes. This parameter supports all attributes and lets you specify complex combinations of attributes. - For example, to get non-system files (not directories) that are encrypted or compressed, type: + For example, to get non-system files (not directories) that are encrypted or compressed, type: - [Get-ChildItem](../../../Microsoft.PowerShell.Management/Get-ChildItem.md) -Attributes !Directory+!System+Encrypted, !Directory+!System+Compressed + [Get-ChildItem](../../../Microsoft.PowerShell.Management/Get-ChildItem.md) -Attributes !Directory+!System+Encrypted, !Directory+!System+Compressed - To find files and folders with commonly used attributes, you can use the Attributes parameter, or the Directory, File, Hidden, ReadOnly, and System switch parameters. + To find files and folders with commonly used attributes, you can use the Attributes parameter, or the Directory, File, Hidden, ReadOnly, and System switch parameters. - The Attributes parameter supports the following attributes: Archive, Compressed, Device, Directory, Encrypted, Hidden, Normal, NotContentIndexed, Offline, ReadOnly, ReparsePoint, SparseFile, System, and Temporary. For a description of these attributes, see the FileAttributes enumeration at http://go.microsoft.com/fwlink/?LinkId=201508. + The Attributes parameter supports the following attributes: Archive, Compressed, Device, Directory, Encrypted, Hidden, Normal, NotContentIndexed, Offline, ReadOnly, ReparsePoint, SparseFile, System, and Temporary. For a description of these attributes, see the FileAttributes enumeration at http://go.microsoft.com/fwlink/?LinkId=201508. - Use the following operators to combine attributes. + Use the following operators to combine attributes. - ! NOT + ! NOT - \+ AND + \+ AND - , OR + , OR - No spaces are permitted between an operator and its attribute. However, spaces are permitted before commas. + No spaces are permitted between an operator and its attribute. However, spaces are permitted before commas. - You can use the following abbreviations for commonly used attributes: + You can use the following abbreviations for commonly used attributes: - D Directory + D Directory - H Hidden + H Hidden - R Read-only + R Read-only - S System + S System -||| -|-|-| -|Required?|false| -|Position?|named| -|Default Value|| -|Accept Pipeline Input?|false| -|Accept Wildcard Characters?|false| +||| +|-|-| +|Required?|false| +|Position?|named| +|Default Value|| +|Accept Pipeline Input?|false| +|Accept Wildcard Characters?|false| -### -Directory - Gets directories (folders). +### -Directory + Gets directories (folders). - To get only directories, use the Directory parameter and omit the File parameter. To exclude directories, use the File parameter and omit the Directory parameter, or use the Attributes parameter. + To get only directories, use the Directory parameter and omit the File parameter. To exclude directories, use the File parameter and omit the Directory parameter, or use the Attributes parameter. - To get directories, use the Directory parameter, its "ad" alias, or the Directory attribute of the Attributes parameter. + To get directories, use the Directory parameter, its "ad" alias, or the Directory attribute of the Attributes parameter. -||| -|-|-| -|Required?|false| -|Position?|named| -|Default Value|None| -|Accept Pipeline Input?|false| -|Accept Wildcard Characters?|false| +||| +|-|-| +|Required?|false| +|Position?|named| +|Default Value|None| +|Accept Pipeline Input?|false| +|Accept Wildcard Characters?|false| -### -File - Gets files. +### -File + Gets files. - To get only files, use the File parameter and omit the Directory parameter. To exclude files, use the Directory parameter and omit the File parameter, or use the Attributes parameter. + To get only files, use the File parameter and omit the Directory parameter. To exclude files, use the Directory parameter and omit the File parameter, or use the Attributes parameter. - To get files, use the File parameter, its "af" alias, or the File value of the Attributes parameter. + To get files, use the File parameter, its "af" alias, or the File value of the Attributes parameter. -||| -|-|-| -|Required?|false| -|Position?|named| -|Default Value|| -|Accept Pipeline Input?|false| -|Accept Wildcard Characters?|false| +||| +|-|-| +|Required?|false| +|Position?|named| +|Default Value|| +|Accept Pipeline Input?|false| +|Accept Wildcard Characters?|false| -### -Hidden - Gets only hidden files and directories (folders). By default, [Get-ChildItem](../../../Microsoft.PowerShell.Management/Get-ChildItem.md) gets only non-hidden items, but you can use the Force parameter to include hidden items in the results. +### -Hidden + Gets only hidden files and directories (folders). By default, [Get-ChildItem](../../../Microsoft.PowerShell.Management/Get-ChildItem.md) gets only non-hidden items, but you can use the Force parameter to include hidden items in the results. - To get only hidden items, use the Hidden parameter, its "h" or "ah" aliases, or the Hidden value of the Attributes parameter. To exclude hidden items, omit the Hidden parameter or use the Attributes parameter. + To get only hidden items, use the Hidden parameter, its "h" or "ah" aliases, or the Hidden value of the Attributes parameter. To exclude hidden items, omit the Hidden parameter or use the Attributes parameter. -||| -|-|-| -|Required?|false| -|Position?|named| -|Default Value|| -|Accept Pipeline Input?|false| -|Accept Wildcard Characters?|false| +||| +|-|-| +|Required?|false| +|Position?|named| +|Default Value|| +|Accept Pipeline Input?|false| +|Accept Wildcard Characters?|false| -### -ReadOnly - Gets only read-only files and directories (folders). +### -ReadOnly + Gets only read-only files and directories (folders). - To get only read-only items, use the ReadOnly parameter, its "ar" alias, or the ReadOnly value of the Attributes parameter. To exclude read-only items, use the Attributes parameter. + To get only read-only items, use the ReadOnly parameter, its "ar" alias, or the ReadOnly value of the Attributes parameter. To exclude read-only items, use the Attributes parameter. -||| -|-|-| -|Required?|false| -|Position?|named| -|Default Value|| -|Accept Pipeline Input?|false| -|Accept Wildcard Characters?|false| +||| +|-|-| +|Required?|false| +|Position?|named| +|Default Value|| +|Accept Pipeline Input?|false| +|Accept Wildcard Characters?|false| -### -System - Gets only system files and directories (folders). +### -System + Gets only system files and directories (folders). - To get only system files and folders, use the System parameter, its "as" alias, or the System value of the Attributes parameter. To exclude system files and folders, use the Attributes parameter. + To get only system files and folders, use the System parameter, its "as" alias, or the System value of the Attributes parameter. To exclude system files and folders, use the Attributes parameter. -||| -|-|-| -|Required?|false| -|Position?|named| -|Default Value|| -|Accept Pipeline Input?|false| -|Accept Wildcard Characters?|false| +||| +|-|-| +|Required?|false| +|Position?|named| +|Default Value|| +|Accept Pipeline Input?|false| +|Accept Wildcard Characters?|false| -### -Force - Gets hidden files and folders. By default, hidden files and folder are excluded. You can also get hidden files and folders by using the Hidden parameter or the Hidden value of the Attributes parameter. +### -Force + Gets hidden files and folders. By default, hidden files and folder are excluded. You can also get hidden files and folders by using the Hidden parameter or the Hidden value of the Attributes parameter. -||| -|-|-| -|Required?|false| -|Position?|named| -|Default Value|| -|Accept Pipeline Input?|false| -|Accept Wildcard Characters?|false| +||| +|-|-| +|Required?|false| +|Position?|named| +|Default Value|| +|Accept Pipeline Input?|false| +|Accept Wildcard Characters?|false| -### -UseTransaction - Includes the command in the active transaction. This parameter is valid only when a transaction is in progress. For more information, see [about_Transactions](../../About/about_Transactions.md). +### + This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, -OutVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](../../About/about_CommonParameters.md). -||| -|-|-| -|Required?|false| -|Position?|named| -|Default Value|| -|Accept Pipeline Input?|false| -|Accept Wildcard Characters?|false| +## Inputs and Outputs + The input type is the type of the objects that you can pipe to the cmdlet. The return type is the type of the objects that the cmdlet returns. -### - This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, -OutVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](../../About/about_CommonParameters.md). +||| +|-|-| +|Inputs|System.String[]

You can pipe a file system path (in quotation marks) to Get-ChildItem.| +|Outputs|System.IO.DirectoryInfo, System.IO.FileInfo, System.String| -## Inputs and Outputs - The input type is the type of the objects that you can pipe to the cmdlet. The return type is the type of the objects that the cmdlet returns. +## Notes + The Attributes, Directory, File, Hidden, ReadOnly, and System parameters were introduced in Windows PowerShell 3.0 and -||| -|-|-| -|Inputs|System.String[]

You can pipe a file system path (in quotation marks) to Get-ChildItem.| -|Outputs|System.IO.DirectoryInfo, System.IO.FileInfo, System.String| + are effective only in file system drives. -## Notes - The Attributes, Directory, File, Hidden, ReadOnly, and System parameters were introduced in Windows PowerShell 3.0 and + Get-ChildItem Alias Reference: - are effective only in file system drives. + --------------------------------\- - Get-ChildItem Alias Reference: + Get-ChildItem dir - --------------------------------\- + Directory d, ad - Get-ChildItem dir + File af - Directory d, ad + Hidden h, ah - File af + ReadOnly ar - Hidden h, ah + System as - ReadOnly ar +## Example 1 - System as +``` +C:\PS>Get-ChildItem -## Example 1 +Description +----------- +This command gets the files and subdirectories in the current directory. If the current directory does not have child items, the command does not return any results. -``` -C:\PS>Get-ChildItem +``` -Description ------------ -This command gets the files and subdirectories in the current directory. If the current directory does not have child items, the command does not return any results. +## Example 2 -``` +``` +C:\PS>Get-Childitem -System -File -Recurse -## Example 2 +Description +----------- +This command gets system files in the current directory and its subdirectories. -``` -C:\PS>Get-Childitem -System -File -Recurse +``` -Description ------------ -This command gets system files in the current directory and its subdirectories. +## Example 3 -``` +``` +C:\PS>Get-ChildItem -Attributes !Directory,!Directory+Hidden -## Example 3 +C:\PS> dir -att !d,!d+h -``` -C:\PS>Get-ChildItem -Attributes !Directory,!Directory+Hidden +Description +----------- +These command get all files, including hidden files, in the current directory, but exclude subdirectories. The second command uses aliases and abbreviations, but has the same effect as the first. -C:\PS> dir -att !d,!d+h +``` -Description ------------ -These command get all files, including hidden files, in the current directory, but exclude subdirectories. The second command uses aliases and abbreviations, but has the same effect as the first. +## Example 4 -``` +``` +C:\PS>dir -ad -## Example 4 +Description +----------- +This command gets the subdirectories in the current directory. It uses the "dir" alias of the Get-ChildItem cmdlet and the "ad" alias of the Directory parameter. -``` -C:\PS>dir -ad +``` -Description ------------ -This command gets the subdirectories in the current directory. It uses the "dir" alias of the Get-ChildItem cmdlet and the "ad" alias of the Directory parameter. +## Example 5 -``` +``` +C:\PS>Get-ChildItem -File -Attributes !ReadOnly -path C:\ps-test -## Example 5 +Description +----------- +This command gets read-write files in the C:\ps-test directory. -``` -C:\PS>Get-ChildItem -File -Attributes !ReadOnly -path C:\ps-test +``` -Description ------------ -This command gets read-write files in the C:\ps-test directory. +## Example 6 -``` +``` +C:\PS>get-childitem . -include *.txt -recurse -force -## Example 6 +Description +----------- +This command gets all of the .txt files in the current directory and its subdirectories. -``` -C:\PS>get-childitem . -include *.txt -recurse -force +The dot (.) represents the current directory. The Include parameter specifies the file name extension. The Recurse parameter directs Windows PowerShell to search for objects recursively, and it indicates that the subject of the command is the specified directory and its contents. The Force parameter adds hidden files to the display. -Description ------------ -This command gets all of the .txt files in the current directory and its subdirectories. +``` -The dot (.) represents the current directory. The Include parameter specifies the file name extension. The Recurse parameter directs Windows PowerShell to search for objects recursively, and it indicates that the subject of the command is the specified directory and its contents. The Force parameter adds hidden files to the display. +## Example 7 -``` +``` +C:\PS>get-childitem c:\windows\logs\* -include *.txt -exclude A* -## Example 7 +Description +----------- +This command gets the .txt files in the Logs subdirectory, except for those whose names start with the letter A. It uses the wildcard character (*) to indicate the contents of the Logs subdirectory, not the directory container. Because the command does not include the Recurse parameter, Get-ChildItem does not include the contents of the current directory automatically; you need to specify it. -``` -C:\PS>get-childitem c:\windows\logs\* -include *.txt -exclude A* +``` -Description ------------ -This command gets the .txt files in the Logs subdirectory, except for those whose names start with the letter A. It uses the wildcard character (*) to indicate the contents of the Logs subdirectory, not the directory container. Because the command does not include the Recurse parameter, Get-ChildItem does not include the contents of the current directory automatically; you need to specify it. +## Example 8 -``` +``` +C:\PS>get-childitem -name -## Example 8 +Description +----------- +This command retrieves only the names of items in the current directory. -``` -C:\PS>get-childitem -name +``` -Description ------------ -This command retrieves only the names of items in the current directory. - -``` - -## See Also - [FileSystem Provider](../FileSystem-Provider.md) - [Clear-Content](../../../Microsoft.PowerShell.Management/Clear-Content.md) - [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) - [Get-ChildItem](../../../Microsoft.PowerShell.Management/Get-ChildItem.md) - [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) - [Get-Item](../../../Microsoft.PowerShell.Management/Get-Item.md) - [Remove-Item](../../../Microsoft.PowerShell.Management/Remove-Item.md) - [Set-Content](../../../Microsoft.PowerShell.Management/Set-Content.md) +## See Also + [FileSystem Provider](../FileSystem-Provider.md) + [Clear-Content](../../../Microsoft.PowerShell.Management/Clear-Content.md) + [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) + [Get-ChildItem](../../../Microsoft.PowerShell.Management/Get-ChildItem.md) + [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) + [Get-Item](../../../Microsoft.PowerShell.Management/Get-Item.md) + [Remove-Item](../../../Microsoft.PowerShell.Management/Remove-Item.md) + [Set-Content](../../../Microsoft.PowerShell.Management/Set-Content.md) [Test-Path](../../../Microsoft.PowerShell.Management/Test-Path.md) diff --git a/reference/6/Microsoft.PowerShell.Core/Providers/FileSystem-Provider/Get-Content-for-FileSystem.md b/reference/6/Microsoft.PowerShell.Core/Providers/FileSystem-Provider/Get-Content-for-FileSystem.md index 0dc9118751ea..f34d1a0531b0 100644 --- a/reference/6/Microsoft.PowerShell.Core/Providers/FileSystem-Provider/Get-Content-for-FileSystem.md +++ b/reference/6/Microsoft.PowerShell.Core/Providers/FileSystem-Provider/Get-Content-for-FileSystem.md @@ -8,306 +8,295 @@ online version: http://go.microsoft.com/fwlink/?LinkId=834951 --- # Get-Content for FileSystem -Gets the contents of a file. +Gets the contents of a file. -## Syntax +## Syntax -``` -Get-Content [-Delimiter ] [-Encoding { | | | | | | | | | | }] [-Force] [-Raw ] [-Stream ] [-Wait] [-UseTransaction] [] +``` +Get-Content [-Delimiter ] [-Encoding { | | | | | | | | | | }] [-Force] [-Raw ] [-Stream ] [-Wait] [] -``` +``` -## Description - In file system drives, you can use the [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) cmdlet to get content that you display at the command line, save in a variable for processing, or write to another file. It is not valid on folders. +## Description + In file system drives, you can use the [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) cmdlet to get content that you display at the command line, save in a variable for processing, or write to another file. It is not valid on folders. - Note: This custom cmdlet help file explains how the [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) cmdlet works in a file system drive. For information about the [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) cmdlet in all drives, type "[Get-Help](../../Get-Help.md)[Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) -Path $null" or see [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) at http://go.microsoft.com/fwlink/?LinkID=113310. + Note: This custom cmdlet help file explains how the [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) cmdlet works in a file system drive. For information about the [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) cmdlet in all drives, type "[Get-Help](../../Get-Help.md)[Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) -Path $null" or see [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) at http://go.microsoft.com/fwlink/?LinkID=113310. -## Parameters +## Parameters -### -Encoding - Specifies the file encoding. The default is ASCII. +### -Encoding + Specifies the file encoding. The default is ASCII. - Valid values are: + Valid values are: - -- ASCII: Uses the encoding for the ASCII (7-bit) character set. + -- ASCII: Uses the encoding for the ASCII (7-bit) character set. - -- BigEndianUnicode: Encodes in UTF-16 format using the big-endian byte order. + -- BigEndianUnicode: Encodes in UTF-16 format using the big-endian byte order. - -- Byte: Encodes a set of characters into a sequence of bytes. + -- Byte: Encodes a set of characters into a sequence of bytes. - -- String: Uses the encoding type for a string. + -- String: Uses the encoding type for a string. - -- Unicode: Encodes in UTF-16 format using the little-endian byte order. + -- Unicode: Encodes in UTF-16 format using the little-endian byte order. - -- UTF7: Encodes in UTF-7 format. + -- UTF7: Encodes in UTF-7 format. - -- UTF8: Encodes in UTF-8 format. + -- UTF8: Encodes in UTF-8 format. - -- Unknown: The encoding type is unknown or invalid. The data can be treated as binary. + -- Unknown: The encoding type is unknown or invalid. The data can be treated as binary. - Encoding is a dynamic parameter that the FileSystem provider adds to the [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) cmdlet. This parameter works only in file system drives. + Encoding is a dynamic parameter that the FileSystem provider adds to the [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) cmdlet. This parameter works only in file system drives. - When reading from and writing to binary files, use a value of Byte for the Encoding dynamic parameter and a value of 0 for the ReadCount parameter. A ReadCount value of 0 reads the entire file in a single read operation and converts it into a single object (PSObject). The default ReadCount value, 1, reads one byte in each read operation and converts each byte into a separate object, which causes errors when you use the [Set-Content](../../../Microsoft.PowerShell.Management/Set-Content.md) cmdlet to write the bytes to a file. For more information, see the examples. + When reading from and writing to binary files, use a value of Byte for the Encoding dynamic parameter and a value of 0 for the ReadCount parameter. A ReadCount value of 0 reads the entire file in a single read operation and converts it into a single object (PSObject). The default ReadCount value, 1, reads one byte in each read operation and converts each byte into a separate object, which causes errors when you use the [Set-Content](../../../Microsoft.PowerShell.Management/Set-Content.md) cmdlet to write the bytes to a file. For more information, see the examples. -||| -|-|-| -|Required?|false| -|Position?|named| -|Default Value|ASCII| -|Accept Pipeline Input?|false| -|Accept Wildcard Characters?|false| +||| +|-|-| +|Required?|false| +|Position?|named| +|Default Value|ASCII| +|Accept Pipeline Input?|false| +|Accept Wildcard Characters?|false| -### -Delimiter - Specifies the delimiter that [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) uses to divide the file into objects while it reads. +### -Delimiter + Specifies the delimiter that [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) uses to divide the file into objects while it reads. - The default is "\n", the end-of-line character. + The default is "\n", the end-of-line character. - Therefore, by default, when reading a text file, [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) returns a collection of string objects, each of which ends with an end-of-line character. + Therefore, by default, when reading a text file, [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) returns a collection of string objects, each of which ends with an end-of-line character. - When you enter a delimiter that does not exist in the file, [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) returns the entire file as a single, undelimited object. + When you enter a delimiter that does not exist in the file, [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) returns the entire file as a single, undelimited object. - You can use this parameter to split a large file into smaller files by specifying a file separator, such as "End of Example", as the delimiter. The delimiter is preserved (not discarded) and becomes the last item in each file section. + You can use this parameter to split a large file into smaller files by specifying a file separator, such as "End of Example", as the delimiter. The delimiter is preserved (not discarded) and becomes the last item in each file section. - Delimiter is a dynamic parameter that the FileSystem provider adds to the [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) cmdlet. This parameter works only in file system drives. + Delimiter is a dynamic parameter that the FileSystem provider adds to the [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) cmdlet. This parameter works only in file system drives. - Troubleshooting Note: Currently, when the value of the Delimiter parameter is an empty string, [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) does not return anything. This is a known issue. To force [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) to return the entire file as a single, undelimited string, enter a value that does not exist in the file. + Troubleshooting Note: Currently, when the value of the Delimiter parameter is an empty string, [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) does not return anything. This is a known issue. To force [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) to return the entire file as a single, undelimited string, enter a value that does not exist in the file. -||| -|-|-| -|Required?|false| -|Position?|named| -|Default Value|End-of-line character| -|Accept Pipeline Input?|false| -|Accept Wildcard Characters?|false| +||| +|-|-| +|Required?|false| +|Position?|named| +|Default Value|End-of-line character| +|Accept Pipeline Input?|false| +|Accept Wildcard Characters?|false| -### -Force - Gets the contents of all files, including hidden files. By default, [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) does not get the contents of hidden files unless you specify the hidden file by name. +### -Force + Gets the contents of all files, including hidden files. By default, [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) does not get the contents of hidden files unless you specify the hidden file by name. -||| -|-|-| -|Required?|false| -|Position?|named| -|Default Value|False| -|Accept Pipeline Input?|false| -|Accept Wildcard Characters?|false| +||| +|-|-| +|Required?|false| +|Position?|named| +|Default Value|False| +|Accept Pipeline Input?|false| +|Accept Wildcard Characters?|false| -### -Raw - Ignores newline characters and returns the entire contents of a file in one string. By default, the contents of a file is returned as a array of strings that is delimited by the newline character. +### -Raw + Ignores newline characters and returns the entire contents of a file in one string. By default, the contents of a file is returned as a array of strings that is delimited by the newline character. - Raw is a dynamic parameter that the FileSystem provider adds to the [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) cmdlet. This parameter works only in file system drives. + Raw is a dynamic parameter that the FileSystem provider adds to the [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) cmdlet. This parameter works only in file system drives. - This parameter is introduced in Windows PowerShell 3.0. + This parameter is introduced in Windows PowerShell 3.0. -||| -|-|-| -|Required?|false| -|Position?|named| -|Default Value|| -|Accept Pipeline Input?|false| -|Accept Wildcard Characters?|false| +||| +|-|-| +|Required?|false| +|Position?|named| +|Default Value|| +|Accept Pipeline Input?|false| +|Accept Wildcard Characters?|false| -### -Wait - Waits for the cmdlet to get the content before returning the command prompt. While waiting, [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) checks the file once each second until you interrupt it, such as by pressing CTRL+C. +### -Wait + Waits for the cmdlet to get the content before returning the command prompt. While waiting, [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) checks the file once each second until you interrupt it, such as by pressing CTRL+C. - Wait is a dynamic parameter that the FileSystem provider adds to the [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) cmdlet. This parameter works only in file system drives. + Wait is a dynamic parameter that the FileSystem provider adds to the [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) cmdlet. This parameter works only in file system drives. -||| -|-|-| -|Required?|false| -|Position?|named| -|Default Value|False| -|Accept Pipeline Input?|false| -|Accept Wildcard Characters?|false| +||| +|-|-| +|Required?|false| +|Position?|named| +|Default Value|False| +|Accept Pipeline Input?|false| +|Accept Wildcard Characters?|false| -### -Stream - Gets the contents of the specified alternate NTFS file stream from the file. Enter the stream name. Wildcards are not supported. +### -Stream + Gets the contents of the specified alternate NTFS file stream from the file. Enter the stream name. Wildcards are not supported. - Stream is a dynamic parameter that the FileSystem provider adds to the [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) cmdlet. This parameter works only in file system drives. + Stream is a dynamic parameter that the FileSystem provider adds to the [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) cmdlet. This parameter works only in file system drives. - This parameter is introduced in Windows PowerShell 3.0. + This parameter is introduced in Windows PowerShell 3.0. -||| -|-|-| -|Required?|false| -|Position?|named| -|Default Value|| -|Accept Pipeline Input?|false| -|Accept Wildcard Characters?|false| +||| +|-|-| +|Required?|false| +|Position?|named| +|Default Value|| +|Accept Pipeline Input?|false| +|Accept Wildcard Characters?|false| -### -UseTransaction - Includes the command in the active transaction. This parameter is valid only when a transaction is in progress. For more information, see [about_Transactions](../../About/about_Transactions.md). +### + This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, -OutVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](../../About/about_CommonParameters.md). -||| -|-|-| -|Required?|false| -|Position?|named| -|Default Value|| -|Accept Pipeline Input?|false| -|Accept Wildcard Characters?|false| +## Inputs and Outputs + The input type is the type of the objects that you can pipe to the cmdlet. The return type is the type of the objects that the cmdlet returns. -### - This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, -OutVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](../../About/about_CommonParameters.md). +||| +|-|-| +|Inputs|System.Int64, System.String[], System.Management.Automation.PSCredential

You can pipe the read count, total count, paths, or credentials to Get-Content.| +|Outputs|System.Object, System.String

Get-Content returns objects that represent the content that it gets. The object type depends on the content type. If you use the Stream parameter, the cmdlet returns the alternate data stream contents as a string.| -## Inputs and Outputs - The input type is the type of the objects that you can pipe to the cmdlet. The return type is the type of the objects that the cmdlet returns. +## Example 1 -||| -|-|-| -|Inputs|System.Int64, System.String[], System.Management.Automation.PSCredential

You can pipe the read count, total count, paths, or credentials to Get-Content.| -|Outputs|System.Object, System.String

Get-Content returns objects that represent the content that it gets. The object type depends on the content type. If you use the Stream parameter, the cmdlet returns the alternate data stream contents as a string.| +``` +C:\PS>Get-Content -Path C:\Chapters\chapter1.txt -## Example 1 +Description +----------- +This command gets the content of the Chapter1.txt file and displays it in the console. It uses the Path parameter to specify the name of the item. -``` -C:\PS>Get-Content -Path C:\Chapters\chapter1.txt +Get-Content actually passes the content down the pipeline, but because there are no other cmdlets in the pipeline, Windows PowerShell formats the contents and displays it in the console. -Description ------------ -This command gets the content of the Chapter1.txt file and displays it in the console. It uses the Path parameter to specify the name of the item. +``` -Get-Content actually passes the content down the pipeline, but because there are no other cmdlets in the pipeline, Windows PowerShell formats the contents and displays it in the console. +## Example 2 -``` +``` +C:\PS>Get-Content C:\Logs\Log060912.txt -TotalCount 50 | Set-Content Sample.txt -## Example 2 +Description +----------- +This command gets the first 50 lines of the Log060912.txt file and stores them in the sample.txt file. -``` -C:\PS>Get-Content C:\Logs\Log060912.txt -TotalCount 50 | Set-Content Sample.txt +The command uses the Get-Content cmdlet to get the text in the file. (The name of Path parameter, which is optional, is omitted.) The TotalCount parameter limits the retrieval to the first 50 lines. The pipeline operator (|) sends the result to Set-Content, which places it in the sample.txt file. -Description ------------ -This command gets the first 50 lines of the Log060912.txt file and stores them in the sample.txt file. +``` -The command uses the Get-Content cmdlet to get the text in the file. (The name of Path parameter, which is optional, is omitted.) The TotalCount parameter limits the retrieval to the first 50 lines. The pipeline operator (|) sends the result to Set-Content, which places it in the sample.txt file. +## Example 3 -``` +``` +C:\PS>(Get-Content Cmdlets.txt -TotalCount 5)[-1] -## Example 3 +Description +----------- +This command gets the fifth line of the Cmdlets.txt text file. It uses the TotalCount parameter to get the first five lines and then uses array notation to get the last line (indicated by "-1") of the resulting set. -``` -C:\PS>(Get-Content Cmdlets.txt -TotalCount 5)[-1] +``` -Description ------------ -This command gets the fifth line of the Cmdlets.txt text file. It uses the TotalCount parameter to get the first five lines and then uses array notation to get the last line (indicated by "-1") of the resulting set. +## Example 4 -``` +``` +C:\PS>Get-Content .\DataSets\*.csv -Delimiter "*---*" -Force -Encoding UTF8 -## Example 4 +Description +----------- +This command gets the contents of all CSV files in the DataSets subdirectory. It uses the Force parameter to get all files, including hidden files, and the Encoding parameter to specify the file encoding. -``` -C:\PS>Get-Content .\DataSets\*.csv -Delimiter "*---*" -Force -Encoding UTF8 +The command also uses the Delimiter parameter to divide the returned content into sets, each of which ends at the CSV file row that contains the "*----*" marker. -Description ------------ -This command gets the contents of all CSV files in the DataSets subdirectory. It uses the Force parameter to get all files, including hidden files, and the Encoding parameter to specify the file encoding. +``` -The command also uses the Delimiter parameter to divide the returned content into sets, each of which ends at the CSV file row that contains the "*----*" marker. +## Example 5 -``` +``` +C:\PS>Get-Content .\Copy-Scripts.ps1 -Stream Zone.Identifier -## Example 5 +[ZoneTransfer] +ZoneId=3 -``` -C:\PS>Get-Content .\Copy-Scripts.ps1 -Stream Zone.Identifier +Description +----------- +This command uses the Stream parameter to get the content of the Zone.Identifier alternate data stream. The output includes Zone ID value of 3, which represents the Internet. -[ZoneTransfer] -ZoneId=3 +The Stream parameter is introduced in Windows PowerShell 3.0. -Description ------------ -This command uses the Stream parameter to get the content of the Zone.Identifier alternate data stream. The output includes Zone ID value of 3, which represents the Internet. +``` -The Stream parameter is introduced in Windows PowerShell 3.0. +## Example 6 -``` +``` +C:\PS>$Manifest = (Get-Module -List PSScheduledJob).Path -## Example 6 +C:\PS>$Hash = Invoke-Expression (Get-Content $Manifest -Raw) -``` -C:\PS>$Manifest = (Get-Module -List PSScheduledJob).Path +C:\PS>$Hash -C:\PS>$Hash = Invoke-Expression (Get-Content $Manifest -Raw) +Name Value +---- ----- +Copyright ? Microsoft Corporation. All rights reserved. +ModuleToProcess Microsoft.PowerShell.ScheduledJob.dll +FormatsToProcess PSScheduledJob.Format.ps1xml +PowerShellVersion 3.0 +CompanyName Microsoft Corporation +GUID 50cdb55f-5ab7-489f-9e94-4ec21ff51e59 +Author Microsoft Corporation +CLRVersion 4.0 +CmdletsToExport {New-JobTrigger, Add-JobTrigger, Remove-JobTrigger, Get-JobTrigger...} +TypesToProcess PSScheduledJob.types.ps1xml +HelpInfoURI http://go.microsoft.com/fwlink/?LinkID=223911 +ModuleVersion 1.0.0.0 -C:\PS>$Hash +C:\PS>$Hash.ModuleToProcess +Microsoft.PowerShell.ScheduledJob.dll -Name Value ----- ----- -Copyright ? Microsoft Corporation. All rights reserved. -ModuleToProcess Microsoft.PowerShell.ScheduledJob.dll -FormatsToProcess PSScheduledJob.Format.ps1xml -PowerShellVersion 3.0 -CompanyName Microsoft Corporation -GUID 50cdb55f-5ab7-489f-9e94-4ec21ff51e59 -Author Microsoft Corporation -CLRVersion 4.0 -CmdletsToExport {New-JobTrigger, Add-JobTrigger, Remove-JobTrigger, Get-JobTrigger...} -TypesToProcess PSScheduledJob.types.ps1xml -HelpInfoURI http://go.microsoft.com/fwlink/?LinkID=223911 -ModuleVersion 1.0.0.0 +Description +----------- +The commands in this example get the contents of a module manifest file (.psd1) as a hash table. The manifest file contains a hash table, but if you get the contents without the Raw dynamic parameter, it is returned as an array of newline-delimited strings. -C:\PS>$Hash.ModuleToProcess -Microsoft.PowerShell.ScheduledJob.dll +The Raw dynamic parameter is introduced in Windows PowerShell 3.0. -Description ------------ -The commands in this example get the contents of a module manifest file (.psd1) as a hash table. The manifest file contains a hash table, but if you get the contents without the Raw dynamic parameter, it is returned as an array of newline-delimited strings. +The first command uses the Path property of modules to get the path to the file that contains the module manifest for the PSScheduledJob module. It saves the path in the $Manifest variable. -The Raw dynamic parameter is introduced in Windows PowerShell 3.0. +The second command uses the Invoke-Expression cmdlet to run a Get-Content command and the Raw dynamic parameter of the Get-Content cmdlet to get the contents of the module manifest file in a single string. The command saves the hash table in the $Hash variable. -The first command uses the Path property of modules to get the path to the file that contains the module manifest for the PSScheduledJob module. It saves the path in the $Manifest variable. +The third command gets the hash table in the Hash variable. The contents is returned as a collection of name-value pairs. -The second command uses the Invoke-Expression cmdlet to run a Get-Content command and the Raw dynamic parameter of the Get-Content cmdlet to get the contents of the module manifest file in a single string. The command saves the hash table in the $Hash variable. +The fourth command uses the ModuleToProcess property of the hash table to get the value of the ModuleToProcess key in the module manifest. -The third command gets the hash table in the Hash variable. The contents is returned as a collection of name-value pairs. +``` -The fourth command uses the ModuleToProcess property of the hash table to get the value of the ModuleToProcess key in the module manifest. +## Example 7 -``` +``` +C:\PS>$a = Get-Content -Path .\Download.zip -Encoding Byte -ReadCount 0 -## Example 7 +Set-Content -Path \\Server\Share\Download.zip -Encoding Byte -Value $a -``` -C:\PS>$a = Get-Content -Path .\Download.zip -Encoding Byte -ReadCount 0 +$b = Get-Content -Path .\Download.zip -Encoding Byte +Set-Content -Path \\Server\Share\Download.zip -Encoding Byte -Value $b -Set-Content -Path \\Server\Share\Download.zip -Encoding Byte -Value $a +Set-Content : Cannot proceed with byte encoding. When using byte encoding the content must be of type byte. +At line:1 char:1 ++ Set-Content \\Server\Share\Download.zip -Encoding Byte -Value $b ++ [!INCLUDE[]()][!INCLUDE[]()][!INCLUDE[]()]~~~~~ + + CategoryInfo : InvalidArgument: (:) [Set-Content], PSArgumentException + + FullyQualifiedErrorId : Argument,Microsoft.PowerShell.Commands.SetContentCommand -$b = Get-Content -Path .\Download.zip -Encoding Byte -Set-Content -Path \\Server\Share\Download.zip -Encoding Byte -Value $b +Description +----------- +This example shows how to use the ReadCount parameter of the Get-Content cmdlet with a value of 0 to avoid byte-related errors when using the Set-Content cmdlet to write the bytes to a file. -Set-Content : Cannot proceed with byte encoding. When using byte encoding the content must be of type byte. -At line:1 char:1 -+ Set-Content \\Server\Share\Download.zip -Encoding Byte -Value $b -+ [!INCLUDE[]()][!INCLUDE[]()][!INCLUDE[]()]~~~~~ - + CategoryInfo : InvalidArgument: (:) [Set-Content], PSArgumentException - + FullyQualifiedErrorId : Argument,Microsoft.PowerShell.Commands.SetContentCommand +When getting the content of a file in bytes, Get-Content creates an object (PSObject) for the bytes in each read operation. If you read the bytes one at a time, which is the default, Get-Content creates an object for each byte. The objects cause errors when you use the Set-Content cmdlet to write the bytes to a file. -Description ------------ -This example shows how to use the ReadCount parameter of the Get-Content cmdlet with a value of 0 to avoid byte-related errors when using the Set-Content cmdlet to write the bytes to a file. +The first command uses the Get-Content cmdlet to get the contents of the Download.zip file and save it in the $a variable. The command uses the Encoding dynamic parameter with a value of Byte. It also uses the ReadCount parameter with a value of 0, which directs Get-Content to get the file contents in a single read operation. The default value of the ReadCount parameter, 1, gets one byte at a time. -When getting the content of a file in bytes, Get-Content creates an object (PSObject) for the bytes in each read operation. If you read the bytes one at a time, which is the default, Get-Content creates an object for each byte. The objects cause errors when you use the Set-Content cmdlet to write the bytes to a file. +The second command uses the Set-Content cmdlet to write the bytes in the $a variable to the Download.zip file on a file share. The command succeeds. -The first command uses the Get-Content cmdlet to get the contents of the Download.zip file and save it in the $a variable. The command uses the Encoding dynamic parameter with a value of Byte. It also uses the ReadCount parameter with a value of 0, which directs Get-Content to get the file contents in a single read operation. The default value of the ReadCount parameter, 1, gets one byte at a time. +The third and fourth commands show the same sequence without the ReadCount parameter. -The second command uses the Set-Content cmdlet to write the bytes in the $a variable to the Download.zip file on a file share. The command succeeds. +The third command uses the Encoding dynamic parameter of the Get-Content cmdlet to get the contents of the Download.zip file and save it in the $b variable. Because the command omits the ReadCount parameter, it uses the default value of 1. -The third and fourth commands show the same sequence without the ReadCount parameter. +The fourth command uses the Set-Content cmdlet to write the bytes in the $b variable to the Download.zip file on a file share. Because the content is a collection of objects, rather than a single object that contains a byte array, the command fails. -The third command uses the Encoding dynamic parameter of the Get-Content cmdlet to get the contents of the Download.zip file and save it in the $b variable. Because the command omits the ReadCount parameter, it uses the default value of 1. +``` -The fourth command uses the Set-Content cmdlet to write the bytes in the $b variable to the Download.zip file on a file share. Because the content is a collection of objects, rather than a single object that contains a byte array, the command fails. - -``` - -## See Also - [FileSystem Provider](../FileSystem-Provider.md) - [Clear-Content](../../../Microsoft.PowerShell.Management/Clear-Content.md) - [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) - [Get-ChildItem](../../../Microsoft.PowerShell.Management/Get-ChildItem.md) - [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) - [Get-Item](../../../Microsoft.PowerShell.Management/Get-Item.md) - [Remove-Item](../../../Microsoft.PowerShell.Management/Remove-Item.md) - [Set-Content](../../../Microsoft.PowerShell.Management/Set-Content.md) +## See Also + [FileSystem Provider](../FileSystem-Provider.md) + [Clear-Content](../../../Microsoft.PowerShell.Management/Clear-Content.md) + [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) + [Get-ChildItem](../../../Microsoft.PowerShell.Management/Get-ChildItem.md) + [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) + [Get-Item](../../../Microsoft.PowerShell.Management/Get-Item.md) + [Remove-Item](../../../Microsoft.PowerShell.Management/Remove-Item.md) + [Set-Content](../../../Microsoft.PowerShell.Management/Set-Content.md) [Test-Path](../../../Microsoft.PowerShell.Management/Test-Path.md) diff --git a/reference/6/Microsoft.PowerShell.Core/Providers/FileSystem-Provider/Set-Content-for-FileSystem.md b/reference/6/Microsoft.PowerShell.Core/Providers/FileSystem-Provider/Set-Content-for-FileSystem.md index 8c62b5e182fd..ae67263f126e 100644 --- a/reference/6/Microsoft.PowerShell.Core/Providers/FileSystem-Provider/Set-Content-for-FileSystem.md +++ b/reference/6/Microsoft.PowerShell.Core/Providers/FileSystem-Provider/Set-Content-for-FileSystem.md @@ -8,187 +8,176 @@ online version: http://go.microsoft.com/fwlink/?LinkId=834955 --- # Set-Content for FileSystem -Replaces the contents of a file with contents that you specify. +Replaces the contents of a file with contents that you specify. -## Syntax +## Syntax -``` -Set-Content [-Encoding { | | | | | | | | | | }] [-Force] [-Stream ] [-Confirm] [-WhatIf] [-UseTransaction] [] +``` +Set-Content [-Encoding { | | | | | | | | | | }] [-Force] [-Stream ] [-Confirm] [-WhatIf] [] -``` +``` -## Description - In file system drives, the [Set-Content](../../../Microsoft.PowerShell.Management/Set-Content.md) cmdlet overwrites or replaces the content of one or more files with the content that you specify. This cmdlet is not valid on folders. +## Description + In file system drives, the [Set-Content](../../../Microsoft.PowerShell.Management/Set-Content.md) cmdlet overwrites or replaces the content of one or more files with the content that you specify. This cmdlet is not valid on folders. - Note: This custom cmdlet help file explains how the [Set-Content](../../../Microsoft.PowerShell.Management/Set-Content.md) cmdlet works in a file system drive. For information about the [Set-Content](../../../Microsoft.PowerShell.Management/Set-Content.md) cmdlet in all drives, type "[Get-Help](../../Get-Help.md)[Set-Content](../../../Microsoft.PowerShell.Management/Set-Content.md) -Path $null" or see [Set-Content](../../../Microsoft.PowerShell.Management/Set-Content.md) at http://go.microsoft.com/fwlink/?LinkID=113392. + Note: This custom cmdlet help file explains how the [Set-Content](../../../Microsoft.PowerShell.Management/Set-Content.md) cmdlet works in a file system drive. For information about the [Set-Content](../../../Microsoft.PowerShell.Management/Set-Content.md) cmdlet in all drives, type "[Get-Help](../../Get-Help.md)[Set-Content](../../../Microsoft.PowerShell.Management/Set-Content.md) -Path $null" or see [Set-Content](../../../Microsoft.PowerShell.Management/Set-Content.md) at http://go.microsoft.com/fwlink/?LinkID=113392. -## Parameters +## Parameters -### -Encoding - Specifies the file encoding. The default is ASCII. +### -Encoding + Specifies the file encoding. The default is ASCII. - Valid values are: + Valid values are: - -- ASCII: Uses the encoding for the ASCII (7-bit) character set. + -- ASCII: Uses the encoding for the ASCII (7-bit) character set. - -- BigEndianUnicode: Encodes in UTF-16 format using the big-endian byte order. + -- BigEndianUnicode: Encodes in UTF-16 format using the big-endian byte order. - -- Byte: Encodes a set of characters into a sequence of bytes. + -- Byte: Encodes a set of characters into a sequence of bytes. - -- String: Uses the encoding type for a string. + -- String: Uses the encoding type for a string. - -- Unicode: Encodes in UTF-16 format using the little-endian byte order. + -- Unicode: Encodes in UTF-16 format using the little-endian byte order. - -- UTF7: Encodes in UTF-7 format. + -- UTF7: Encodes in UTF-7 format. - -- UTF8: Encodes in UTF-8 format. + -- UTF8: Encodes in UTF-8 format. - -- Unknown: The encoding type is unknown or invalid. The data can be treated as binary. + -- Unknown: The encoding type is unknown or invalid. The data can be treated as binary. - Encoding is a dynamic parameter that the FileSystem provider adds to the [Set-Content](../../../Microsoft.PowerShell.Management/Set-Content.md) cmdlet. This parameter works only in file system drives. + Encoding is a dynamic parameter that the FileSystem provider adds to the [Set-Content](../../../Microsoft.PowerShell.Management/Set-Content.md) cmdlet. This parameter works only in file system drives. -||| -|-|-| -|Required?|false| -|Position?|named| -|Default Value|ASCII| -|Accept Pipeline Input?|false| -|Accept Wildcard Characters?|false| +||| +|-|-| +|Required?|false| +|Position?|named| +|Default Value|ASCII| +|Accept Pipeline Input?|false| +|Accept Wildcard Characters?|false| -### -Force - Replaces the contents of a file, even if the file is read-only. Without this parameter, read-only files are not changed. +### -Force + Replaces the contents of a file, even if the file is read-only. Without this parameter, read-only files are not changed. -||| -|-|-| -|Required?|false| -|Position?|named| -|Default Value|| -|Accept Pipeline Input?|false| -|Accept Wildcard Characters?|false| +||| +|-|-| +|Required?|false| +|Position?|named| +|Default Value|| +|Accept Pipeline Input?|false| +|Accept Wildcard Characters?|false| -### -Stream - Creates or replaces the content in the specified alternate data stream. If the stream does not yet exist, [Set-Content](../../../Microsoft.PowerShell.Management/Set-Content.md) creates it. Enter the stream name. Wildcards are not supported. +### -Stream + Creates or replaces the content in the specified alternate data stream. If the stream does not yet exist, [Set-Content](../../../Microsoft.PowerShell.Management/Set-Content.md) creates it. Enter the stream name. Wildcards are not supported. - Stream is a dynamic parameter that the FileSystem provider adds to the [Set-Content](../../../Microsoft.PowerShell.Management/Set-Content.md) cmdlet. This parameter works only in file system drives. + Stream is a dynamic parameter that the FileSystem provider adds to the [Set-Content](../../../Microsoft.PowerShell.Management/Set-Content.md) cmdlet. This parameter works only in file system drives. - You can use the [Set-Content](../../../Microsoft.PowerShell.Management/Set-Content.md) cmdlet to change the content of the Zone.Identifier alternate data stream. However, it is not the recommended way to eliminate security checks that block files that are downloaded from the Internet. If you verify that a downloaded file is safe, use the Unblock-File cmdlet. + You can use the [Set-Content](../../../Microsoft.PowerShell.Management/Set-Content.md) cmdlet to change the content of the Zone.Identifier alternate data stream. However, it is not the recommended way to eliminate security checks that block files that are downloaded from the Internet. If you verify that a downloaded file is safe, use the Unblock-File cmdlet. - This parameter is introduced in Windows PowerShell 3.0. + This parameter is introduced in Windows PowerShell 3.0. -||| -|-|-| -|Required?|false| -|Position?|named| -|Default Value|| -|Accept Pipeline Input?|false| -|Accept Wildcard Characters?|false| +||| +|-|-| +|Required?|false| +|Position?|named| +|Default Value|| +|Accept Pipeline Input?|false| +|Accept Wildcard Characters?|false| -### -Confirm - Prompts you for confirmation before executing the command. +### -Confirm + Prompts you for confirmation before executing the command. -||| -|-|-| -|Required?|false| -|Position?|named| -|Default Value|| -|Accept Pipeline Input?|false| -|Accept Wildcard Characters?|false| +||| +|-|-| +|Required?|false| +|Position?|named| +|Default Value|| +|Accept Pipeline Input?|false| +|Accept Wildcard Characters?|false| -### -WhatIf - Describes what would happen if you executed the command without actually executing the command. +### -WhatIf + Describes what would happen if you executed the command without actually executing the command. -||| -|-|-| -|Required?|false| -|Position?|named| -|Default Value|| -|Accept Pipeline Input?|false| -|Accept Wildcard Characters?|false| +||| +|-|-| +|Required?|false| +|Position?|named| +|Default Value|| +|Accept Pipeline Input?|false| +|Accept Wildcard Characters?|false| -### -UseTransaction - Includes the command in the active transaction. This parameter is valid only when a transaction is in progress. For more information, see [about_Transactions](../../About/about_Transactions.md). +### + This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, -OutVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](../../About/about_CommonParameters.md). -||| -|-|-| -|Required?|false| -|Position?|named| -|Default Value|| -|Accept Pipeline Input?|false| -|Accept Wildcard Characters?|false| +## Inputs and Outputs + The input type is the type of the objects that you can pipe to the cmdlet. The return type is the type of the objects that the cmdlet returns. -### - This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, -OutVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](../../About/about_CommonParameters.md). +||| +|-|-| +|Inputs|System.Object[], System.String[], System.Management.Automation.PSCredential

You can pipe a value (object), a path, or a credential object to Set-Content| +|Outputs|None or System.String

When you use the Passthru parameter, Set-Content generates a System.String object representing the content. Otherwise, this cmdlet does not generate any output.| -## Inputs and Outputs - The input type is the type of the objects that you can pipe to the cmdlet. The return type is the type of the objects that the cmdlet returns. +## Example 1 -||| -|-|-| -|Inputs|System.Object[], System.String[], System.Management.Automation.PSCredential

You can pipe a value (object), a path, or a credential object to Set-Content| -|Outputs|None or System.String

When you use the Passthru parameter, Set-Content generates a System.String object representing the content. Otherwise, this cmdlet does not generate any output.| +``` +C:\PS>Set-Content -Path C:\Test1\test*.txt -Value "Hello, World" -## Example 1 +Description +----------- +This command replaces the contents of all files in the Test1 directory that have names beginning with "test" with "Hello, World". This example shows how to specify content by typing it in the command. -``` -C:\PS>Set-Content -Path C:\Test1\test*.txt -Value "Hello, World" +``` -Description ------------ -This command replaces the contents of all files in the Test1 directory that have names beginning with "test" with "Hello, World". This example shows how to specify content by typing it in the command. +## Example 2 -``` +``` +C:\PS>Get-Date | Set-Content C:\Test1\date.csv -## Example 2 +Description +----------- +This command creates a comma-separated variable-length (csv) file that contains only the current date and time. It uses the Get-Date cmdlet to get the current system date and time. The pipeline operator passes the result to Set-Content, which creates the file and writes the content. -``` -C:\PS>Get-Date | Set-Content C:\Test1\date.csv +If the Test1 directory does not exist, the command fails, but if the file does not exist, the command will create it. -Description ------------ -This command creates a comma-separated variable-length (csv) file that contains only the current date and time. It uses the Get-Date cmdlet to get the current system date and time. The pipeline operator passes the result to Set-Content, which creates the file and writes the content. +``` -If the Test1 directory does not exist, the command fails, but if the file does not exist, the command will create it. +## Example 3 -``` +``` +C:\PS>Get-Content Notice.txt | ForEach-Object {$_ -replace "Warning", "Caution"} | Set-Content Notice.txt -## Example 3 +Description +----------- +This command replaces all instances of "Warning" with "Caution" in the Notice.txt file. -``` -C:\PS>Get-Content Notice.txt | ForEach-Object {$_ -replace "Warning", "Caution"} | Set-Content Notice.txt +It uses the Get-Content cmdlet to get the content of Notice.txt. The pipeline operator sends the results to the ForEach-Object cmdlet, which applies the expression to each line of content in Get-Content. The expression uses the "$_" symbol to refer to the current item and the Replace parameter to specify the text to be replaced. -Description ------------ -This command replaces all instances of "Warning" with "Caution" in the Notice.txt file. +Another pipeline operator sends the changed content to Set-Content which replaces the text in Notice.txt with the new content. -It uses the Get-Content cmdlet to get the content of Notice.txt. The pipeline operator sends the results to the ForEach-Object cmdlet, which applies the expression to each line of content in Get-Content. The expression uses the "$_" symbol to refer to the current item and the Replace parameter to specify the text to be replaced. +The parentheses around the Get-Content command ensure that the Get operation is complete before the Set operation begins. Without them, the command will fail because the two functions will be trying to access the same file. -Another pipeline operator sends the changed content to Set-Content which replaces the text in Notice.txt with the new content. +``` -The parentheses around the Get-Content command ensure that the Get operation is complete before the Set operation begins. Without them, the command will fail because the two functions will be trying to access the same file. +## Example 4 -``` +``` +C:\PS>Get-Content test.xml | Set-Content final.xml -Force -Encoding UTF8 -## Example 4 +Description +----------- +This command replaces the contents of the final.xml file with the contents of the test.xml file. -``` -C:\PS>Get-Content test.xml | Set-Content final.xml -Force -Encoding UTF8 +The command uses the Force parameter so that the command is successful even if the Final.xml file is read-only. It uses the Encoding dynamic parameter to specify an encoding of UTF-8. -Description ------------ -This command replaces the contents of the final.xml file with the contents of the test.xml file. +``` -The command uses the Force parameter so that the command is successful even if the Final.xml file is read-only. It uses the Encoding dynamic parameter to specify an encoding of UTF-8. - -``` - -## See Also - [FileSystem Provider](../FileSystem-Provider.md) - [Clear-Content](../../../Microsoft.PowerShell.Management/Clear-Content.md) - [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) - [Get-ChildItem](../../../Microsoft.PowerShell.Management/Get-ChildItem.md) - [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) - [Get-Item](../../../Microsoft.PowerShell.Management/Get-Item.md) - [Remove-Item](../../../Microsoft.PowerShell.Management/Remove-Item.md) - [Set-Content](../../../Microsoft.PowerShell.Management/Set-Content.md) +## See Also + [FileSystem Provider](../FileSystem-Provider.md) + [Clear-Content](../../../Microsoft.PowerShell.Management/Clear-Content.md) + [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) + [Get-ChildItem](../../../Microsoft.PowerShell.Management/Get-ChildItem.md) + [Get-Content](../../../Microsoft.PowerShell.Management/Get-Content.md) + [Get-Item](../../../Microsoft.PowerShell.Management/Get-Item.md) + [Remove-Item](../../../Microsoft.PowerShell.Management/Remove-Item.md) + [Set-Content](../../../Microsoft.PowerShell.Management/Set-Content.md) [Test-Path](../../../Microsoft.PowerShell.Management/Test-Path.md) diff --git a/reference/6/Microsoft.PowerShell.Core/Providers/Function-Provider.md b/reference/6/Microsoft.PowerShell.Core/Providers/Function-Provider.md index 567749152b9a..535fdd8b8d21 100644 --- a/reference/6/Microsoft.PowerShell.Core/Providers/Function-Provider.md +++ b/reference/6/Microsoft.PowerShell.Core/Providers/Function-Provider.md @@ -13,43 +13,41 @@ online version: http://go.microsoft.com/fwlink/?LinkId=834961 ## Provider name - Function + Function ## Drives - `Function:` + `Function:` ## Short description - Provides access to the functions defined in Windows PowerShell. + Provides access to the functions defined in Windows PowerShell. ## Detailed description - The Windows PowerShell **Function** provider lets you get, add, change, clear, and delete the functions and filters in Windows PowerShell. + The Windows PowerShell **Function** provider lets you get, add, change, clear, and delete the functions and filters in Windows PowerShell. - A function is a named block of code that performs an action. When you type the function name, the code in the function runs. A filter is a named block of code that establishes conditions for an action. You can type the name of the filter in place of the condition, such as in a [Where-Object](../Where-Object.md) command. + A function is a named block of code that performs an action. When you type the function name, the code in the function runs. A filter is a named block of code that establishes conditions for an action. You can type the name of the filter in place of the condition, such as in a [Where-Object](../Where-Object.md) command. - In the `Function:` drive, functions are preceded by the label "Function" and filters are preceded by the label "Filter", but they operate properly when used in the correct context regardless of the label. + In the `Function:` drive, functions are preceded by the label "Function" and filters are preceded by the label "Filter", but they operate properly when used in the correct context regardless of the label. - The **Function** provider is a flat namespace that contains only the function and filter objects. Neither functions nor filters have child items. + The **Function** provider is a flat namespace that contains only the function and filter objects. Neither functions nor filters have child items. - Each function is an instance of the [System.Management.Automation.FunctionInfo](https://msdn.microsoft.com/library/system.management.automation.functioninfo) class. Each filter is an instance of the [System.Management.Automation.FilterInfo](https://msdn.microsoft.com/library/system.management.automation.filterinfo) class. + Each function is an instance of the [System.Management.Automation.FunctionInfo](https://msdn.microsoft.com/library/system.management.automation.functioninfo) class. Each filter is an instance of the [System.Management.Automation.FilterInfo](https://msdn.microsoft.com/library/system.management.automation.filterinfo) class. - The examples in this section show how to manage functions, but the same methods can be used with filters. + The examples in this section show how to manage functions, but the same methods can be used with filters. - The **Function** provider exposes its data store in the `Function:` drive. To work with functions, you can change your location to the `Function:` drive (`set-location Function:`). Or, you can work from another Windows PowerShell drive. To reference a function from another location, use the drive name (`Function:`) in the path. + The **Function** provider exposes its data store in the `Function:` drive. To work with functions, you can change your location to the `Function:` drive (`set-location Function:`). Or, you can work from another Windows PowerShell drive. To reference a function from another location, use the drive name (`Function:`) in the path. - The **Function** provider supports all of the cmdlets whose names contain the *Item* noun (the `*-Item` cmdlets), except for [Invoke-Item](../../Microsoft.PowerShell.Management/Invoke-Item.md). And, it supports the [Get-Content](../../Microsoft.PowerShell.Management/Get-Content.md) and [Set-Content](../../Microsoft.PowerShell.Management/Set-Content.md) cmdlets. However, it does not support the cmdlets whose names contain the *ItemProperty* noun (the `*-ItemProperty` cmdlets), and it does not support the `-Filter` parameter in any cmdlet. - - All changes to the functions affect the current console only. To save the changes, add the function to the Windows PowerShell profile, or use [Export-Console](there-should-be-an-external-link) to save the current console. + The **Function** provider supports all of the cmdlets whose names contain the *Item* noun (the `*-Item` cmdlets), except for [Invoke-Item](../../Microsoft.PowerShell.Management/Invoke-Item.md). And, it supports the [Get-Content](../../Microsoft.PowerShell.Management/Get-Content.md) and [Set-Content](../../Microsoft.PowerShell.Management/Set-Content.md) cmdlets. However, it does not support the cmdlets whose names contain the *ItemProperty* noun (the `*-ItemProperty` cmdlets), and it does not support the `-Filter` parameter in any cmdlet. ## Capabilities - ShouldProcess + ShouldProcess ## Examples @@ -60,7 +58,7 @@ online version: http://go.microsoft.com/fwlink/?LinkId=834961 #### Example 1 - Changes the current location to the `Function:` drive. You can use this command from any drive in Windows PowerShell. To return to a file system drive, type the drive name. For example, type `set-location c:`. + Changes the current location to the `Function:` drive. You can use this command from any drive in Windows PowerShell. To return to a file system drive, type the drive name. For example, type `set-location c:`. ```powershell Set-Location Function: @@ -72,7 +70,7 @@ Set-Location Function: #### Example 1 - This command gets the list of all the functions in the current session. You can use this command from any Windows PowerShell drive. + This command gets the list of all the functions in the current session. You can use this command from any Windows PowerShell drive. ```powershell Get-ChildItem -Path Function: @@ -81,26 +79,26 @@ Get-ChildItem -Path Function: #### Example 2 - This command gets the `man` function from the `Function:` drive. It uses the [Get-Item](../../Microsoft.PowerShell.Management/Get-Item.md) cmdlet to get the function. The pipeline operator (`|`) sends the result to [Format-Table](../../Microsoft.PowerShell.Utility/Format-Table.md). + This command gets the `man` function from the `Function:` drive. It uses the [Get-Item](../../Microsoft.PowerShell.Management/Get-Item.md) cmdlet to get the function. The pipeline operator (`|`) sends the result to [Format-Table](../../Microsoft.PowerShell.Utility/Format-Table.md). - The `-Wrap` parameter directs text that does not fit on the line onto the next line. The `-Autosize` parameter resizes the table columns to accommodate the text. + The `-Wrap` parameter directs text that does not fit on the line onto the next line. The `-Autosize` parameter resizes the table columns to accommodate the text. ```powershell Get-Item -Path man | Format-Table -Wrap -Autosize ``` - If you are in a different drive, add the drive name (`Function:`) to the path. + If you are in a different drive, add the drive name (`Function:`) to the path. #### Example 3 - These commands both get the function named `c:`. The first command can be used in any drive. The second command is used in the `Function:` drive. + These commands both get the function named `c:`. The first command can be used in any drive. The second command is used in the `Function:` drive. - Because the name ends in a colon, which is the syntax for a drive, you must qualify the path with the drive name. Within the `Function:` drive, you can use either format. In the second command, the dot (`.`) represents the current location. + Because the name ends in a colon, which is the syntax for a drive, you must qualify the path with the drive name. Within the `Function:` drive, you can use either format. In the second command, the dot (`.`) represents the current location. ``` c:\PS> Get-Item -Path Function:c: -PS Function> Get-Item -Path .\c: +PS Function> Get-Item -Path .\c: ``` @@ -109,25 +107,25 @@ PS Function> Get-Item -Path .\c: #### Example 1 - This command uses the [New-Item](../../Microsoft.PowerShell.Management/New-Item.md) cmdlet to create a function called `HKLM:`. The expression in braces is the script block that is represented by the function name. + This command uses the [New-Item](../../Microsoft.PowerShell.Management/New-Item.md) cmdlet to create a function called `HKLM:`. The expression in braces is the script block that is represented by the function name. ```powershell New-Item -Path Function:HKLM: -Value {Set-Location HKLM:} ``` - You can also create a function by typing it at the Windows PowerShell command line. For example, tpe `Function:HKLM: {set-location HKLM:}`. If you are in the `Function:` drive, you can omit the drive name. -Because you cannot specify the "Filter" label in [New-Item](../../Microsoft.PowerShell.Management/New-Item.md), filters are labeled as functions, but they operate properly with any label. To create a filter with the "Filter" label, type the filter at the command line. For example, type `filter:Running {$_.Status -eq "Running"}`. + You can also create a function by typing it at the Windows PowerShell command line. For example, tpe `Function:HKLM: {set-location HKLM:}`. If you are in the `Function:` drive, you can omit the drive name. +Because you cannot specify the "Filter" label in [New-Item](../../Microsoft.PowerShell.Management/New-Item.md), filters are labeled as functions, but they operate properly with any label. To create a filter with the "Filter" label, type the filter at the command line. For example, type `filter:Running {$_.Status -eq "Running"}`. #### Example 2 - This command uses the [New-Item](../../Microsoft.PowerShell.Management/New-Item.md) cmdlet to create a function called `Csrss`. It uses the `-Options` dynamic parameter to specify a value of `ReadOnly` for the **Options** property of the function. + This command uses the [New-Item](../../Microsoft.PowerShell.Management/New-Item.md) cmdlet to create a function called `Csrss`. It uses the `-Options` dynamic parameter to specify a value of `ReadOnly` for the **Options** property of the function. ```powershell New-Item -Path Function: -Name csrss -Options readonly -Value {Get-Process csrss} ``` - This command works from any location. If you are in the `Function:` drive, you can use a dot (`.`) to specify the path. The dot represents the current location. + This command works from any location. If you are in the `Function:` drive, you can use a dot (`.`) to specify the path. The dot represents the current location. ### Deleting a function @@ -135,7 +133,7 @@ New-Item -Path Function: -Name csrss -Options readonly -Value {Get-Process csrss #### Example 1 - This command deletes the `HKLM:` function from the current session. + This command deletes the `HKLM:` function from the current session. ```powershell Remove-Item Function:HKLM: @@ -144,13 +142,13 @@ Remove-Item Function:HKLM: #### Example 2 - This command deletes all the functions from the current session except for the functions whose **Options** property has a value of `Constant`. Without the `-Force` parameter, the command does not delete functions whose **Options** property has a value of `ReadOnly`. + This command deletes all the functions from the current session except for the functions whose **Options** property has a value of `Constant`. Without the `-Force` parameter, the command does not delete functions whose **Options** property has a value of `ReadOnly`. ```powershell Remove-Item Function:* -Force ``` - When you delete all the functions, the command prompt changes because the prompt function, which defines the content of the command prompt, is deleted. + When you delete all the functions, the command prompt changes because the prompt function, which defines the content of the command prompt, is deleted. ### Displaying the properties and methods of functions @@ -158,19 +156,19 @@ Remove-Item Function:* -Force #### Example 1 - This command uses the [Get-Item](../../Microsoft.PowerShell.Management/Get-Item.md) cmdlet to get all the functions. The pipeline operator sends the results to the [Get-Member](../../Microsoft.PowerShell.Utility/Get-Member.md) cmdlet, which displays the methods and the properties of the object. + This command uses the [Get-Item](../../Microsoft.PowerShell.Management/Get-Item.md) cmdlet to get all the functions. The pipeline operator sends the results to the [Get-Member](../../Microsoft.PowerShell.Utility/Get-Member.md) cmdlet, which displays the methods and the properties of the object. ```powershell Get-Item -Path Function:* | Get-Member ``` - When you pipe a collection of objects (such as the collection of functions in the `Function:` drive) to [Get-Member](../../Microsoft.PowerShell.Utility/Get-Member.md), [Get-Member](../../Microsoft.PowerShell.Utility/Get-Member.md) evaluates each object in the collection separately and returns information about each object type that it finds. If all of the objects are of the same type, it returns information about the single object type. In this case, all of the functions are [FunctionInfo](https://msdn.microsoft.com/library/system.management.automation.functioninfo) objects. -To get information about the collection of [FunctionInfo](https://msdn.microsoft.com/library/system.management.automation.functioninfo) objects, use the `-InputObject` parameter of [Get-Member](../../Microsoft.PowerShell.Utility/Get-Member.md). For example, type `Get-Member -InputObject (Get-Item Function:*)`. When you use the `-InputObject` parameter, [Get-Member](../../Microsoft.PowerShell.Utility/Get-Member.md) evaluates the collection, not the objects in the collection. + When you pipe a collection of objects (such as the collection of functions in the `Function:` drive) to [Get-Member](../../Microsoft.PowerShell.Utility/Get-Member.md), [Get-Member](../../Microsoft.PowerShell.Utility/Get-Member.md) evaluates each object in the collection separately and returns information about each object type that it finds. If all of the objects are of the same type, it returns information about the single object type. In this case, all of the functions are [FunctionInfo](https://msdn.microsoft.com/library/system.management.automation.functioninfo) objects. +To get information about the collection of [FunctionInfo](https://msdn.microsoft.com/library/system.management.automation.functioninfo) objects, use the `-InputObject` parameter of [Get-Member](../../Microsoft.PowerShell.Utility/Get-Member.md). For example, type `Get-Member -InputObject (Get-Item Function:*)`. When you use the `-InputObject` parameter, [Get-Member](../../Microsoft.PowerShell.Utility/Get-Member.md) evaluates the collection, not the objects in the collection. #### Example 2 - This command lists the values of the properties of the `prompt` function. It uses the [Get-Item](../../Microsoft.PowerShell.Management/Get-Item.md) cmdlet to get an object that represents the `prompt` function. The pipeline operator (`|`) sends the results to the [Format-List](../../Microsoft.PowerShell.Utility/Format-List.md) command. The [Format-List](../../Microsoft.PowerShell.Utility/Format-List.md) command uses the `-Property` parameter with a wildcard character (`*`) to format and to display the values of all of the properties of the `prompt` function. + This command lists the values of the properties of the `prompt` function. It uses the [Get-Item](../../Microsoft.PowerShell.Management/Get-Item.md) cmdlet to get an object that represents the `prompt` function. The pipeline operator (`|`) sends the results to the [Format-List](../../Microsoft.PowerShell.Utility/Format-List.md) command. The [Format-List](../../Microsoft.PowerShell.Utility/Format-List.md) command uses the `-Property` parameter with a wildcard character (`*`) to format and to display the values of all of the properties of the `prompt` function. ```powershell Get-Item Function:prompt | Format-List -Property * @@ -182,9 +180,9 @@ Get-Item Function:prompt | Format-List -Property * #### Example 1 - You can use the [Set-Item](../../Microsoft.PowerShell.Management/Set-Item.md) cmdlet with the `-Options` dynamic parameter to change the value of the **Options** property of a function. + You can use the [Set-Item](../../Microsoft.PowerShell.Management/Set-Item.md) cmdlet with the `-Options` dynamic parameter to change the value of the **Options** property of a function. - This command sets the `AllScope` and `ReadOnly` options for the `prompt` function. This command uses the `-Options` dynamic parameter of the [Set-Item](../../Microsoft.PowerShell.Management/Set-Item.md) cmdlet. The `-Options` parameter is available in [Set-Item](../../Microsoft.PowerShell.Management/Set-Item.md) only when you use it with the **Alias** or **Function** provider. + This command sets the `AllScope` and `ReadOnly` options for the `prompt` function. This command uses the `-Options` dynamic parameter of the [Set-Item](../../Microsoft.PowerShell.Management/Set-Item.md) cmdlet. The `-Options` parameter is available in [Set-Item](../../Microsoft.PowerShell.Management/Set-Item.md) only when you use it with the **Alias** or **Function** provider. ```powershell Set-Item -Path Function:prompt -Options "AllScope,ReadOnly" @@ -193,18 +191,18 @@ Set-Item -Path Function:prompt -Options "AllScope,ReadOnly" #### Example 2 - This command uses the [Set-Item](../../Microsoft.PowerShell.Management/Set-Item.md) cmdlet to change the `prompt` function so that it displays the time before the path. + This command uses the [Set-Item](../../Microsoft.PowerShell.Management/Set-Item.md) cmdlet to change the `prompt` function so that it displays the time before the path. ```powershell Set-Item -Path Function:prompt -Value {'PS '+ $(Get-Date -Format t) + " " + $(Get-Location) + '> '} ``` - The change affects both the **Definition** and **ScriptBlock** properties of the [FunctionInfo](https://msdn.microsoft.com/library/system.management.automation.functioninfo) object. To see the effect of the change, type `Get-Item -Path Function:prompt | Format-List -Property *`. + The change affects both the **Definition** and **ScriptBlock** properties of the [FunctionInfo](https://msdn.microsoft.com/library/system.management.automation.functioninfo) object. To see the effect of the change, type `Get-Item -Path Function:prompt | Format-List -Property *`. #### Example 3 - This command uses the [Rename-Item](../../Microsoft.PowerShell.Management/Rename-Item.md) cmdlet to change the name of the `help` function to `gh`. + This command uses the [Rename-Item](../../Microsoft.PowerShell.Management/Rename-Item.md) cmdlet to change the name of the `help` function to `gh`. ```powershell Rename-Item -Path Function:help -NewName gh @@ -216,9 +214,9 @@ Rename-Item -Path Function:help -NewName gh #### Example 1 - This command copies the `prompt` function to `oldPrompt`, effectively creating a new name for the script block that is associated with the prompt function. You can use this to save the original prompt function if you plan to change it. + This command copies the `prompt` function to `oldPrompt`, effectively creating a new name for the script block that is associated with the prompt function. You can use this to save the original prompt function if you plan to change it. - The **Options** property of the new function has a value of `None`. To change the value of the **Options** property, use [Set-Item](../../Microsoft.PowerShell.Management/Set-Item.md). + The **Options** property of the new function has a value of `None`. To change the value of the **Options** property, use [Set-Item](../../Microsoft.PowerShell.Management/Set-Item.md). ```powershell Copy-Item -Path Function:prompt -Destination Function:oldPrompt @@ -227,32 +225,32 @@ Copy-Item -Path Function:prompt -Destination Function:oldPrompt ## Dynamic parameters - Dynamic parameters are cmdlet parameters that are added by a Windows PowerShell provider and are available only when the cmdlet is being used in the provider-enabled drive. + Dynamic parameters are cmdlet parameters that are added by a Windows PowerShell provider and are available only when the cmdlet is being used in the provider-enabled drive. ### `Options` <[System.Management.Automation.ScopedItemOptions](https://msdn.microsoft.com/library/system.management.automation.scopeditemoptions)> - Determines the value of the **Options** property of a function. + Determines the value of the **Options** property of a function. -|Value|Description| -|-----------|-----------------| -|`None`|No options. `None` is the default.| -|`Constant`|The function cannot be deleted, and its properties cannot be changed. `Constant` is available only when you are creating a function. You cannot change the option of an existing function to `Constant`.| -|`Private`|The function is visible only in the current scope (not in child scopes).| -|`ReadOnly`|The properties of the function cannot be changed except by using the `-Force` parameter. You can use [Remove-Item](../../Microsoft.PowerShell.Management/Remove-Item.md) to delete the function.| -|`AllScope`|The function is copied to any new scopes that are created.| +|Value|Description| +|-----------|-----------------| +|`None`|No options. `None` is the default.| +|`Constant`|The function cannot be deleted, and its properties cannot be changed. `Constant` is available only when you are creating a function. You cannot change the option of an existing function to `Constant`.| +|`Private`|The function is visible only in the current scope (not in child scopes).| +|`ReadOnly`|The properties of the function cannot be changed except by using the `-Force` parameter. You can use [Remove-Item](../../Microsoft.PowerShell.Management/Remove-Item.md) to delete the function.| +|`AllScope`|The function is copied to any new scopes that are created.| #### Cmdlets supported: -- [New-Item](../../Microsoft.PowerShell.Management/New-Item.md) +- [New-Item](../../Microsoft.PowerShell.Management/New-Item.md) -- [Set-Item](../../Microsoft.PowerShell.Management/Set-Item.md) +- [Set-Item](../../Microsoft.PowerShell.Management/Set-Item.md) ## See also - [about_Functions](../About/about_Functions.md) + [about_Functions](../About/about_Functions.md) [about_Providers](../About/about_Providers.md) diff --git a/reference/6/Microsoft.PowerShell.Core/Providers/Variable-Provider.md b/reference/6/Microsoft.PowerShell.Core/Providers/Variable-Provider.md index 5def5c3f3a32..54fee4a291cf 100644 --- a/reference/6/Microsoft.PowerShell.Core/Providers/Variable-Provider.md +++ b/reference/6/Microsoft.PowerShell.Core/Providers/Variable-Provider.md @@ -13,51 +13,49 @@ online version: http://go.microsoft.com/fwlink/?LinkId=834963 ## Provider name - Variable + Variable ## Drives - `Variable:` + `Variable:` ## Short description - Provides access to the Windows PowerShell variables and to their values. + Provides access to the Windows PowerShell variables and to their values. ## Detailed description - The Windows PowerShell **Variable** provider lets you get, add, change, clear, and delete Windows PowerShell variables in the current console. + The Windows PowerShell **Variable** provider lets you get, add, change, clear, and delete Windows PowerShell variables in the current console. - The Windows PowerShell **Variable** provider supports the variables that Windows PowerShell creates, including the automatic variables, the preference variables, and the variables that you create. + The Windows PowerShell **Variable** provider supports the variables that Windows PowerShell creates, including the automatic variables, the preference variables, and the variables that you create. - The **Variable** provider is a flat namespace that contains only the variable objects. The variables have no child items. + The **Variable** provider is a flat namespace that contains only the variable objects. The variables have no child items. - Most of the variables are instances of the [System.Management.Automation.PSVariable](https://msdn.microsoft.com/library/system.management.automation.psvariable) class. However, there are some variations. For example, the `?` variable is a member of the `QuestionMarkVariable` internal class, and the `MaximumVariableCount` variable is a member of the `SessionStateCapacityVariable` internal class. + Most of the variables are instances of the [System.Management.Automation.PSVariable](https://msdn.microsoft.com/library/system.management.automation.psvariable) class. However, there are some variations. For example, the `?` variable is a member of the `QuestionMarkVariable` internal class, and the `MaximumVariableCount` variable is a member of the `SessionStateCapacityVariable` internal class. - The **Variable** provider exposes its data store in the `Variable:` drive. To work with variables, you can change your location to the `Variable:` drive (`set-location Variable:`), or you can work from any other Windows PowerShell drive. To reference a variable from another location, use the drive name (`Variable:`) in the path. + The **Variable** provider exposes its data store in the `Variable:` drive. To work with variables, you can change your location to the `Variable:` drive (`set-location Variable:`), or you can work from any other Windows PowerShell drive. To reference a variable from another location, use the drive name (`Variable:`) in the path. - Windows PowerShell includes a set of cmdlets designed especially to view and to change variables: + Windows PowerShell includes a set of cmdlets designed especially to view and to change variables: - - [Get-Variable](../../Microsoft.PowerShell.Utility/Get-Variable.md) - - [New-Variable](../../Microsoft.PowerShell.Utility/New-Variable.md) - - [Set-Variable](../../Microsoft.PowerShell.Utility/Set-Variable.md) - - [Remove-Variable](../../Microsoft.PowerShell.Utility/Remove-Variable.md) - - [Clear-Variable](../../Microsoft.PowerShell.Utility/Clear-Variable.md) + - [Get-Variable](../../Microsoft.PowerShell.Utility/Get-Variable.md) + - [New-Variable](../../Microsoft.PowerShell.Utility/New-Variable.md) + - [Set-Variable](../../Microsoft.PowerShell.Utility/Set-Variable.md) + - [Remove-Variable](../../Microsoft.PowerShell.Utility/Remove-Variable.md) + - [Clear-Variable](../../Microsoft.PowerShell.Utility/Clear-Variable.md) - When you use these cmdlets, you do not need to specify the `Variable:` drive in the name. + When you use these cmdlets, you do not need to specify the `Variable:` drive in the name. - The **Variable** provider supports all of the cmdlets whose names contain the *Item* noun (the `*-Item` cmdlets), except for [Invoke-Item](../../Microsoft.PowerShell.Management/Invoke-Item.md). The **Variable** provider supports the [Get-Content](../../Microsoft.PowerShell.Management/Get-Content.md) and [Set-Content](../../Microsoft.PowerShell.Management/Set-Content.md) cmdlets. However, it does not support the cmdlets whose names contain the *ItemProperty* noun (the `*-ItemProperty` cmdlets), and it does not support the `-Filter` parameter in any cmdlet. + The **Variable** provider supports all of the cmdlets whose names contain the *Item* noun (the `*-Item` cmdlets), except for [Invoke-Item](../../Microsoft.PowerShell.Management/Invoke-Item.md). The **Variable** provider supports the [Get-Content](../../Microsoft.PowerShell.Management/Get-Content.md) and [Set-Content](../../Microsoft.PowerShell.Management/Set-Content.md) cmdlets. However, it does not support the cmdlets whose names contain the *ItemProperty* noun (the `*-ItemProperty` cmdlets), and it does not support the `-Filter` parameter in any cmdlet. - You can also use the Windows PowerShell expression parser to create, view, and change the values of variables without using the cmdlets. When working with variables directly, use a dollar sign (`$`) to identify the name as a variable and the assignment operator (`=`) to establish and change its value. For example, `$p = Get-Process` creates the `p` variable and stores the results of a `Get-Process` command in it. - - All changes to the variables affect the current session only. To save the changes, add the changes to the Windows PowerShell profile, or use [Export-Console](there-should-be-an-external-link) to save the current console. + You can also use the Windows PowerShell expression parser to create, view, and change the values of variables without using the cmdlets. When working with variables directly, use a dollar sign (`$`) to identify the name as a variable and the assignment operator (`=`) to establish and change its value. For example, `$p = Get-Process` creates the `p` variable and stores the results of a `Get-Process` command in it. ## Capabilities - ShouldProcess + ShouldProcess ## Examples @@ -68,7 +66,7 @@ online version: http://go.microsoft.com/fwlink/?LinkId=834963 #### Example 1 - This command changes the current location to the `Variable:` drive. You can use this command from any drive in Windows PowerShell. To return to a file system drive, type the drive name. For example, type `set-location c:`. + This command changes the current location to the `Variable:` drive. You can use this command from any drive in Windows PowerShell. To return to a file system drive, type the drive name. For example, type `set-location c:`. ```powershell Set-Location Variable: @@ -80,7 +78,7 @@ Set-Location Variable: #### Example 1 - This command gets the list of all the variables and their values in the current session. You can use this command from any Windows PowerShell drive. + This command gets the list of all the variables and their values in the current session. You can use this command from any Windows PowerShell drive. ```powershell Get-ChildItem -Path Variable: @@ -89,20 +87,20 @@ Get-ChildItem -Path Variable: #### Example 2 - This command gets the variables with names that begin with "max". You can use this command from any Windows PowerShell drive. + This command gets the variables with names that begin with "max". You can use this command from any Windows PowerShell drive. ```powershell Get-ChildItem -Path Variable:max* ``` - If you are in the `Variable:` drive, you can omit the drive name from the path. + If you are in the `Variable:` drive, you can omit the drive name from the path. #### Example 3 - This command gets the value of the `WhatIfPreference` variable by typing it at the command line. + This command gets the value of the `WhatIfPreference` variable by typing it at the command line. - The name of the variable is preceded by a dollar sign (`$`) to indicate that it is a variable. The `Variable:` drive name is not specified. + The name of the variable is preceded by a dollar sign (`$`) to indicate that it is a variable. The `Variable:` drive name is not specified. ```powershell $WhatIfPreference @@ -111,18 +109,18 @@ $WhatIfPreference #### Example 4 - This command uses the `-LiteralPath` parameter of [Get-ChildItem](../../Microsoft.PowerShell.Management/Get-ChildItem.md) to get the value of the `?` variable from within the `Variable:` drive. [Get-ChildItem](../../Microsoft.PowerShell.Management/Get-ChildItem.md) does not attempt to resolve any wildcards in the values of the `-LiteralPath` parameter. + This command uses the `-LiteralPath` parameter of [Get-ChildItem](../../Microsoft.PowerShell.Management/Get-ChildItem.md) to get the value of the `?` variable from within the `Variable:` drive. [Get-ChildItem](../../Microsoft.PowerShell.Management/Get-ChildItem.md) does not attempt to resolve any wildcards in the values of the `-LiteralPath` parameter. ```powershell Get-ChildItem -Literalpath ? ``` - To display the value of a variable with a special character name without a cmdlet, type a dollar sign (`$`) and the variable name. For example, to display the value of the `?` variable, type `$?`. + To display the value of a variable with a special character name without a cmdlet, type a dollar sign (`$`) and the variable name. For example, to display the value of the `?` variable, type `$?`. #### Example 5 - This command gets the variables that have the values of `ReadOnly` or `Constant` for their **Options** property. + This command gets the variables that have the values of `ReadOnly` or `Constant` for their **Options** property. ```powershell Get-ChildItem -Path Variable: | Where-Object {$_.options -Match "Constant" -or $_.options -Match "ReadOnly"} | Format-List -Property name, value, options @@ -134,28 +132,28 @@ Get-ChildItem -Path Variable: | Where-Object {$_.options -Match "Constant" -or $ #### Example 1 - This command creates the `services` variable and stores the results of a [Get-Service](../../Microsoft.PowerShell.Management/Get-Service.md) command in it. Because the current location is in the `Variable:` drive, the value of the `-Path` parameter is a dot (`.`), which represents the current location. + This command creates the `services` variable and stores the results of a [Get-Service](../../Microsoft.PowerShell.Management/Get-Service.md) command in it. Because the current location is in the `Variable:` drive, the value of the `-Path` parameter is a dot (`.`), which represents the current location. - The parentheses around the [Get-Service](../../Microsoft.PowerShell.Management/Get-Service.md) command ensure that the command is executed before the variable is created. Without the parentheses, the value of the new variable is a "Get-Service" string. + The parentheses around the [Get-Service](../../Microsoft.PowerShell.Management/Get-Service.md) command ensure that the command is executed before the variable is created. Without the parentheses, the value of the new variable is a "Get-Service" string. ```powershell New-Item -Path . -Name services -Value (Get-Service) ``` - If you are not in the `Variable:` drive, include the `Variable:` drive name in the path. + If you are not in the `Variable:` drive, include the `Variable:` drive name in the path. #### Example 2 - This command creates a `services` variable and stores the result of a [Get-Service](../../Microsoft.PowerShell.Management/Get-Service.md) command in it. + This command creates a `services` variable and stores the result of a [Get-Service](../../Microsoft.PowerShell.Management/Get-Service.md) command in it. - The command uses a dollar sign (`$`) to indicate a variable and the assignment operator (`=`) to assign the result of the [Get-Service](../../Microsoft.PowerShell.Management/Get-Service.md) command to the newly created variable. + The command uses a dollar sign (`$`) to indicate a variable and the assignment operator (`=`) to assign the result of the [Get-Service](../../Microsoft.PowerShell.Management/Get-Service.md) command to the newly created variable. ```powershell $services = Get-Service ``` - To create a variable without a value, omit the assignment operator. + To create a variable without a value, omit the assignment operator. ### Displaying the properties and methods of variables @@ -163,19 +161,19 @@ $services = Get-Service #### Example 1 - This command uses the Get-Item cmdlet to get all variables. The pipeline operator (`|`) sends the results to the [Get-Member](../../Microsoft.PowerShell.Utility/Get-Member.md) cmdlet, which displays the methods and properties of the object. + This command uses the Get-Item cmdlet to get all variables. The pipeline operator (`|`) sends the results to the [Get-Member](../../Microsoft.PowerShell.Utility/Get-Member.md) cmdlet, which displays the methods and properties of the object. ```powershell Get-Item -Path Variable:* | Get-Member ``` - When you pipe a collection of objects (such as the collection of variables in the `Variable:` drive) to [Get-Member](../../Microsoft.PowerShell.Utility/Get-Member.md), [Get-Member](../../Microsoft.PowerShell.Utility/Get-Member.md) evaluates each object in the collection separately and returns information about each of the object types that it finds. -To get information about the collection of objects in the `Variable:` drive, use the `-InputObject` parameter of [Get-Member](../../Microsoft.PowerShell.Utility/Get-Member.md). For example, `Get-Member -InputObject (Get-Item Variable:*)`. When you use `-InputObject`, [Get-Member](../../Microsoft.PowerShell.Utility/Get-Member.md) evaluates the collection, not the objects in the collection. + When you pipe a collection of objects (such as the collection of variables in the `Variable:` drive) to [Get-Member](../../Microsoft.PowerShell.Utility/Get-Member.md), [Get-Member](../../Microsoft.PowerShell.Utility/Get-Member.md) evaluates each object in the collection separately and returns information about each of the object types that it finds. +To get information about the collection of objects in the `Variable:` drive, use the `-InputObject` parameter of [Get-Member](../../Microsoft.PowerShell.Utility/Get-Member.md). For example, `Get-Member -InputObject (Get-Item Variable:*)`. When you use `-InputObject`, [Get-Member](../../Microsoft.PowerShell.Utility/Get-Member.md) evaluates the collection, not the objects in the collection. #### Example 2 - This command lists the values of the properties of the `home` variable. It uses the [Get-Item](../../Microsoft.PowerShell.Management/Get-Item.md) cmdlet to get an object that represents the `home` variable. The pipeline operator (`|`) sends the results to the [Format-List](../../Microsoft.PowerShell.Utility/Format-List.md) command. The [Format-List](../../Microsoft.PowerShell.Utility/Format-List.md) command uses the `-Property` parameter with a wildcard character (`*`) to format and to display the values of all of the properties of the `home` variable. + This command lists the values of the properties of the `home` variable. It uses the [Get-Item](../../Microsoft.PowerShell.Management/Get-Item.md) cmdlet to get an object that represents the `home` variable. The pipeline operator (`|`) sends the results to the [Format-List](../../Microsoft.PowerShell.Utility/Format-List.md) command. The [Format-List](../../Microsoft.PowerShell.Utility/Format-List.md) command uses the `-Property` parameter with a wildcard character (`*`) to format and to display the values of all of the properties of the `home` variable. ```powershell Get-Item Variable:home | Format-List -Property * @@ -187,7 +185,7 @@ Get-Item Variable:home | Format-List -Property * #### Example 1 - This command uses the [Rename-Item](../../Microsoft.PowerShell.Management/Rename-Item.md) cmdlet to change the name of the `a` variable to `processes`. + This command uses the [Rename-Item](../../Microsoft.PowerShell.Management/Rename-Item.md) cmdlet to change the name of the `a` variable to `processes`. ```powershell Rename-Item -Path Variable:a -NewName processes @@ -196,7 +194,7 @@ Rename-Item -Path Variable:a -NewName processes #### Example 2 - This command uses the [Set-Item](../../Microsoft.PowerShell.Management/Set-Item.md) cmdlet to change the value of the `ErrorActionPreference` variable to "Stop". + This command uses the [Set-Item](../../Microsoft.PowerShell.Management/Set-Item.md) cmdlet to change the value of the `ErrorActionPreference` variable to "Stop". ```powershell Set-Item -Path Variable:ErrorActionPreference -Value Stop @@ -205,9 +203,9 @@ Set-Item -Path Variable:ErrorActionPreference -Value Stop #### Example 3 - This command changes the value of the `ErrorActionPreference` variable to "Stop". + This command changes the value of the `ErrorActionPreference` variable to "Stop". - It uses a dollar sign (`$`) to indicate a variable and the assignment operator (`=`) to assign the value. + It uses a dollar sign (`$`) to indicate a variable and the assignment operator (`=`) to assign the value. ```powershell $ErrorActionPreference = Stop @@ -219,18 +217,18 @@ $ErrorActionPreference = Stop #### Example 1 - This command uses the [Copy-Item](../../Microsoft.PowerShell.Management/Copy-Item.md) cmdlet to copy the `processes` variable to `old_processes`. This creates a new variable named `old_processes` that has the same value as the `processes` variable. + This command uses the [Copy-Item](../../Microsoft.PowerShell.Management/Copy-Item.md) cmdlet to copy the `processes` variable to `old_processes`. This creates a new variable named `old_processes` that has the same value as the `processes` variable. ```powershell Copy-Item -Path Variable:processes -Destination Variable:old_processes ``` - If the command is issued from within the `Variable:` drive, you can omit the drive name from the value of the `-Path` parameter. + If the command is issued from within the `Variable:` drive, you can omit the drive name from the value of the `-Path` parameter. #### Example 2 - This command copies the `processes` variable to `old_processes` without using a cmdlet. It uses the dollar sign (`$`) to indicate variables and the assignment operator to assign the value of `$processes` to `old_processes`. + This command copies the `processes` variable to `old_processes` without using a cmdlet. It uses the dollar sign (`$`) to indicate variables and the assignment operator to assign the value of `$processes` to `old_processes`. ```powershell $old_processes = $processes @@ -242,7 +240,7 @@ $old_processes = $processes #### Example 1 - This command deletes the `serv` variable from the current session. You can use this command in any Windows PowerShell drive. + This command deletes the `serv` variable from the current session. You can use this command in any Windows PowerShell drive. ```powershell Remove-Variable -Path Variable:serv @@ -251,7 +249,7 @@ Remove-Variable -Path Variable:serv #### Example 2 - This command deletes all variables from the current session except for the variables whose **Options** property has a value of `Constant`. Without the `-Force` parameter, the command does not delete variables whose **Options** property has a value of `ReadOnly`. + This command deletes all variables from the current session except for the variables whose **Options** property has a value of `Constant`. Without the `-Force` parameter, the command does not delete variables whose **Options** property has a value of `ReadOnly`. ```powershell Remove-Item Variable:* -Force @@ -263,7 +261,7 @@ Remove-Item Variable:* -Force #### Example 1 - This command uses the [Clear-Item](../../Microsoft.PowerShell.Management/Clear-Item.md) cmdlet to change the value of the `processes` variable to NULL. + This command uses the [Clear-Item](../../Microsoft.PowerShell.Management/Clear-Item.md) cmdlet to change the value of the `processes` variable to NULL. ```powershell Clear-Item -Path Variable:processes @@ -272,7 +270,7 @@ Clear-Item -Path Variable:processes #### Example 2 - This command clears the value of the `processes` variable by assigning a null value to it. It uses the `$null` automatic variable to represent the NULL value. + This command clears the value of the `processes` variable by assigning a null value to it. It uses the `$null` automatic variable to represent the NULL value. ```powershell $processes = $null @@ -281,7 +279,7 @@ $processes = $null ## See also - [about_Variables](../About/about_Variables.md) - [about_Automatic_Variables](../About/about_Automatic_Variables.md) + [about_Variables](../About/about_Variables.md) + [about_Automatic_Variables](../About/about_Automatic_Variables.md) [about_Providers](../About/about_Providers.md) diff --git a/reference/6/Microsoft.PowerShell.Utility/Add-Member.md b/reference/6/Microsoft.PowerShell.Utility/Add-Member.md index d81088e3732a..fec3545b2ac3 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Add-Member.md +++ b/reference/6/Microsoft.PowerShell.Utility/Add-Member.md @@ -70,7 +70,8 @@ For more information, see the *PassThru* parameter description. PS C:\> $A = dir c:\ps-test\test.txt PS C:\> $A | Add-Member -NotePropertyName Status -NotePropertyValue Done PS C:\> $A | Add-Member Status Done -PS C:\> $A.StatusDone +PS C:\> $A.Status +Done ``` These commands add the Status note property with a value of "Done" to the FileInfo object that represents the Test.txt file. @@ -89,7 +90,8 @@ As the output shows, the value is "Done". ``` PS C:\> $A = dir c:\ps-test\test.txt PS C:\> $A | Add-Member -MemberType AliasProperty -Name FileLength -Value Length -PS C:\> $A.FileLength2394 +PS C:\> $A.FileLength +2394 ``` These commands add the FileLength alias property to the object that represents the Test.txt file. @@ -104,7 +106,8 @@ The third command uses dot notation to get the value of the new FileLength prope ### Example 3: Add a StringUse note property to a string ``` PS C:\> $A = "A string"PS C:\> $A = $A | Add-Member @{StringUse="Display"} -PassThru -PS C:\> $A.StringUseDisplay +PS C:\> $A.StringUse +Display ``` These commands add the **StringUse** note property to a string. @@ -144,28 +147,16 @@ The third command uses dot notation to call the new PadBoth script method on the PS C:\> $Event = Get-EventLog -LogName System -Newest 1 PS C:\> $Event.TimeWritten | Get-MemberTypeName: System.DateTime Name MemberType Definition - - ---- ---------- ---------- - - Add Method System.DateTime Add(System.TimeSpan value) - - AddDays Method System.DateTime AddDays(double value) - - AddHours Method System.DateTime AddHours(double value) - - AddMilliseconds Method System.DateTime AddMilliseconds(double value) - - AddMinutes Method System.DateTime AddMinutes(double value)... - PS C:\> Add-Member -InputObject $Event -MemberType AliasProperty -Name When -Value TimeWritten -SecondValue System.String PS C:\> $Event.When | Get-MemberTypeName: System.String + Name MemberType Definition ---- ---------- ---------- Clone Method System.Object Clone() @@ -492,18 +483,16 @@ When you use the *PassThru* parameter, this cmdlet returns the newly-extended ob Otherwise, this cmdlet does not generate any output. ## NOTES -* You can add members only to PSObject objects. To determine whether an object is a PSObject object, use the "is" operator. For instance, to test an object stored in the $obj variable, type `$obj -is \[PSObject\]`. +You can add members only to PSObject objects. To determine whether an object is a PSObject object, use the "is" operator. For instance, to test an object stored in the $obj variable, type `$obj -is \[PSObject\]`. - The names of the *MemberType*, *Name*, *Value*, and *SecondValue* parameters are optional. +The names of the *MemberType*, *Name*, *Value*, and *SecondValue* parameters are optional. If you omit the parameter names, the unnamed parameter values must appear in this order: *MemberType*, *Name*, *Value*, and *SecondValue*. If you include the parameter names, the parameters can appear in any order. - You can use the $this automatic variable in script blocks that define the values of new properties and methods. +You can use the $this automatic variable in script blocks that define the values of new properties and methods. The $this variable refers to the instance of the object to which the properties and methods are being added. For more information about the $this variable, see about_Automatic_Variables. -* - ## RELATED LINKS [Export-Clixml](Export-Clixml.md) diff --git a/reference/6/PSReadLine/Remove-PSReadlineKeyHandler.md b/reference/6/PSReadLine/Remove-PSReadlineKeyHandler.md index 8a94a74668c4..50d31ee3863f 100644 --- a/reference/6/PSReadLine/Remove-PSReadlineKeyHandler.md +++ b/reference/6/PSReadLine/Remove-PSReadlineKeyHandler.md @@ -26,12 +26,12 @@ Create a key binding by running the Set-PSReadlineKeyHandler cmdlet. ## EXAMPLES ### Example 1: Remove a binding -``` -PS C:\> Remove-PSReadlineKeyHandler -Chord "Shift+Ctrl+B" +```powershell +Remove-PSReadlineKeyHandler -Chord Ctrl+Shift+B ``` This command removes the binding from the key combination, or chord, Ctrl+Shift+B. -The Ctrl+Shift+B chord is created in the Set-PSReadlineKeyHandler topic. +The Ctrl+Shift+B chord is created in the `Set-PSReadlineKeyHandler` topic. ## PARAMETERS diff --git a/reference/6/PSReadLine/Set-PSReadlineKeyHandler.md b/reference/6/PSReadLine/Set-PSReadlineKeyHandler.md index 5e4b96db7bfc..9abafec5d5e6 100644 --- a/reference/6/PSReadLine/Set-PSReadlineKeyHandler.md +++ b/reference/6/PSReadLine/Set-PSReadlineKeyHandler.md @@ -41,11 +41,11 @@ PS C:\> Set-PSReadlineKeyHandler -Chord UpArrow -Function HistorySearchBackward This command binds the up arrow key to the function HistorySearchBackward, which uses the currently-entered command line as the start of the search string when it is searching through command history. ### Example 2: Bind a key to a script block -``` -PS C:\> Set-PSReadlineKeyHandler -Chord Shift+Ctrl+B -ScriptBlock { - [PSConsoleUtilities.PSConsoleReadLine]::RevertLine() - [PSConsoleUtilities.PSConsoleReadLine]::Insert('build') - [PSConsoleUtilities.PSConsoleReadLine]::AcceptLine() +```powershell +Set-PSReadlineKeyHandler -Chord Ctrl+Shift+B -ScriptBlock { + [Microsoft.PowerShell.PSConsoleReadLine]::RevertLine() + [Microsoft.PowerShell.PSConsoleReadLine]::Insert('build') + [Microsoft.PowerShell.PSConsoleReadLine]::AcceptLine() } ``` diff --git a/reference/docfx.json b/reference/docfx.json index 04bbc9671568..ffb21c5245ab 100644 --- a/reference/docfx.json +++ b/reference/docfx.json @@ -1,289 +1,50 @@ { "build": { - "content": [{ - "files": [ - "bread-pscore/toc.yml" - ] - }, - { - "files": [ - "toc.yml" - ], - "src": "docs-conceptual", - "version": "powershell-3.0", - "dest": "scripting/powershell-3.0" - }, - { - "files": [ - "**/*.md" - ], - "src": "docs-conceptual", - "version": "powershell-3.0", - "dest": "scripting" - }, - { - "files": [ - "toc.yml" - ], - "src": "3.0", - "version": "powershell-3.0", - "dest": "module/psdocs" - }, - { - "files": [ - "**/*.md" - ], - "src": "3.0", - "version": "powershell-3.0", - "exclude": [ - "docs-conceptual/**" - ], - "dest": "module" - }, - { - "files": [ - "toc.yml" - ], - "src": "docs-conceptual", - "version": "powershell-4.0", - "dest": "scripting/powershell-4.0" - }, - { - "files": [ - "**/*.md" - ], - "src": "docs-conceptual", - "version": "powershell-4.0", - "dest": "scripting" - }, - { - "files": [ - "toc.yml" - ], - "src": "4.0", - "version": "powershell-4.0", - "dest": "module/psdocs" - }, - { - "files": [ - "**/*.md" - ], - "src": "4.0", - "version": "powershell-4.0", - "exclude": [ - "docs-conceptual/**" - ], - "dest": "module" - }, - { - "files": [ - "toc.yml" - ], - "src": "docs-conceptual", - "version": "powershell-5.0", - "dest": "scripting/powershell-5.0" - }, - { - "files": [ - "**/*.md" - ], - "src": "docs-conceptual", - "version": "powershell-5.0", - "dest": "scripting" - }, - { - "files": [ - "toc.yml" - ], - "src": "5.0", - "version": "powershell-5.0", - "dest": "module/psdocs" - }, - { - "files": [ - "**/*.md" - ], - "src": "5.0", - "version": "powershell-5.0", - "exclude": [ - "docs-conceptual/**" - ], - "dest": "module" - }, - { - "files": [ - "toc.yml" - ], - "src": "docs-conceptual", - "version": "powershell-5.1", - "dest": "scripting/powershell-5.1" - }, - { - "files": [ - "**/*.md" - ], - "src": "docs-conceptual", - "version": "powershell-5.1", - "dest": "scripting" - }, - { - "files": [ - "toc.yml" - ], - "src": "5.1", - "version": "powershell-5.1", - "dest": "module/psdocs" - }, - { - "files": [ - "**/*.md" - ], - "src": "5.1", - "version": "powershell-5.1", - "exclude": [ - "docs-conceptual/**" - ], - "dest": "module" - }, - { - "files": [ - "toc.yml" - ], - "src": "docs-conceptual", - "version": "powershell-6", - "dest": "scripting/powershell-6" - }, - { - "files": [ - "**/*.md" - ], - "src": "docs-conceptual", - "version": "powershell-6", - "dest": "scripting" - }, - { - "files": [ - "toc.yml" - ], - "src": "6", - "version": "powershell-6", - "dest": "module/psdocs" - }, - { - "files": [ - "**/*.md" - ], - "src": "6", - "version": "powershell-6", - "exclude": [ - "docs-conceptual/**" - ], - "dest": "module" - }, - { - "files": [ - "**/*.md" - ], - "src": "virtual-directory", - "dest": "scripting" - }, - { - "files": [ - "**/*.md" - ], - "src": "virtual-directory-module", - "dest": "module" - } + "content": [ + { "files": [ "bread-pscore/toc.yml" ] }, + + { "files": [ "toc.yml" ], "src": "docs-conceptual", "version": "powershell-3.0", "dest": "scripting/powershell-3.0" }, + { "files": [ "**/*.md" ], "src": "docs-conceptual", "version": "powershell-3.0", "dest": "scripting" }, + { "files": [ "toc.yml" ], "src": "3.0", "version": "powershell-3.0", "dest": "module/psdocs" }, + { "files": [ "**/*.md" ], "src": "3.0", "version": "powershell-3.0", "exclude": [ "docs-conceptual/**" ], "dest": "module" }, + + { "files": [ "toc.yml" ], "src": "docs-conceptual", "version": "powershell-4.0", "dest": "scripting/powershell-4.0" }, + { "files": [ "**/*.md" ], "src": "docs-conceptual", "version": "powershell-4.0", "dest": "scripting" }, + { "files": [ "toc.yml" ], "src": "4.0", "version": "powershell-4.0", "dest": "module/psdocs" }, + { "files": [ "**/*.md" ], "src": "4.0", "version": "powershell-4.0", "exclude": [ "docs-conceptual/**" ], "dest": "module" }, + + { "files": [ "toc.yml" ], "src": "docs-conceptual", "version": "powershell-5.0", "dest": "scripting/powershell-5.0" }, + { "files": [ "**/*.md" ], "src": "docs-conceptual", "version": "powershell-5.0", "dest": "scripting" }, + { "files": [ "toc.yml" ], "src": "5.0", "version": "powershell-5.0", "dest": "module/psdocs" }, + { "files": [ "**/*.md" ], "src": "5.0", "version": "powershell-5.0", "exclude": [ "docs-conceptual/**" ], "dest": "module" }, + + { "files": [ "toc.yml" ], "src": "docs-conceptual", "version": "powershell-5.1", "dest": "scripting/powershell-5.1" }, + { "files": [ "**/*.md" ], "src": "docs-conceptual", "version": "powershell-5.1", "dest": "scripting" }, + { "files": [ "toc.yml" ], "src": "5.1", "version": "powershell-5.1", "dest": "module/psdocs" }, + { "files": [ "**/*.md" ], "src": "5.1", "version": "powershell-5.1", "exclude": [ "docs-conceptual/**" ], "dest": "module" }, + + { "files": [ "toc.yml" ], "src": "docs-conceptual", "version": "powershell-6", "dest": "scripting/powershell-6" }, + { "files": [ "**/*.md" ], "src": "docs-conceptual", "version": "powershell-6", "dest": "scripting" }, + { "files": [ "toc.yml" ], "src": "6", "version": "powershell-6", "dest": "module/psdocs" }, + { "files": [ "**/*.md" ], "src": "6", "version": "powershell-6", "exclude": [ "docs-conceptual/**" ], "dest": "module" }, + + { "files": [ "**/*.md" ], "src": "virtual-directory", "dest": "scripting" }, + { "files": [ "**/*.md" ], "src": "virtual-directory-module", "dest": "module" } ], "resource": [ - { - "files": [ - "**/images/**", - "**/*.png", - "**/*.jpg" - ], - "exclude": [ - "**/obj/**", - "**/includes/**" - ] - }, - { - "files": [ - "**/images/**", - "**/*.png", - "**/*.jpg" - ], - "exclude": [ - "**/obj/**", - "**/includes/**" - ], - "version": "powershell-3.0" - }, - { - "files": [ - "**/images/**", - "**/*.png", - "**/*.jpg" - ], - "exclude": [ - "**/obj/**", - "**/includes/**" - ], - "version": "powershell-4.0" - }, - { - "files": [ - "**/images/**", - "**/*.png", - "**/*.jpg" - ], - "exclude": [ - "**/obj/**", - "**/includes/**" - ], - "version": "powershell-5.0" - }, - { - "files": [ - "**/images/**", - "**/*.png", - "**/*.jpg" - ], - "exclude": [ - "**/obj/**", - "**/includes/**" - ], - "version": "powershell-5.1" - }, - { - "files": [ - "**/images/**", - "**/*.png", - "**/*.jpg" - ], - "exclude": [ - "**/obj/**", - "**/includes/**" - ], - "version": "powershell-6" - } + { "files": [ "**/images/**", "**/*.png", "**/*.gif", "**/*.jpeg", "**/*.jpg", "**/*.svg" ], "exclude": [ "**/obj/**", "**/includes/**" ] }, + { "files": [ "**/images/**", "**/*.png", "**/*.gif", "**/*.jpeg", "**/*.jpg", "**/*.svg" ], "exclude": [ "**/obj/**", "**/includes/**" ], "version": "powershell-3.0" }, + { "files": [ "**/images/**", "**/*.png", "**/*.gif", "**/*.jpeg", "**/*.jpg", "**/*.svg" ], "exclude": [ "**/obj/**", "**/includes/**" ], "version": "powershell-4.0" }, + { "files": [ "**/images/**", "**/*.png", "**/*.gif", "**/*.jpeg", "**/*.jpg", "**/*.svg" ], "exclude": [ "**/obj/**", "**/includes/**" ], "version": "powershell-5.0" }, + { "files": [ "**/images/**", "**/*.png", "**/*.gif", "**/*.jpeg", "**/*.jpg", "**/*.svg" ], "exclude": [ "**/obj/**", "**/includes/**" ], "version": "powershell-5.1" }, + { "files": [ "**/images/**", "**/*.png", "**/*.gif", "**/*.jpeg", "**/*.jpg", "**/*.svg" ], "exclude": [ "**/obj/**", "**/includes/**" ], "version": "powershell-6" } ], "versions": { - "powershell-3.0": { - "dest": "powershell-3.0" - }, - "powershell-4.0": { - "dest": "powershell-4.0" - }, - "powershell-5.0": { - "dest": "powershell-5.0" - }, - "powershell-5.1": { - "dest": "powershell-5.1" - }, - "powershell-6": { - "dest": "powershell-6" - } + "powershell-3.0": { "dest": "powershell-3.0" }, + "powershell-4.0": { "dest": "powershell-4.0" }, + "powershell-5.0": { "dest": "powershell-5.0" }, + "powershell-5.1": { "dest": "powershell-5.1" }, + "powershell-6": { "dest": "powershell-6" } }, "overwrite": [], "externalReference": [], diff --git a/reference/docs-conceptual/core-powershell/console-guide.md b/reference/docs-conceptual/core-powershell/console-guide.md deleted file mode 100644 index 14ce91ffdc25..000000000000 --- a/reference/docs-conceptual/core-powershell/console-guide.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -ms.date: 2017-06-05 -keywords: powershell,cmdlet -title: console guide ---- - -# PowerShell Console Window Guide - -Find in this guide: -- [PowerShell.exe Command Line Help](console/PowerShell.exe-Command-Line-Help.md) -- [Using Tab Expansion](console/Using-Tab-Expansion.md) - diff --git a/reference/docs-conceptual/core-powershell/ise-guide.md b/reference/docs-conceptual/core-powershell/ise-guide.md deleted file mode 100644 index 4356c2494e82..000000000000 --- a/reference/docs-conceptual/core-powershell/ise-guide.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -ms.date: 2017-06-05 -keywords: powershell,cmdlet -title: ise guide ---- - -# ISE Guide - -- [How to Create a PowerShell Tab in Windows PowerShell ISE](ise/How-to-Create-a-PowerShell-Tab-in-Windows-PowerShell-ISE.md) -- [How to Debug Scripts in Windows PowerShell ISE](ise/How-to-Debug-Scripts-in-Windows-PowerShell-ISE.md) -- [How to Use Profiles in Windows PowerShell ISE](ise/How-to-Use-Profiles-in-Windows-PowerShell-ISE.md) -- [How to Use Tab Completion in the Script Pane and Console Pane](ise/How-to-Use-Tab-Completion-in-the-Script-Pane-and-Console-Pane.md) -- [How to Use the Console Pane in the Windows PowerShell ISE](ise/How-to-Use-the-Console-Pane-in-the-Windows-PowerShell-ISE.md) -- [How to Write and Run Scripts in the Windows PowerShell ISE](ise/How-to-Write-and-Run-Scripts-in-the-Windows-PowerShell-ISE.md) -- [Introducing the Windows PowerShell ISE](ise/Introducing-the-Windows-PowerShell-ISE.md) -- [ISE Module](ise/ISE-Module.md) -- [Keyboard Shortcuts for the Windows PowerShell ISE](ise/Keyboard-Shortcuts-for-the-Windows-PowerShell-ISE.md) -- [Purpose of the Windows PowerShell ISE Scripting Object Model](ise/Purpose-of-the-Windows-PowerShell-ISE-Scripting-Object-Model.md) -- [The ISE Object Model Hierarchy](ise/The-ISE-Object-Model-Hierarchy.md) -- [The ISEAddOnTool Object](ise/The-ISEAddOnTool-Object.md) -- [The ISEAddOnToolCollection Object](ise/The-ISEAddOnToolCollection-Object.md) -- [The ISEEditor Object](ise/The-ISEEditor-Object.md) -- [The ISEFile Object](ise/The-ISEFile-Object.md) -- [The ISEFileCollection Object](ise/The-ISEFileCollection-Object.md) -- [The ISEMenuItem Object](ise/The-ISEMenuItem-Object.md) -- [The ISEMenuItemCollection Object](ise/The-ISEMenuItemCollection-Object.md) -- [The ISEOptions Object](ise/The-ISEOptions-Object.md) -- [The ISESnippetCollection Object](ise/The-ISESnippetCollection-Object.md) -- [The ISESnippetObject](ise/The-ISESnippetObject.md) -- [The ObjectModelRoot Object](ise/The-ObjectModelRoot-Object.md) -- [The PowerShellTab Object](ise/The-PowerShellTab-Object.md) -- [The PowerShellTabCollection Object](ise/The-PowerShellTabCollection-Object.md) -- [The Windows PowerShell ISE Scripting Object Model](ise/The-Windows-PowerShell-ISE-Scripting-Object-Model.md) -- [Using the Windows PowerShell ISE](ise/Using-the-Windows-PowerShell-ISE.md) -- [Windows PowerShell ISE Object Model Reference](ise/Windows-PowerShell-ISE-Object-Model-Reference.md) - diff --git a/reference/docs-conceptual/core-powershell/web-access/cmdlets/add-pswaauthorizationrule.md b/reference/docs-conceptual/core-powershell/web-access/cmdlets/add-pswaauthorizationrule.md index c67a436820cf..db2631637612 100644 --- a/reference/docs-conceptual/core-powershell/web-access/cmdlets/add-pswaauthorizationrule.md +++ b/reference/docs-conceptual/core-powershell/web-access/cmdlets/add-pswaauthorizationrule.md @@ -1,8 +1,6 @@ --- description: -manager: carmonm ms.topic: article -author: jpjofre ms.prod: powershell keywords: powershell,cmdlet ms.date: 2016-12-12 diff --git a/reference/docs-conceptual/core-powershell/web-access/cmdlets/get-pswaauthorizationrule.md b/reference/docs-conceptual/core-powershell/web-access/cmdlets/get-pswaauthorizationrule.md index 8d1c67432449..0d73455f93ce 100644 --- a/reference/docs-conceptual/core-powershell/web-access/cmdlets/get-pswaauthorizationrule.md +++ b/reference/docs-conceptual/core-powershell/web-access/cmdlets/get-pswaauthorizationrule.md @@ -1,8 +1,6 @@ --- description: -manager: carmonm ms.topic: article -author: jpjofre ms.prod: powershell keywords: powershell,cmdlet ms.date: 2016-12-12 diff --git a/reference/docs-conceptual/core-powershell/web-access/cmdlets/install-pswawebapplication.md b/reference/docs-conceptual/core-powershell/web-access/cmdlets/install-pswawebapplication.md index eb942e915535..e2d275fe141b 100644 --- a/reference/docs-conceptual/core-powershell/web-access/cmdlets/install-pswawebapplication.md +++ b/reference/docs-conceptual/core-powershell/web-access/cmdlets/install-pswawebapplication.md @@ -1,8 +1,6 @@ --- description: -manager: carmonm ms.topic: article -author: jpjofre ms.prod: powershell keywords: powershell,cmdlet ms.date: 2016-12-12 diff --git a/reference/docs-conceptual/core-powershell/web-access/cmdlets/remove-pswaauthorizationrule.md b/reference/docs-conceptual/core-powershell/web-access/cmdlets/remove-pswaauthorizationrule.md index ec68f13e25f6..80ffc21c97ad 100644 --- a/reference/docs-conceptual/core-powershell/web-access/cmdlets/remove-pswaauthorizationrule.md +++ b/reference/docs-conceptual/core-powershell/web-access/cmdlets/remove-pswaauthorizationrule.md @@ -1,8 +1,6 @@ --- description: -manager: carmonm ms.topic: article -author: jpjofre ms.prod: powershell keywords: powershell,cmdlet ms.date: 2016-12-12 diff --git a/reference/docs-conceptual/core-powershell/web-access/cmdlets/test-pswaauthorizationrule.md b/reference/docs-conceptual/core-powershell/web-access/cmdlets/test-pswaauthorizationrule.md index 0957043a3b23..24b1cf96e56e 100644 --- a/reference/docs-conceptual/core-powershell/web-access/cmdlets/test-pswaauthorizationrule.md +++ b/reference/docs-conceptual/core-powershell/web-access/cmdlets/test-pswaauthorizationrule.md @@ -1,8 +1,6 @@ --- description: -manager: carmonm ms.topic: article -author: jpjofre ms.prod: powershell keywords: powershell,cmdlet ms.date: 2016-12-12 diff --git a/reference/docs-conceptual/core-powershell/web-access/cmdlets/uninstall-pswawebapplication.md b/reference/docs-conceptual/core-powershell/web-access/cmdlets/uninstall-pswawebapplication.md index 7d5d8af6f619..a2a142a1b521 100644 --- a/reference/docs-conceptual/core-powershell/web-access/cmdlets/uninstall-pswawebapplication.md +++ b/reference/docs-conceptual/core-powershell/web-access/cmdlets/uninstall-pswawebapplication.md @@ -1,8 +1,6 @@ --- description: -manager: carmonm ms.topic: article -author: jpjofre ms.prod: powershell keywords: powershell,cmdlet ms.date: 2016-12-12 diff --git a/reference/docs-conceptual/core-powershell/web-access/cmdlets/web-access-cmdlets.md b/reference/docs-conceptual/core-powershell/web-access/cmdlets/web-access-cmdlets.md index 21830cbbeb82..39d96dcd87cc 100644 --- a/reference/docs-conceptual/core-powershell/web-access/cmdlets/web-access-cmdlets.md +++ b/reference/docs-conceptual/core-powershell/web-access/cmdlets/web-access-cmdlets.md @@ -1,8 +1,6 @@ --- description: -manager: carmonm ms.topic: article -author: jpjofre ms.prod: powershell keywords: powershell,cmdlet ms.date: 2016-12-12 diff --git a/reference/docs-conceptual/getting-started/fundamental/Windows-PowerShell-Integrated-Scripting-Environment--ISE-.md b/reference/docs-conceptual/getting-started/fundamental/Windows-PowerShell-Integrated-Scripting-Environment--ISE-.md index e93fab433ffe..fa8a43a45ed6 100644 --- a/reference/docs-conceptual/getting-started/fundamental/Windows-PowerShell-Integrated-Scripting-Environment--ISE-.md +++ b/reference/docs-conceptual/getting-started/fundamental/Windows-PowerShell-Integrated-Scripting-Environment--ISE-.md @@ -63,5 +63,5 @@ Note that any entries labelled "Preview" are pre-release code and are not featur > Because Windows PowerShell ISE requires a graphical user interface, you can’t run it on the Server Core option of Windows Server. ## See also -- [Using the Windows PowerShell Integrated Scripting Environment](Using-the-Windows-PowerShell-ISE.md) +- [Using the Windows PowerShell Integrated Scripting Environment](../../core-powershell/ise/Using-the-Windows-PowerShell-ISE.md) diff --git a/reference/docs-conceptual/getting-started/understanding-concepts-reference.md b/reference/docs-conceptual/getting-started/understanding-concepts-reference.md deleted file mode 100644 index 75f3180da47b..000000000000 --- a/reference/docs-conceptual/getting-started/understanding-concepts-reference.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -ms.date: 2017-06-05 -keywords: powershell,cmdlet -title: understanding concepts reference ---- - -# Understanding Concepts - -* Objects in PowerShell -* [The Pipeline](./fundamental/understanding-the-windows-powershell-pipeline.md) -* Command Parsing -* Evaluating expressions -* Quoting and Escaping -* Operators -* [Variables and assignment](./fundamental/using-variables-to-store-objects.md) -* Command or cmdlet execution -* Native apps execution and parameter passing -* [Implicit and explicit output formatting](./cookbooks/using-format-commands-to-change-output-view.md) -* Developing a Formatting File -* Scripting language elements -* Integration with OS and Services -* Providers -* Drivers -* [Updating help](/powershell/module/Microsoft.PowerShell.Core/Update-Help) - diff --git a/reference/docs-conceptual/toc.yml b/reference/docs-conceptual/toc.yml index ef6d0676491c..95cefcc2907e 100644 --- a/reference/docs-conceptual/toc.yml +++ b/reference/docs-conceptual/toc.yml @@ -11,8 +11,6 @@ href: core-powershell/console/powershell.exe-command-line-help.md - name: Using Tab Expansion href: core-powershell/console/using-tab-expansion.md - - name: Console Guide - href: core-powershell/console-guide.md - name: ISE href: core-powershell/ise/introducing-the-windows-powershell-ise.md items: @@ -70,8 +68,6 @@ href: core-powershell/ise/using-the-windows-powershell-ise.md - name: Windows PowerShell ISE Object Model Reference href: core-powershell/ise/windows-powershell-ise-object-model-reference.md - - name: ISE Guide - href: core-powershell/ise-guide.md - name: Visual Studio Code items: - name: Using Visual Studio Code @@ -211,8 +207,6 @@ href: getting-started/getting-started-with-windows-powershell.md - name: More PowerShell learning href: getting-started/more-powershell-learning.md - - name: Understanding concepts reference - href: getting-started/understanding-concepts-reference.md - name: Setup href: '' items: 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 8b2a5edecb44..4b748e849f3c 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 @@ -14,7 +14,7 @@ This means that Windows PowerShell exposes the API set offered by .NET Framework The APIs shared between .NET Core and .NET Framework are defined as part of [.NET Standard][]. For more information on how this affects module/script compatibility between PowerShell Core and Windows PowerShell, -see [Backwards compatibility with Windows PowerShell][#backwards-compatibility-with-windows-powershell] +see [Backwards compatibility with Windows PowerShell](#backwards-compatibility-with-windows-powershell). ## Support for macOS and Linux @@ -400,4 +400,4 @@ You can find out more about how we use this data in this [blog post][telemetry-b [docker-hub]: https://hub.docker.com/r/microsoft/powershell/ [docker]: https://github.com/PowerShell/PowerShell/tree/master/docker [windowspsmodulepath]: https://www.powershellgallery.com/packages/WindowsPSModulePath/ -[semi-annual]: https://docs.microsoft.com/windows-server/get-started/semi-annual-channel-overview \ No newline at end of file +[semi-annual]: https://docs.microsoft.com/windows-server/get-started/semi-annual-channel-overview diff --git a/reference/mapping/monikerMapping.json b/reference/mapping/monikerMapping.json index c188d50d7bc5..7e92667dc05f 100644 --- a/reference/mapping/monikerMapping.json +++ b/reference/mapping/monikerMapping.json @@ -54,13 +54,13 @@ "Microsoft.PowerShell.Security":{}, "Microsoft.PowerShell.Utility":{}, "Microsoft.WsMan.Management":{}, + "PackageManagement":{}, + "PowershellGet":{}, "PSDesiredStateConfiguration":{}, "PSReadline":{}, "PSScheduledJob":{}, "PSWorkflow":{}, - "PSWorkflowUtility":{}, - "PackageManagement":{}, - "PowershellGet":{} + "PSWorkflowUtility":{} } }, "powershell-5.1": { @@ -81,13 +81,13 @@ "Microsoft.PowerShell.Security":{}, "Microsoft.PowerShell.Utility":{}, "Microsoft.WsMan.Management":{}, + "PackageManagement":{}, + "PowershellGet":{}, "PSDesiredStateConfiguration":{}, "PSReadline":{}, "PSScheduledJob":{}, "PSWorkflow":{}, - "PSWorkflowUtility":{}, - "PackageManagement":{}, - "PowershellGet":{} + "PSWorkflowUtility":{} } }, "powershell-6": { @@ -101,18 +101,15 @@ "Microsoft.PowerShell.Core": {}, "Microsoft.PowerShell.Diagnostics":{}, "Microsoft.PowerShell.Host":{}, - "Microsoft.PowerShell.LocalAccounts":{}, "Microsoft.PowerShell.Management":{}, "Microsoft.PowerShell.Security":{}, "Microsoft.PowerShell.Utility":{}, "Microsoft.WSMan.Management":{}, + "PackageManagement":{}, + "PowerShellGet":{}, "PSDesiredStateConfiguration":{}, "PSDiagnostics":{}, - "PSReadLine":{}, - "PackageManagement":{}, - "Pester":{}, - "PowerShellGet":{} - + "PSReadLine":{} } } }