Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Module to remove Harness Structure - Fixes #169 #182

Merged
merged 4 commits into from
Dec 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text eol=crlf
11 changes: 0 additions & 11 deletions .vscode/RunAllTests.ps1

This file was deleted.

19 changes: 0 additions & 19 deletions .vscode/launch.json

This file was deleted.

7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## Unreleased

- Refactored module folder structure to move resource to root folder of
repository and remove test harness - fixes [Issue #169](https://github.com/PowerShell/StorageDsc/issues/169).
- Updated Examples to support deployment to PowerShell Gallery scripts.
- Removed limitation on using Pester 4.0.8 during AppVeyor CI.
- Moved the Code of Conduct text out of the README.md and into a
CODE\_OF\_CONDUCT.md file.

## 4.3.0.0

- WaitForDisk:
Expand Down
6 changes: 6 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Code of conduct

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
or contact [[email protected]](mailto:[email protected]) with any additional
questions or comments.
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
<#PSScriptInfo
.VERSION 1.0.0
.GUID 3f629ab7-358f-4d82-8c0a-556e32514e3e
.AUTHOR Microsoft Corporation
.COMPANYNAME Microsoft Corporation
.COPYRIGHT
.TAGS DSCConfiguration
.LICENSEURI https://github.com/PowerShell/StorageDsc/blob/master/LICENSE
.PROJECTURI https://github.com/PowerShell/StorageDsc
.ICONURI
.EXTERNALMODULEDEPENDENCIES
.REQUIREDSCRIPTS
.EXTERNALSCRIPTDEPENDENCIES
.RELEASENOTES First version.
.PRIVATEDATA 2016-Datacenter,2016-Datacenter-Server-Core
#>

#Requires -module StorageDsc

<#
.EXAMPLE
.DESCRIPTION
This configuration will wait for disk 2 to become available, and then make the disk available as
two new formatted volumes, 'G' and 'J', with 'J' using all available space after 'G' has been
created. It also creates a new ReFS formated volume on disk 3 attached as drive letter 'S'.
#>
Configuration Example
Configuration Disk_InitializeDataDisk
{
Import-DSCResource -ModuleName StorageDsc

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,30 @@
<#PSScriptInfo
.VERSION 1.0.0
.GUID 56cbc9fc-4168-4662-9dec-12addcfb82da
.AUTHOR Microsoft Corporation
.COMPANYNAME Microsoft Corporation
.COPYRIGHT
.TAGS DSCConfiguration
.LICENSEURI https://github.com/PowerShell/StorageDsc/blob/master/LICENSE
.PROJECTURI https://github.com/PowerShell/StorageDsc
.ICONURI
.EXTERNALMODULEDEPENDENCIES
.REQUIREDSCRIPTS
.EXTERNALSCRIPTDEPENDENCIES
.RELEASENOTES First version.
.PRIVATEDATA 2016-Datacenter,2016-Datacenter-Server-Core
#>

#Requires -module StorageDsc

<#
.EXAMPLE
.DESCRIPTION
This configuration will wait for disk 2 with Unique Id '5E1E50A401000000001517FFFF0AEB84' to become
available, and then make the disk available as two new formatted volumes, 'G' and 'J', with 'J'
using all available space after 'G' has been created. It also creates a new ReFS formated
volume on disk 3 with Unique Id '5E1E50A4010000000029AB39450AC9A5' attached as drive letter 'S'.
#>
Configuration Example
Configuration Disk_InitializeDataDiskUsingUniqueId
{
Import-DSCResource -ModuleName StorageDsc

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
<#PSScriptInfo
.VERSION 1.0.0
.GUID 98a5636f-0168-47df-9235-13e37a7d6d03
.AUTHOR Microsoft Corporation
.COMPANYNAME Microsoft Corporation
.COPYRIGHT
.TAGS DSCConfiguration
.LICENSEURI https://github.com/PowerShell/StorageDsc/blob/master/LICENSE
.PROJECTURI https://github.com/PowerShell/StorageDsc
.ICONURI
.EXTERNALMODULEDEPENDENCIES
.REQUIREDSCRIPTS
.EXTERNALSCRIPTDEPENDENCIES
.RELEASENOTES First version.
.PRIVATEDATA 2016-Datacenter,2016-Datacenter-Server-Core
#>

#Requires -module StorageDsc

<#
.EXAMPLE
.DESCRIPTION
This configuration will wait for disk 2 to become available, and then make the disk available as
two new formatted volumes mounted to folders c:\SQLData and c:\SQLLog, with c:\SQLLog using all
available space after c:\SQLData has been created.
#>
Configuration Example
Configuration DiskAccessPath_InitializeDataDiskWithAccessPath
{
Import-DSCResource -ModuleName StorageDsc

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
<#PSScriptInfo
.VERSION 1.0.0
.GUID e3997b35-031f-4e35-bb18-2f542d710e92
.AUTHOR Microsoft Corporation
.COMPANYNAME Microsoft Corporation
.COPYRIGHT
.TAGS DSCConfiguration
.LICENSEURI https://github.com/PowerShell/StorageDsc/blob/master/LICENSE
.PROJECTURI https://github.com/PowerShell/StorageDsc
.ICONURI
.EXTERNALMODULEDEPENDENCIES
.REQUIREDSCRIPTS
.EXTERNALSCRIPTDEPENDENCIES
.RELEASENOTES First version.
.PRIVATEDATA 2016-Datacenter,2016-Datacenter-Server-Core
#>

#Requires -module StorageDsc

<#
.EXAMPLE
.DESCRIPTION
This configuration will wait for disk 2 with Unique Id '5E1E50A401000000001517FFFF0AEB84' to become
available, and then make the disk available as two new formatted volumes mounted to folders
available, and then make the disk available as two new formatted volumes mounted to folders
c:\SQLData and c:\SQLLog, with c:\SQLLog using all available space after c:\SQLData has been created.
#>
Configuration Example
Configuration DiskAccessPath_InitializeDataDiskWithAccessPathUsingUniqueId
{
Import-DSCResource -ModuleName StorageDsc

Expand Down
34 changes: 34 additions & 0 deletions Examples/Resources/MountImage/1-MountImage_DismountISO.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<#PSScriptInfo
.VERSION 1.0.0
.GUID 12106838-fad0-44c7-b49f-51bfe7109135
.AUTHOR Microsoft Corporation
.COMPANYNAME Microsoft Corporation
.COPYRIGHT
.TAGS DSCConfiguration
.LICENSEURI https://github.com/PowerShell/StorageDsc/blob/master/LICENSE
.PROJECTURI https://github.com/PowerShell/StorageDsc
.ICONURI
.EXTERNALMODULEDEPENDENCIES
.REQUIREDSCRIPTS
.EXTERNALSCRIPTDEPENDENCIES
.RELEASENOTES First version.
.PRIVATEDATA 2016-Datacenter,2016-Datacenter-Server-Core
#>

#Requires -module StorageDsc

<#
.DESCRIPTION
This configuration will unmount an ISO file that is mounted in S:.
#>
configuration MountImage_DismountISO
{
Import-DscResource -ModuleName StorageDsc

MountImage ISO
{
ImagePath = 'c:\Sources\SQL.iso'
DriveLetter = 'S'
Ensure = 'Absent'
}
}
40 changes: 40 additions & 0 deletions Examples/Resources/MountImage/2-MountImage_MountISO.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<#PSScriptInfo
.VERSION 1.0.0
.GUID 73bdd44d-4944-4217-a5ba-4f63948a1376
.AUTHOR Microsoft Corporation
.COMPANYNAME Microsoft Corporation
.COPYRIGHT
.TAGS DSCConfiguration
.LICENSEURI https://github.com/PowerShell/StorageDsc/blob/master/LICENSE
.PROJECTURI https://github.com/PowerShell/StorageDsc
.ICONURI
.EXTERNALMODULEDEPENDENCIES
.REQUIREDSCRIPTS
.EXTERNALSCRIPTDEPENDENCIES
.RELEASENOTES First version.
.PRIVATEDATA 2016-Datacenter,2016-Datacenter-Server-Core
#>

#Requires -module StorageDsc

<#
.DESCRIPTION
This configuration will mount an ISO file as drive S:.
#>
configuration MountImage_MountISO
{
Import-DscResource -ModuleName StorageDsc

MountImage ISO
{
ImagePath = 'c:\Sources\SQL.iso'
DriveLetter = 'S'
}

WaitForVolume WaitForISO
{
DriveLetter = 'S'
RetryIntervalSec = 5
RetryCount = 10
}
}
40 changes: 40 additions & 0 deletions Examples/Resources/MountImage/3-MountImage_MountVHD.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<#PSScriptInfo
.VERSION 1.0.0
.GUID c4b48b7c-2a0f-4d18-9806-9c1063b8de83
.AUTHOR Microsoft Corporation
.COMPANYNAME Microsoft Corporation
.COPYRIGHT
.TAGS DSCConfiguration
.LICENSEURI https://github.com/PowerShell/StorageDsc/blob/master/LICENSE
.PROJECTURI https://github.com/PowerShell/StorageDsc
.ICONURI
.EXTERNALMODULEDEPENDENCIES
.REQUIREDSCRIPTS
.EXTERNALSCRIPTDEPENDENCIES
.RELEASENOTES First version.
.PRIVATEDATA 2016-Datacenter,2016-Datacenter-Server-Core
#>

#Requires -module StorageDsc

<#
.DESCRIPTION
This configuration will mount a VHD file and wait for it to become available.
#>
configuration MountImage_MountVHD
{
Import-DscResource -ModuleName StorageDsc

MountImage MountVHD
{
ImagePath = 'd:\Data\Disk1.vhd'
DriveLetter = 'V'
}

WaitForVolume WaitForVHD
{
DriveLetter = 'V'
RetryIntervalSec = 5
RetryCount = 10
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<#PSScriptInfo
.VERSION 1.0.0
.GUID 1ef469e5-eabf-4e5d-9ff4-f17d2894991f
.AUTHOR Microsoft Corporation
.COMPANYNAME Microsoft Corporation
.COPYRIGHT
.TAGS DSCConfiguration
.LICENSEURI https://github.com/PowerShell/StorageDsc/blob/master/LICENSE
.PROJECTURI https://github.com/PowerShell/StorageDsc
.ICONURI
.EXTERNALMODULEDEPENDENCIES
.REQUIREDSCRIPTS
.EXTERNALSCRIPTDEPENDENCIES
.RELEASENOTES First version.
.PRIVATEDATA 2016-Datacenter,2016-Datacenter-Server-Core
#>

#Requires -module StorageDsc

<#
.DESCRIPTION
This configuration will set the drive letter of the first
optical disk drive in the system to 'Z'.
#>
Configuration OpticalDiskDriveLetter_SetDriveLetter
{
Import-DSCResource -ModuleName StorageDsc

Node localhost
{
OpticalDiskDriveLetter SetFirstOpticalDiskDriveLetterToZ
{
DiskId = 1
DriveLetter = 'Z'
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<#PSScriptInfo
.VERSION 1.0.0
.GUID f7d8127c-90fa-46ef-8dc7-42667a63f4db
.AUTHOR Microsoft Corporation
.COMPANYNAME Microsoft Corporation
.COPYRIGHT
.TAGS DSCConfiguration
.LICENSEURI https://github.com/PowerShell/StorageDsc/blob/master/LICENSE
.PROJECTURI https://github.com/PowerShell/StorageDsc
.ICONURI
.EXTERNALMODULEDEPENDENCIES
.REQUIREDSCRIPTS
.EXTERNALSCRIPTDEPENDENCIES
.RELEASENOTES First version.
.PRIVATEDATA 2016-Datacenter,2016-Datacenter-Server-Core
#>

#Requires -module StorageDsc

<#
.DESCRIPTION
This configuration will remove the drive letter of the first
optical disk drive.
#>
Configuration OpticalDiskDriveLetter_RemoveDriveLetter
{
Import-DSCResource -ModuleName StorageDsc

Node localhost
{
OpticalDiskDriveLetter RemoveFirstOpticalDiskDriveLetter
{
DiskId = 1
DriveLetter = 'X' # This value is ignored
Ensure = 'Absent'
}
}
}
Loading