Skip to content

Commit 01b93df

Browse files
authored
Merge pull request #1 from PowerShell/staging
UPD 2017-06-22
2 parents 4209d97 + d377b75 commit 01b93df

File tree

2,966 files changed

+34923
-38040
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,966 files changed

+34923
-38040
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ out_maml/
1414
packages.config
1515
**/.ignore/**
1616
*.orig
17+
.vscode/
1718

STYLE.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,24 @@ Header 2
3535
## Syntax
3636

3737
* When talking about a cmdlet in paragraph, use \` to highlight cmdlet names
38-
* When writing an article (as opposed to reference content), the first instance of a cmdlet name should be a link to the cmdlet documentation
38+
* Correct Example:
39+
This `Write-Host` Cmdlet can ...
40+
* Incorrect Example:
41+
 This **Write-Host** Cmdlet can ... and pipeline to out-file Cmdlet to ...
42+
* When writing an article (as opposed to reference content), the first instance of a cmdlet name should be a link to the cmdlet documentation
3943
* All PowerShell syntax blocks should use ```powershell
40-
* Do not start PowerShell commands with "C:\ PS>"
44+
* Do not start PowerShell commands with "`PS C:\>`"
45+
* Correct Example:
46+
```powershell
47+
Get-Process
48+
```
49+
* Incorrect Example:
50+
```powershell
51+
PS C:\> Get-Process
52+
```
4153
* Output emitted by PowerShell commands should be commented to prevent it from recieving syntax highlighting
4254
* Property names and parameter names should be in **bold**
43-
55+
* PowerShell cmdlets are "[Pascal Cased](https://en.wikipedia.org/wiki/PascalCase)". Verbs are seperated from nouns by a hyphen.
4456

4557
## Lists
4658

dsc/DSCAutomationHostEnabled.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
21
---
3-
title: DSCAutomationHostEnabled registry key
4-
ms.date: 2016-05-16
5-
keywords: powershell,DSC
6-
description:
7-
ms.topic: article
2+
ms.date: 2017-06-12
83
author: eslesar
9-
manager: dongill
10-
ms.prod: powershell
4+
ms.topic: conceptual
5+
keywords: dsc,powershell,configuration,setup
6+
title: DSCAutomationHostEnabled registry key
117
---
128

139
>Applies to: Windows PowerShell 5.0

dsc/DscForEngineers.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
---
2-
title: Desired State Configuration Overview for Decision Makers
3-
ms.date: 2017-03-13
4-
keywords: powershell,DSC
5-
description:
6-
ms.topic: article
2+
ms.date: 2017-06-12
73
author: eslesar
8-
manager: carmonm
9-
ms.prod: powershell
4+
ms.topic: conceptual
5+
keywords: dsc,powershell,configuration,setup
6+
title: Desired State Configuration Overview for Decision Makers
107
---
118

129
# Desired State Configuration Overview for Engineers #
@@ -141,3 +138,4 @@ To deploy to the different environments, you can invoke `Start-DscConfiguration`
141138
[Configuration Data](configData.md)
142139

143140
[Resources](resources.md)
141+

dsc/PackageManagementDscResource.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
---
2-
title: DSC PackageManagement Resource
3-
ms.date:
4-
keywords: powershell,DSC
5-
description:
6-
ms.topic: article
7-
author: brywang-msft
8-
manager: kriscv
9-
ms.prod: powershell
2+
ms.date: 2017-06-12
3+
author: eslesar
4+
ms.topic: conceptual
5+
keywords: dsc,powershell,configuration,setup
6+
title: DSC PackageManagement Resource
107
---
118

129
# DSC PackageManagement Resource
@@ -94,4 +91,5 @@ Configuration PackageTest
9491
DependsOn = "[PackageManagementSource]PSGallery"
9592
}
9693
}
97-
```
94+
```
95+

dsc/PackageManagementSourceDscResource.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
---
2-
title: DSC PackageManagementSource Resource
3-
ms.date:
4-
keywords: powershell,DSC
5-
description:
6-
ms.topic: article
7-
author: brywang-msft
8-
manager: kriscv
9-
ms.prod: powershell
2+
ms.date: 2017-06-12
3+
author: eslesar
4+
ms.topic: conceptual
5+
keywords: dsc,powershell,configuration,setup
6+
title: DSC PackageManagementSource Resource
107
---
118

129
# DSC PackageManagementSource Resource
@@ -56,3 +53,4 @@ Configuration PackageManagementSourceTest
5653
}
5754
}
5855
```
56+

dsc/TOC.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
## [Specifying cross-node dependencies](crossNodeDependencies.md)
1212
## [Configuration data](configData.md)
1313
### [Credential options in configuration data](configDataCredentials.md)
14-
## [Nestng configurations](compositeConfigs.md)
14+
## [Nesting configurations](compositeConfigs.md)
1515
## [Securing the configuration MOF file](secureMOF.md)
1616
## [Partial Configurations](partialConfigs.md)
1717
## [Writing help for DSC configurations](configHelp.md)
@@ -33,10 +33,14 @@
3333
### [Service Resource](serviceResource.md)
3434
### [ServiceSet Resource](serviceSetResource.md)
3535
### [User Resource](userResource.md)
36+
### [WaitForAllResource](waitForAllResource.md)
37+
### [WaitForAnyResource](waitForAnyResource.md)
38+
### [WaitForSomeResource](waitForSomeResource.md)
3639
### [WindowsFeature Resource](windowsfeatureResource.md)
3740
### [WindowsFeatureSet Resource](windowsFeatureSetResource.md)
3841
### [WindowsOptionalFeature Resource](windowsOptionalFeatureResource.md)
3942
### [WindowsOptionalFeatureSet Resource](windowsOptionalFeatureSetResource.md)
43+
### [WindowsPackageCab Resource](windowsPackageCabResource.md)
4044
### [WindowsProcess Resource](windowsProcessResource.md)
4145
## [Authoring custom resources](authoringResource.md)
4246
### [MOF-based custom resources](authoringResourceMOF.md)
@@ -60,6 +64,10 @@
6064
## [Using a DSC report server](reportServer.md)
6165
## [Pull server best practices](secureServer.md)
6266

67+
# [DSC examples](dscExamples.md)
68+
## [Building a CI/CD pipeline with DSC, Pester, and Visual Studio Team Services](dscCiCd.md)
69+
## [Separating configuration and environment data](separatingEnvData.md)
70+
6371
# [Troubleshooting DSC](troubleshooting.md)
6472

6573
# [Using DSC on Nano Server](nanoDsc.md)

dsc/archiveResource.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
---
2-
title: DSC Archive Resource
3-
ms.date: 2016-05-16
4-
keywords: powershell,DSC
5-
description:
6-
ms.topic: article
2+
ms.date: 2017-06-12
73
author: eslesar
8-
manager: dongill
9-
ms.prod: powershell
4+
ms.topic: conceptual
5+
keywords: dsc,powershell,configuration,setup
6+
title: DSC Archive Resource
107
---
118

129
# DSC Archive Resource

dsc/authoringResource.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
---
2-
title: Build Custom Windows PowerShell Desired State Configuration Resources
3-
ms.date: 2016-05-16
4-
keywords: powershell,DSC
5-
description:
6-
ms.topic: article
2+
ms.date: 2017-06-12
73
author: eslesar
8-
manager: dongill
9-
ms.prod: powershell
4+
ms.topic: conceptual
5+
keywords: dsc,powershell,configuration,setup
6+
title: Build Custom Windows PowerShell Desired State Configuration Resources
107
---
118

129
# Build Custom Windows PowerShell Desired State Configuration Resources

dsc/authoringResourceClass.md

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
---
2-
title: Writing a custom DSC resource with PowerShell classes
3-
ms.date: 2016-05-16
4-
keywords: powershell,DSC
5-
description:
6-
ms.topic: article
2+
ms.date: 2017-06-12
73
author: eslesar
8-
manager: dongill
9-
ms.prod: powershell
4+
ms.topic: conceptual
5+
keywords: dsc,powershell,configuration,setup
6+
title: Writing a custom DSC resource with PowerShell classes
107
---
118

129
# Writing a custom DSC resource with PowerShell classes
@@ -472,6 +469,44 @@ Test
472469
Start-DscConfiguration -Wait -Force Test
473470
```
474471

472+
## Supporting PsDscRunAsCredential
473+
474+
>**Note:** **PsDscRunAsCredential** is supported in PowerShell 5.0 and later.
475+
476+
The **PsDscRunAsCredential** property can be used in [DSC configurations](configurations.md) resource block to specify that the
477+
resource should be run under a specified set of credentials.
478+
For more information, see [Running DSC with user credentials](runAsUser.md).
479+
480+
### Require or disallow PsDscRunAsCredential for your resource
481+
482+
The **DscResource()** attribute takes an optional parameter **RunAsCredential**.
483+
This parameter takes one of three values:
484+
485+
- `Optional` **PsDscRunAsCredential** is optional for configurations that call this resource. This is the default value.
486+
- `Mandatory` **PsDscRunAsCredential** must be used for any configuration that calls this resource.
487+
- `NotSupported` Configurations that call this resource cannot use **PsDscRunAsCredential**.
488+
- `Default` Same as `Optional`.
489+
490+
For example, use the following attribute to specify that your custom resource does not support using **PsDscRunAsCredential**:
491+
492+
```powershell
493+
[DscResource(RunAsCredential=NotSupported)]
494+
class FileResource {
495+
}
496+
```
497+
498+
### Access the user context
499+
500+
To access the user context from within a custom resource, you can use the automatic variable `$global:PsDscContext`.
501+
502+
For example the following code would write the user context under which the resource is running to the verbose output stream:
503+
504+
```powershell
505+
if (PsDscContext.RunAsUser) {
506+
Write-Verbose "User: $global:PsDscContext.RunAsUser";
507+
}
508+
```
509+
475510
## See Also
476511
### Concepts
477512
[Build Custom Windows PowerShell Desired State Configuration Resources](authoringResource.md)

0 commit comments

Comments
 (0)