Skip to content

Commit

Permalink
Merge pull request MicrosoftDocs#1458 from PowerShell/staging
Browse files Browse the repository at this point in the history
merging recent changes into live
  • Loading branch information
zjalexander authored Jul 27, 2017
2 parents a775e47 + 72509be commit a5c0795
Show file tree
Hide file tree
Showing 267 changed files with 14,032 additions and 13,314 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,9 @@ Please note that before you submit a pull request you must [sign a Contribution
For more information on contributing, read our [contributions guide](CONTRIBUTING.md).
There is a draft [style guide](./STYLE.md) to review before making contributions.
Please use the Issue and Pull Request templates to help keep documentation consistent across versions.

## Licenses

There are two license files for this project.
The MIT License applies to the code contained in this repo.
The Creative Commons license applies to the documentation.
8 changes: 4 additions & 4 deletions dsc/configDataCredentials.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ Newer resources and custom resources can use this automatic property instead of

To find the available credential properties on a resource use either `Get-DscResource -Name ResourceName -Syntax` or the Intellisense in the ISE (`CTRL+SPACE`).

```PowerShell
```powershell
PS C:\> Get-DscResource -Name Group -Syntax
Group [String] #ResourceName
{
Expand Down Expand Up @@ -169,7 +169,7 @@ For most purposes this could be a generic user account, because by default users

The following example code uses DSC to populate a local group with a domain user:

```PowerShell
```powershell
Configuration DomainCredentialExample
{
param
Expand Down Expand Up @@ -228,7 +228,7 @@ For more information on certificates and DSC [read this post](http://aka.ms/cert

To force a plain text password, the resource requires the `PsDscAllowPlainTextPassword` keyword in the configuration data section as follows:

```PowerShell
```powershell
Configuration DomainCredentialExample
{
param
Expand Down Expand Up @@ -280,7 +280,7 @@ There is an exception for "localhost", "127.0.0.1", and "::1" in the domain port
In the DSC `Group` resource example above, querying an Active Directory domain *requires* a domain account.
In this case add the `PSDscAllowDomainUser` property to the `ConfigurationData` block as follows:

```PowerShell
```powershell
$cd = @{
AllNodes = @(
@{
Expand Down
2 changes: 1 addition & 1 deletion dsc/crossNodeDependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Configuration JoinDomain
{
Import-DscResource -Module xComputerManagement, xActiveDirectory
Node myPC
Node myDC
{
WindowsFeature InstallAD
{
Expand Down
2 changes: 1 addition & 1 deletion dsc/pullClientConfigID.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ title: Setting up a pull client using configuration ID

> Applies To: Windows PowerShell 5.0
Each target node has to be told to use pull mode and given the URL where it can contact the pull server to get configurations. To do this, you have to configure the Local Configuration Manager (LCM) with the necessary information. To configure the LCM, you create a special type of configuration, derated with the **DSCLocalConfigurationManager** attribute. For more information about configuring the LCM, see [Configuring the Local Configuration Manager](metaConfig.md).
Each target node has to be told to use pull mode and given the URL where it can contact the pull server to get configurations. To do this, you have to configure the Local Configuration Manager (LCM) with the necessary information. To configure the LCM, you create a special type of configuration, decorated with the **DSCLocalConfigurationManager** attribute. For more information about configuring the LCM, see [Configuring the Local Configuration Manager](metaConfig.md).

> **Note**: This topic applies to PowerShell 5.0. For information on setting up a pull client in PowerShell 4.0, see [Setting up a pull client using configuration ID in PowerShell 4.0](pullClientConfigID4.md)
Expand Down
16 changes: 8 additions & 8 deletions dsc/pullServer.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ Requirements for using a pull server:
You can add the IIS server role and DSC Service with the Add Roles and Features wizard in Server Manager, or by using PowerShell. The sample scripts included in this topic will handle both of these steps
for you as well.

## Using the xWebService resource
## Using the xDSCWebService resource
The easiest way to set up a web pull server is to use the xWebService resource, included in the xPSDesiredStateConfiguration module. The following steps explain how to use the resource in a configuration that sets up the web service.

1. Call the [Install-Module](https://technet.microsoft.com/en-us/library/dn807162.aspx) cmdlet to install the **xPSDesiredStateConfiguration** module. **Note**: **Install-Module** is included in the **PowerShellGet** module, which is included in PowerShell 5.0. You can download the **PowerShellGet** module for PowerShell 3.0 and 4.0 at [PackageManagement PowerShell Modules Preview](https://www.microsoft.com/en-us/download/details.aspx?id=49186).
1. Get an SSL certificate for the DSC Pull server from a trusted Certificate Authority, either within your orgnaization or a public authority. The certificate recieved from the authority is usually in the PFX format. Install the certificate on the node that will become the DSC Pull server in the default location which should be CERT:\LocalMachine\My. Make a note of the certificate thumbprint.
1. Get an SSL certificate for the DSC Pull server from a trusted Certificate Authority, either within your organization or a public authority. The certificate received from the authority is usually in the PFX format. Install the certificate on the node that will become the DSC Pull server in the default location which should be CERT:\LocalMachine\My. Make a note of the certificate thumbprint.
1. Select a GUID to be used as the Registration Key. To generate one using PowerShell enter the following at the PS prompt and press enter: '``` [guid]::newGuid()```' or '```New-Guid```'. This key will be used by client nodes as a shared key to authenticate during registration. For more information see the Registration Key section below.
1. In the PowerShell ISE, start (F5) the following configuration script (included in the Example folder of the **xPSDesiredStateConfiguration** module as Sample_xDscWebService.ps1). This script sets up the pull server.

Expand Down Expand Up @@ -84,10 +84,10 @@ configuration Sample_xDscPullServer
```

1. Run the configuration, passing the thumbprint of the SSL certificate as the **certificateThumbPrint** parameter and a GUID registration key as the **RegistrationKey** parameter:
5. Run the configuration, passing the thumbprint of the SSL certificate as the **certificateThumbPrint** parameter and a GUID registration key as the **RegistrationKey** parameter:

```powershell
# To find the Thumbprint for an installed SSL certificate for use with the pull server list all certifcates in your local store
# To find the Thumbprint for an installed SSL certificate for use with the pull server list all certificates in your local store
# and then copy the thumbprint for the appropriate certificate by reviewing the certificate subjects
dir Cert:\LocalMachine\my
Expand All @@ -99,10 +99,10 @@ Start-DscConfiguration -Path c:\Configs\PullServer -Wait -Verbose
```

## Registration Key
To allow client nodes to register with the server so that they can use configuration names instead of a configuration ID, a registration key which was created by the above configuration is saved in a file named `RegistrationKeys.txt` in `C:\Program Files\WindowsPowerShell\DscService`. The registration key functions as a shared secret used during the initial registration by the client with the pull server. The client will generate a self-signed certificate which is used to uniquely authenticate to the pull server once registration is successfully completed. The thumbprint of the this certificate is stored locally and associated with the URL of the pull server.
To allow client nodes to register with the server so that they can use configuration names instead of a configuration ID, a registration key which was created by the above configuration is saved in a file named `RegistrationKeys.txt` in `C:\Program Files\WindowsPowerShell\DscService`. The registration key functions as a shared secret used during the initial registration by the client with the pull server. The client will generate a self-signed certificate which is used to uniquely authenticate to the pull server once registration is successfully completed. The thumbprint of this certificate is stored locally and associated with the URL of the pull server.
> **Note**: Registration keys are not supported in PowerShell 4.0.
In order to configure the a node to authenticate with the pull server the registration key needs to be in the metaconfiguration for any target node that will be registering with this pull server. Note that the **RegistrationKey** in the metaconfiguration below is removed after the target machine has successfully registered, and that the value '140a952b-b9d6-406b-b416-e0f759c9c0e4' must match the value stored in the RegistrationKeys.txt file on the pull server. Always treat the registration key value securely, because knowing it allows any target machine to register with the pull server.
In order to configure a node to authenticate with the pull server the registration key needs to be in the metaconfiguration for any target node that will be registering with this pull server. Note that the **RegistrationKey** in the metaconfiguration below is removed after the target machine has successfully registered, and that the value '140a952b-b9d6-406b-b416-e0f759c9c0e4' must match the value stored in the RegistrationKeys.txt file on the pull server. Always treat the registration key value securely, because knowing it allows any target machine to register with the pull server.

```powershell
[DSCLocalConfigurationManager()]
Expand Down Expand Up @@ -149,7 +149,7 @@ configurations that will be available for target nodes to pull. These files need

### DSC resource module package format

Each resource module needs to be zipped and named according the the following pattern `{Module Name}_{Module Version}.zip`. For example, a module named xWebAdminstration with a module version
Each resource module needs to be zipped and named according the following pattern `{Module Name}_{Module Version}.zip`. For example, a module named xWebAdminstration with a module version
of 3.1.2.0 would be named 'xWebAdministration_3.2.1.0.zip'. Each version of a module must be contained in a single zip file. Since there is only a single version of a resource in each zip
file the module format added in WMF 5.0 with support for multiple module versions in a single directory is not supported. This means that before packaging up DSC resource modules for use with
pull server you will need to make a small change to the directory structure. The default format of modules containing DSC resource in WMF 5.0 is
Expand Down Expand Up @@ -180,7 +180,7 @@ In order to make setting up, validating and managing the pull server easier, the
Publish-DSCModuleAndMof -Source C:\LocalDepot -Force
```

1. A script that validates the Pull Server is configured correctly. [PullServerSetupTests.ps1](https://github.com/PowerShell/xPSDesiredStateConfiguration/blob/dev/DSCPullServerSetup/PullServerDeploymentVerificationTest/PullServerSetupTests.ps1).
2. A script that validates the Pull Server is configured correctly. [PullServerSetupTests.ps1](https://github.com/PowerShell/xPSDesiredStateConfiguration/blob/dev/DSCPullServerSetup/PullServerDeploymentVerificationTest/PullServerSetupTests.ps1).


## Pull client configuration
Expand Down
34 changes: 17 additions & 17 deletions dsc/quickStart.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,22 @@ Configuration WebsiteTest {
Import-DscResource -ModuleName PsDesiredStateConfiguration
# The Node statement specifies which targets this configuration will be applied to.
Node 'localhost' {
Node 'localhost' {
# The first resource block ensures that the Web-Server (IIS) feature is enabled.
WindowsFeature WebServer {
Ensure = "Present"
Name = "Web-Server"
}
WindowsFeature WebServer {
Ensure = "Present"
Name = "Web-Server"
}
# The second resource block ensures that the website content copied to the website root folder.
File WebsiteContent {
Ensure = 'Present'
SourcePath = 'c:\test\index.htm'
File WebsiteContent {
Ensure = 'Present'
SourcePath = 'c:\test\index.htm'
DestinationPath = 'c:\inetpub\wwwroot'
}
}
}
}
}
}
```

Save the file as `WebsiteTest.ps1`.
Expand Down Expand Up @@ -94,21 +94,21 @@ This generates the following output:
Directory: C:\ConfigurationTest\WebsiteTest
Mode LastWriteTime Length Name
---- ------------- ------ ----
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 3/13/2017 5:20 PM 2746 localhost.mof
```

The first line makes the configuration function available in the console.
The second line runs the configuration.
The result is that a new folder, named `WebsiteTest` is created as a subfolder of the current folder.
The `WebsiteTest` folder contains a file named `localhost.mof`.
The `WebsiteTest` folder contains a file named `localhost.mof`.
It is this file that can then be applied to the target node.

## Apply the configuration

Now that you have the compiled MOF, you can apply the configuration to the target node (in this case, the local computer) by calling the
[Start-DscConfiguration](/reference/5.1/PSDesiredStateConfiguration/Start-DscConfiguration.md) cmdlet.
[Start-DscConfiguration](/reference/5.1/PSDesiredStateConfiguration/Start-DscConfiguration) cmdlet.

The `Start-DscConfiguration` cmdlet tells the [Local Configuration Manager (LCM)](metaConfig.md),
which is the engine of DSC, to apply the configuration.
Expand All @@ -122,10 +122,10 @@ Start-DscConfiguration .\WebsiteTest

## Test the configuration

You can call the [Get-DscConfigurationStatus](/reference/5.1/PSDesiredStateConfiguration/Get-DscConfigurationStatus.md)
You can call the [Get-DscConfigurationStatus](/reference/5.1/PSDesiredStateConfiguration/Get-DscConfigurationStatus)
cmdlet to see whether the configuration succeeded.

You can also test the results directly, in this case by browsing to `http://localhost/` in a web browser.
You can also test the results directly, in this case by browsing to `http://localhost/` in a web browser.
You should see the "Hello World" HTML page you created as the first step in this example.

## Next steps
Expand Down
1 change: 0 additions & 1 deletion gallery/psgallery/psgallery-PublishingGuidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ Signing PowerShell files is a well-established approach to ensuring that the cod
Details on how to sign PowerShell script files is covered in the [About Signing](https://msdn.microsoft.com/en-us/powershell/reference/5.1/microsoft.powershell.core/about/about_signing) topic.
In overview, a signature can be added to any .PS1 file that PowerShell validates when the script is loaded.
PowerShell can be constrained using the [Execution Policy](https://msdn.microsoft.com/en-us/powershell/reference/5.1/microsoft.powershell.core/about/about_execution_policies) cmdlets to ensure use of signed scripts.
This feature is frequently used in highly secure environments.

Catalog signing modules is a feature added to PowerShell in version 5.1.
How to sign a module is covered in the [Catalog Cmdlets](https://msdn.microsoft.com/en-us/powershell/wmf/5.1/catalog-cmdlets) topic.
Expand Down
4 changes: 2 additions & 2 deletions gallery/psgallery/psgallery_status.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ __Next Steps__: If you used the Contact Us link or sent mail to cgadmin@microsof

__Summary of Impact__: Between 7/11/2016 and 7/13/2016, a subset of customers experienced issues downloading items from the PowerShell Gallery. The issue likely manifested itself in the following error message returned from Install-Module/Install-Script and Save-Module/Save-Script:

```PowerShell
```powershell
PS C:\> Install-Module xStorage
PackageManagement\Install-Package : Package 'xStorage' failed to be installed because:
End of Central Directory record could not be found. At C:\Program
Expand All @@ -81,7 +81,7 @@ __Next Steps__: Investigate the underlying root cause and developing a solution
## 5/19/2016 - Download Items Failed
__Summary of Impact__: Between 5/17/2016 and 5/19/2016, a subset of customers experienced issues downloading items from the PowerShell Gallery. The issue likely manifested itself in the following error message returned from Install-Module/Install-Script and Save-Module/Save-Script:

```PowerShell
```powershell
VERBOSE: Hash for package 'AzureRM.OperationalInsights' does not match hash provided from the server.
VERBOSE: InstallPackageLocal' - name='AzureRM.OperationalInsights', version='1.0.8',
destination='C:\Users\jbritt\AppData\Local\Temp\2\1741355729'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ If the machine is not connected to the Internet, the user or an administrator mu
## Resolving error when the NuGet provider has not been installed on a machine that is Internet connected

```PowerShell
```powershell
PS C:\> Find-Module -Repository PSGallery -Verbose -Name Contoso
NuGet provider is required to continue
Expand Down Expand Up @@ -49,7 +49,7 @@ Version Name Type Repository D
```
## Resolving error when the NuGet provider is available and NuGet.exe is not available during the publish operation on a machine that is Internet connected

```PowerShell
```powershell
PS C:\> Publish-Module -Name Contoso -Repository PSGallery -Verbose
NuGet.exe is required to continue
Expand All @@ -73,7 +73,7 @@ VERBOSE: Successfully published module 'Contoso' to the module publish location

## Resolving error when both NuGet provider and NuGet.exe are not available during the publish operation on a machine that is Internet connected

```PowerShell
```powershell
PS C:\> Publish-Module -Name Contoso -Repository PSGallery -Verbose
NuGet.exe and NuGet provider are required to continue
Expand Down
Loading

0 comments on commit a5c0795

Please sign in to comment.