Skip to content

Commit e4a289c

Browse files
committed
Add PSScriptInfo to Examples
1 parent bf2fa98 commit e4a289c

14 files changed

Lines changed: 225 additions & 87 deletions

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
- Added Open Code of Conduct.
88
- Refactored module folder structure to move resource
99
to root folder of repository and remove test harness - Fixes [Issue #11](https://github.com/PlagueHO/FileContentDsc/issues/11).
10+
- Converted Examples to support format for publishing to PowerShell
11+
Gallery.
1012

1113
## 1.0.0.0
1214

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<#PSScriptInfo
2+
.VERSION 1.0.0
3+
.GUID 389e1516-5961-4b13-b698-62fbfb8c1107
4+
.AUTHOR Daniel Scott-Raynsford
5+
.COMPANYNAME
6+
.COPYRIGHT (c) 2018 Daniel Scott-Raynsford. All rights reserved.
7+
.TAGS DSCConfiguration
8+
.LICENSEURI https://github.com/PlagueHO/FileContentDsc/blob/master/LICENSE
9+
.PROJECTURI https://github.com/PlagueHO/FileContentDsc
10+
.ICONURI
11+
.EXTERNALMODULEDEPENDENCIES
12+
.REQUIREDSCRIPTS
13+
.EXTERNALSCRIPTDEPENDENCIES
14+
.RELEASENOTES First version.
15+
.PRIVATEDATA 2016-Datacenter,2016-Datacenter-Server-Core
16+
#>
17+
18+
#Requires -module FileContentDsc
19+
20+
<#
21+
.DESCRIPTION
22+
Set the `Level` entry in the [Logging] section to `Information`
23+
in the file `c:\myapp\myapp.ini`.
24+
#>
25+
Configuration Example
26+
{
27+
Import-DSCResource -ModuleName FileContentDsc
28+
29+
Node localhost
30+
{
31+
IniSettingsFile SetLogging
32+
{
33+
Path = 'c:\myapp\myapp.ini'
34+
Section = 'Logging'
35+
Key = 'Level'
36+
Text = 'Information'
37+
}
38+
}
39+
}

Examples/Resources/IniSettingsFile/IniSettingsFile_SetSecretTextEntry_Config.ps1 renamed to Examples/Resources/IniSettingsFile/2-IniSettingsFile_SetSecretTextEntry_Config.ps1

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
<#PSScriptInfo
2+
.VERSION 1.0.0
3+
.GUID e1cbce56-1760-4208-b2dd-45cea4e87ab7
4+
.AUTHOR Daniel Scott-Raynsford
5+
.COMPANYNAME
6+
.COPYRIGHT (c) 2018 Daniel Scott-Raynsford. All rights reserved.
7+
.TAGS DSCConfiguration
8+
.LICENSEURI https://github.com/PlagueHO/FileContentDsc/blob/master/LICENSE
9+
.PROJECTURI https://github.com/PlagueHO/FileContentDsc
10+
.ICONURI
11+
.EXTERNALMODULEDEPENDENCIES
12+
.REQUIREDSCRIPTS
13+
.EXTERNALSCRIPTDEPENDENCIES
14+
.RELEASENOTES First version.
15+
.PRIVATEDATA 2016-Datacenter,2016-Datacenter-Server-Core
16+
#>
17+
118
#Requires -module FileContentDsc
219

320
<#

Examples/Resources/IniSettingsFile/IniSettingsFile_SetPlainTextEntry_Config.ps1

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<#PSScriptInfo
2+
.VERSION 1.0.0
3+
.GUID d326f0fb-b169-4602-a508-dbcb07d0e883
4+
.AUTHOR Daniel Scott-Raynsford
5+
.COMPANYNAME
6+
.COPYRIGHT (c) 2018 Daniel Scott-Raynsford. All rights reserved.
7+
.TAGS DSCConfiguration
8+
.LICENSEURI https://github.com/PlagueHO/FileContentDsc/blob/master/LICENSE
9+
.PROJECTURI https://github.com/PlagueHO/FileContentDsc
10+
.ICONURI
11+
.EXTERNALMODULEDEPENDENCIES
12+
.REQUIREDSCRIPTS
13+
.EXTERNALSCRIPTDEPENDENCIES
14+
.RELEASENOTES First version.
15+
.PRIVATEDATA 2016-Datacenter,2016-Datacenter-Server-Core
16+
#>
17+
18+
#Requires -module FileContentDsc
19+
20+
<#
21+
.DESCRIPTION
22+
Remove all `Core.Logging` keys in the file `c:\myapp\myapp.conf`.
23+
#>
24+
Configuration Example
25+
{
26+
Import-DSCResource -ModuleName FileContentDsc
27+
28+
Node localhost
29+
{
30+
KeyValuePairFile RemoveCoreLogging
31+
{
32+
Path = 'c:\myapp\myapp.conf'
33+
Name = 'Core.Logging'
34+
Ensure = 'Absent'
35+
}
36+
}
37+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<#PSScriptInfo
2+
.VERSION 1.0.0
3+
.GUID 81ab6eb0-3052-46cd-bea5-653e89d38972
4+
.AUTHOR Daniel Scott-Raynsford
5+
.COMPANYNAME
6+
.COPYRIGHT (c) 2018 Daniel Scott-Raynsford. All rights reserved.
7+
.TAGS DSCConfiguration
8+
.LICENSEURI https://github.com/PlagueHO/FileContentDsc/blob/master/LICENSE
9+
.PROJECTURI https://github.com/PlagueHO/FileContentDsc
10+
.ICONURI
11+
.EXTERNALMODULEDEPENDENCIES
12+
.REQUIREDSCRIPTS
13+
.EXTERNALSCRIPTDEPENDENCIES
14+
.RELEASENOTES First version.
15+
.PRIVATEDATA 2016-Datacenter,2016-Datacenter-Server-Core
16+
#>
17+
18+
#Requires -module FileContentDsc
19+
20+
<#
21+
.DESCRIPTION
22+
Set all `Core.Logging` keys to `Information` or add it
23+
if it is missing in the file `c:\myapp\myapp.conf`.
24+
#>
25+
Configuration Example
26+
{
27+
Import-DSCResource -ModuleName FileContentDsc
28+
29+
Node localhost
30+
{
31+
KeyValuePairFile SetCoreLogging
32+
{
33+
Path = 'c:\myapp\myapp.conf'
34+
Name = 'Core.Logging'
35+
Ensure = 'Present'
36+
Text = 'Information'
37+
}
38+
}
39+
}

Examples/Resources/KeyValuePairFile/KeyValuePairFile_SetSecretTextPair_Config.ps1 renamed to Examples/Resources/KeyValuePairFile/3-KeyValuePairFile_SetSecretTextPair_Config.ps1

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
<#PSScriptInfo
2+
.VERSION 1.0.0
3+
.GUID 89fa6d5d-c121-4502-8bac-5d3ea66e8e80
4+
.AUTHOR Daniel Scott-Raynsford
5+
.COMPANYNAME
6+
.COPYRIGHT (c) 2018 Daniel Scott-Raynsford. All rights reserved.
7+
.TAGS DSCConfiguration
8+
.LICENSEURI https://github.com/PlagueHO/FileContentDsc/blob/master/LICENSE
9+
.PROJECTURI https://github.com/PlagueHO/FileContentDsc
10+
.ICONURI
11+
.EXTERNALMODULEDEPENDENCIES
12+
.REQUIREDSCRIPTS
13+
.EXTERNALSCRIPTDEPENDENCIES
14+
.RELEASENOTES First version.
15+
.PRIVATEDATA 2016-Datacenter,2016-Datacenter-Server-Core
16+
#>
17+
118
#Requires -module FileContentDsc
219

320
<#

Examples/Resources/KeyValuePairFile/KeyValuePairFile_RemovePlainTextPair_Config.ps1

Lines changed: 0 additions & 20 deletions
This file was deleted.

Examples/Resources/KeyValuePairFile/KeyValuePairFile_SetPlainTextPair_Config.ps1

Lines changed: 0 additions & 22 deletions
This file was deleted.

Examples/Resources/ReplaceText/ReplaceText_ReplacePlainSecretText_Config.ps1 renamed to Examples/Resources/ReplaceText/1-ReplaceText_ReplacePlainSecretText_Config.ps1

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
<#PSScriptInfo
2+
.VERSION 1.0.0
3+
.GUID 6a6a7523-91c3-4038-b7f1-178b8dd6803d
4+
.AUTHOR Daniel Scott-Raynsford
5+
.COMPANYNAME
6+
.COPYRIGHT (c) 2018 Daniel Scott-Raynsford. All rights reserved.
7+
.TAGS DSCConfiguration
8+
.LICENSEURI https://github.com/PlagueHO/FileContentDsc/blob/master/LICENSE
9+
.PROJECTURI https://github.com/PlagueHO/FileContentDsc
10+
.ICONURI
11+
.EXTERNALMODULEDEPENDENCIES
12+
.REQUIREDSCRIPTS
13+
.EXTERNALSCRIPTDEPENDENCIES
14+
.RELEASENOTES First version.
15+
.PRIVATEDATA 2016-Datacenter,2016-Datacenter-Server-Core
16+
#>
17+
118
#Requires -module FileContentDsc
219

320
<#

0 commit comments

Comments
 (0)