diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..92be83e2 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text eol=crlf diff --git a/.vscode/RunAllTests.ps1 b/.vscode/RunAllTests.ps1 deleted file mode 100644 index 7c1d2c75..00000000 --- a/.vscode/RunAllTests.ps1 +++ /dev/null @@ -1,11 +0,0 @@ -[string] $repoRoot = Split-Path -Path (Split-Path -Path $Script:MyInvocation.MyCommand.Path) -if ( (-not (Test-Path -Path (Join-Path -Path $repoRoot -ChildPath 'DSCResource.Tests'))) -or ` - (-not (Test-Path -Path (Join-Path -Path $repoRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1'))) ) -{ - & git @('clone','https://github.com/PowerShell/DscResource.Tests.git',(Join-Path -Path $repoRoot -ChildPath '\DSCResource.Tests\')) -} - -Import-Module (Join-Path $PSScriptRoot "..\Tests\TestHarness.psm1" -Resolve) -$dscTestsPath = Join-Path -Path $PSScriptRoot ` - -ChildPath "..\Modules\xStorage\DscResource.Tests\Meta.Tests.ps1" -Invoke-TestHarness -DscTestsPath $dscTestsPath diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 86c32f38..00000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": "0.2.0", - "configurations": [ - { - "name": "PowerShell", - "type": "PowerShell", - "request": "launch", - "program": "${file}", - "args": [], - "cwd": "${file}" - }, - { - "name": "Run all tests", - "type": "PowerShell", - "request": "launch", - "program": "${workspaceRoot}/.vscode/RunAllTests.ps1" - } - ] -} diff --git a/CHANGELOG.md b/CHANGELOG.md index 856364c6..a63685e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ ## Unreleased +## 4.4.0.0 + +- 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. +- Explicitly removed extra hidden files from release package + ## 4.3.0.0 - WaitForDisk: diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..1d5c9eab --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -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 [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional +questions or comments. diff --git a/Modules/StorageDsc/DSCResources/MSFTDSC_Disk/MSFTDSC_Disk.psm1 b/DSCResources/MSFTDSC_Disk/MSFTDSC_Disk.psm1 similarity index 100% rename from Modules/StorageDsc/DSCResources/MSFTDSC_Disk/MSFTDSC_Disk.psm1 rename to DSCResources/MSFTDSC_Disk/MSFTDSC_Disk.psm1 diff --git a/Modules/StorageDsc/DSCResources/MSFTDSC_Disk/MSFTDSC_Disk.schema.mof b/DSCResources/MSFTDSC_Disk/MSFTDSC_Disk.schema.mof similarity index 100% rename from Modules/StorageDsc/DSCResources/MSFTDSC_Disk/MSFTDSC_Disk.schema.mof rename to DSCResources/MSFTDSC_Disk/MSFTDSC_Disk.schema.mof diff --git a/Modules/StorageDsc/DSCResources/MSFTDSC_Disk/README.md b/DSCResources/MSFTDSC_Disk/README.md similarity index 100% rename from Modules/StorageDsc/DSCResources/MSFTDSC_Disk/README.md rename to DSCResources/MSFTDSC_Disk/README.md diff --git a/Modules/StorageDsc/DSCResources/MSFTDSC_Disk/en-us/MSFTDSC_Disk.strings.psd1 b/DSCResources/MSFTDSC_Disk/en-us/MSFTDSC_Disk.strings.psd1 similarity index 100% rename from Modules/StorageDsc/DSCResources/MSFTDSC_Disk/en-us/MSFTDSC_Disk.strings.psd1 rename to DSCResources/MSFTDSC_Disk/en-us/MSFTDSC_Disk.strings.psd1 diff --git a/Modules/StorageDsc/DSCResources/MSFT_DiskAccessPath/MSFT_DiskAccessPath.psm1 b/DSCResources/MSFT_DiskAccessPath/MSFT_DiskAccessPath.psm1 similarity index 100% rename from Modules/StorageDsc/DSCResources/MSFT_DiskAccessPath/MSFT_DiskAccessPath.psm1 rename to DSCResources/MSFT_DiskAccessPath/MSFT_DiskAccessPath.psm1 diff --git a/Modules/StorageDsc/DSCResources/MSFT_DiskAccessPath/MSFT_DiskAccessPath.schema.mof b/DSCResources/MSFT_DiskAccessPath/MSFT_DiskAccessPath.schema.mof similarity index 100% rename from Modules/StorageDsc/DSCResources/MSFT_DiskAccessPath/MSFT_DiskAccessPath.schema.mof rename to DSCResources/MSFT_DiskAccessPath/MSFT_DiskAccessPath.schema.mof diff --git a/Modules/StorageDsc/DSCResources/MSFT_DiskAccessPath/README.md b/DSCResources/MSFT_DiskAccessPath/README.md similarity index 100% rename from Modules/StorageDsc/DSCResources/MSFT_DiskAccessPath/README.md rename to DSCResources/MSFT_DiskAccessPath/README.md diff --git a/Modules/StorageDsc/DSCResources/MSFT_DiskAccessPath/en-us/MSFT_DiskAccessPath.strings.psd1 b/DSCResources/MSFT_DiskAccessPath/en-us/MSFT_DiskAccessPath.strings.psd1 similarity index 100% rename from Modules/StorageDsc/DSCResources/MSFT_DiskAccessPath/en-us/MSFT_DiskAccessPath.strings.psd1 rename to DSCResources/MSFT_DiskAccessPath/en-us/MSFT_DiskAccessPath.strings.psd1 diff --git a/Modules/StorageDsc/DSCResources/MSFT_MountImage/MSFT_MountImage.psm1 b/DSCResources/MSFT_MountImage/MSFT_MountImage.psm1 similarity index 100% rename from Modules/StorageDsc/DSCResources/MSFT_MountImage/MSFT_MountImage.psm1 rename to DSCResources/MSFT_MountImage/MSFT_MountImage.psm1 diff --git a/Modules/StorageDsc/DSCResources/MSFT_MountImage/MSFT_MountImage.schema.mof b/DSCResources/MSFT_MountImage/MSFT_MountImage.schema.mof similarity index 100% rename from Modules/StorageDsc/DSCResources/MSFT_MountImage/MSFT_MountImage.schema.mof rename to DSCResources/MSFT_MountImage/MSFT_MountImage.schema.mof diff --git a/Modules/StorageDsc/DSCResources/MSFT_MountImage/README.md b/DSCResources/MSFT_MountImage/README.md similarity index 100% rename from Modules/StorageDsc/DSCResources/MSFT_MountImage/README.md rename to DSCResources/MSFT_MountImage/README.md diff --git a/Modules/StorageDsc/DSCResources/MSFT_MountImage/en-us/MSFT_MountImage.strings.psd1 b/DSCResources/MSFT_MountImage/en-us/MSFT_MountImage.strings.psd1 similarity index 100% rename from Modules/StorageDsc/DSCResources/MSFT_MountImage/en-us/MSFT_MountImage.strings.psd1 rename to DSCResources/MSFT_MountImage/en-us/MSFT_MountImage.strings.psd1 diff --git a/Modules/StorageDsc/DSCResources/MSFT_OpticalDiskDriveLetter/MSFT_OpticalDiskDriveLetter.psm1 b/DSCResources/MSFT_OpticalDiskDriveLetter/MSFT_OpticalDiskDriveLetter.psm1 similarity index 100% rename from Modules/StorageDsc/DSCResources/MSFT_OpticalDiskDriveLetter/MSFT_OpticalDiskDriveLetter.psm1 rename to DSCResources/MSFT_OpticalDiskDriveLetter/MSFT_OpticalDiskDriveLetter.psm1 diff --git a/Modules/StorageDsc/DSCResources/MSFT_OpticalDiskDriveLetter/MSFT_OpticalDiskDriveLetter.schema.mof b/DSCResources/MSFT_OpticalDiskDriveLetter/MSFT_OpticalDiskDriveLetter.schema.mof similarity index 100% rename from Modules/StorageDsc/DSCResources/MSFT_OpticalDiskDriveLetter/MSFT_OpticalDiskDriveLetter.schema.mof rename to DSCResources/MSFT_OpticalDiskDriveLetter/MSFT_OpticalDiskDriveLetter.schema.mof diff --git a/Modules/StorageDsc/DSCResources/MSFT_OpticalDiskDriveLetter/README.md b/DSCResources/MSFT_OpticalDiskDriveLetter/README.md similarity index 100% rename from Modules/StorageDsc/DSCResources/MSFT_OpticalDiskDriveLetter/README.md rename to DSCResources/MSFT_OpticalDiskDriveLetter/README.md diff --git a/Modules/StorageDsc/DSCResources/MSFT_OpticalDiskDriveLetter/en-us/MSFT_OpticalDiskDriveLetter.strings.psd1 b/DSCResources/MSFT_OpticalDiskDriveLetter/en-us/MSFT_OpticalDiskDriveLetter.strings.psd1 similarity index 100% rename from Modules/StorageDsc/DSCResources/MSFT_OpticalDiskDriveLetter/en-us/MSFT_OpticalDiskDriveLetter.strings.psd1 rename to DSCResources/MSFT_OpticalDiskDriveLetter/en-us/MSFT_OpticalDiskDriveLetter.strings.psd1 diff --git a/Modules/StorageDsc/DSCResources/MSFT_WaitForDisk/MSFT_WaitForDisk.psm1 b/DSCResources/MSFT_WaitForDisk/MSFT_WaitForDisk.psm1 similarity index 100% rename from Modules/StorageDsc/DSCResources/MSFT_WaitForDisk/MSFT_WaitForDisk.psm1 rename to DSCResources/MSFT_WaitForDisk/MSFT_WaitForDisk.psm1 diff --git a/Modules/StorageDsc/DSCResources/MSFT_WaitForDisk/MSFT_WaitForDisk.schema.mof b/DSCResources/MSFT_WaitForDisk/MSFT_WaitForDisk.schema.mof similarity index 100% rename from Modules/StorageDsc/DSCResources/MSFT_WaitForDisk/MSFT_WaitForDisk.schema.mof rename to DSCResources/MSFT_WaitForDisk/MSFT_WaitForDisk.schema.mof diff --git a/Modules/StorageDsc/DSCResources/MSFT_WaitForDisk/README.md b/DSCResources/MSFT_WaitForDisk/README.md similarity index 100% rename from Modules/StorageDsc/DSCResources/MSFT_WaitForDisk/README.md rename to DSCResources/MSFT_WaitForDisk/README.md diff --git a/Modules/StorageDsc/DSCResources/MSFT_WaitForDisk/en-us/MSFT_WaitForDisk.strings.psd1 b/DSCResources/MSFT_WaitForDisk/en-us/MSFT_WaitForDisk.strings.psd1 similarity index 100% rename from Modules/StorageDsc/DSCResources/MSFT_WaitForDisk/en-us/MSFT_WaitForDisk.strings.psd1 rename to DSCResources/MSFT_WaitForDisk/en-us/MSFT_WaitForDisk.strings.psd1 diff --git a/Modules/StorageDsc/DSCResources/MSFT_WaitForVolume/MSFT_WaitForVolume.psm1 b/DSCResources/MSFT_WaitForVolume/MSFT_WaitForVolume.psm1 similarity index 100% rename from Modules/StorageDsc/DSCResources/MSFT_WaitForVolume/MSFT_WaitForVolume.psm1 rename to DSCResources/MSFT_WaitForVolume/MSFT_WaitForVolume.psm1 diff --git a/Modules/StorageDsc/DSCResources/MSFT_WaitForVolume/MSFT_WaitForVolume.schema.mof b/DSCResources/MSFT_WaitForVolume/MSFT_WaitForVolume.schema.mof similarity index 100% rename from Modules/StorageDsc/DSCResources/MSFT_WaitForVolume/MSFT_WaitForVolume.schema.mof rename to DSCResources/MSFT_WaitForVolume/MSFT_WaitForVolume.schema.mof diff --git a/Modules/StorageDsc/DSCResources/MSFT_WaitForVolume/README.md b/DSCResources/MSFT_WaitForVolume/README.md similarity index 100% rename from Modules/StorageDsc/DSCResources/MSFT_WaitForVolume/README.md rename to DSCResources/MSFT_WaitForVolume/README.md diff --git a/Modules/StorageDsc/DSCResources/MSFT_WaitForVolume/en-us/MSFT_WaitForVolume.strings.psd1 b/DSCResources/MSFT_WaitForVolume/en-us/MSFT_WaitForVolume.strings.psd1 similarity index 100% rename from Modules/StorageDsc/DSCResources/MSFT_WaitForVolume/en-us/MSFT_WaitForVolume.strings.psd1 rename to DSCResources/MSFT_WaitForVolume/en-us/MSFT_WaitForVolume.strings.psd1 diff --git a/Modules/StorageDsc/Examples/Resources/Disk/1-Disk_InitializeDataDisk.ps1 b/Examples/Resources/Disk/1-Disk_InitializeDataDisk.ps1 similarity index 69% rename from Modules/StorageDsc/Examples/Resources/Disk/1-Disk_InitializeDataDisk.ps1 rename to Examples/Resources/Disk/1-Disk_InitializeDataDisk.ps1 index 03d2fd13..64a95c0d 100644 --- a/Modules/StorageDsc/Examples/Resources/Disk/1-Disk_InitializeDataDisk.ps1 +++ b/Examples/Resources/Disk/1-Disk_InitializeDataDisk.ps1 @@ -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 diff --git a/Modules/StorageDsc/Examples/Resources/Disk/2-Disk_InitializeDataDiskUsingUniqueId.ps1 b/Examples/Resources/Disk/2-Disk_InitializeDataDiskUsingUniqueId.ps1 similarity index 75% rename from Modules/StorageDsc/Examples/Resources/Disk/2-Disk_InitializeDataDiskUsingUniqueId.ps1 rename to Examples/Resources/Disk/2-Disk_InitializeDataDiskUsingUniqueId.ps1 index 7294ffd2..44849e1e 100644 --- a/Modules/StorageDsc/Examples/Resources/Disk/2-Disk_InitializeDataDiskUsingUniqueId.ps1 +++ b/Examples/Resources/Disk/2-Disk_InitializeDataDiskUsingUniqueId.ps1 @@ -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 diff --git a/Modules/StorageDsc/Examples/Resources/DiskAccessPath/1-DiskAccessPath_InitializeDataDiskWithAccessPath.ps1 b/Examples/Resources/DiskAccessPath/1-DiskAccessPath_InitializeDataDiskWithAccessPath.ps1 similarity index 61% rename from Modules/StorageDsc/Examples/Resources/DiskAccessPath/1-DiskAccessPath_InitializeDataDiskWithAccessPath.ps1 rename to Examples/Resources/DiskAccessPath/1-DiskAccessPath_InitializeDataDiskWithAccessPath.ps1 index 30acce6c..2e4b878d 100644 --- a/Modules/StorageDsc/Examples/Resources/DiskAccessPath/1-DiskAccessPath_InitializeDataDiskWithAccessPath.ps1 +++ b/Examples/Resources/DiskAccessPath/1-DiskAccessPath_InitializeDataDiskWithAccessPath.ps1 @@ -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 diff --git a/Modules/StorageDsc/Examples/Resources/DiskAccessPath/2-DiskAccessPath_InitializeDataDiskWithAccessPathUsingUniqueId.ps1 b/Examples/Resources/DiskAccessPath/2-DiskAccessPath_InitializeDataDiskWithAccessPathUsingUniqueId.ps1 similarity index 65% rename from Modules/StorageDsc/Examples/Resources/DiskAccessPath/2-DiskAccessPath_InitializeDataDiskWithAccessPathUsingUniqueId.ps1 rename to Examples/Resources/DiskAccessPath/2-DiskAccessPath_InitializeDataDiskWithAccessPathUsingUniqueId.ps1 index 008cc523..f899a88c 100644 --- a/Modules/StorageDsc/Examples/Resources/DiskAccessPath/2-DiskAccessPath_InitializeDataDiskWithAccessPathUsingUniqueId.ps1 +++ b/Examples/Resources/DiskAccessPath/2-DiskAccessPath_InitializeDataDiskWithAccessPathUsingUniqueId.ps1 @@ -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 diff --git a/Examples/Resources/MountImage/1-MountImage_DismountISO.ps1 b/Examples/Resources/MountImage/1-MountImage_DismountISO.ps1 new file mode 100644 index 00000000..b7834745 --- /dev/null +++ b/Examples/Resources/MountImage/1-MountImage_DismountISO.ps1 @@ -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' + } +} diff --git a/Examples/Resources/MountImage/2-MountImage_MountISO.ps1 b/Examples/Resources/MountImage/2-MountImage_MountISO.ps1 new file mode 100644 index 00000000..900600fa --- /dev/null +++ b/Examples/Resources/MountImage/2-MountImage_MountISO.ps1 @@ -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 + } +} diff --git a/Examples/Resources/MountImage/3-MountImage_MountVHD.ps1 b/Examples/Resources/MountImage/3-MountImage_MountVHD.ps1 new file mode 100644 index 00000000..352b9938 --- /dev/null +++ b/Examples/Resources/MountImage/3-MountImage_MountVHD.ps1 @@ -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 + } +} diff --git a/Examples/Resources/OpticalDiskDriveLetter/1-OpticalDiskDriveLetter_SetDriveLetter.ps1 b/Examples/Resources/OpticalDiskDriveLetter/1-OpticalDiskDriveLetter_SetDriveLetter.ps1 new file mode 100644 index 00000000..43947ade --- /dev/null +++ b/Examples/Resources/OpticalDiskDriveLetter/1-OpticalDiskDriveLetter_SetDriveLetter.ps1 @@ -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' + } + } +} diff --git a/Examples/Resources/OpticalDiskDriveLetter/2-OpticalDiskDriveLetter_RemoveDriveLetter.ps1 b/Examples/Resources/OpticalDiskDriveLetter/2-OpticalDiskDriveLetter_RemoveDriveLetter.ps1 new file mode 100644 index 00000000..a8299c09 --- /dev/null +++ b/Examples/Resources/OpticalDiskDriveLetter/2-OpticalDiskDriveLetter_RemoveDriveLetter.ps1 @@ -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' + } + } +} diff --git a/Modules/StorageDsc/Examples/Resources/OpticalDiskDriveLetter/3-OpticalDiskDriveLetter_SetDriveLetterMulti.ps1 b/Examples/Resources/OpticalDiskDriveLetter/3-OpticalDiskDriveLetter_SetDriveLetterMulti.ps1 similarity index 59% rename from Modules/StorageDsc/Examples/Resources/OpticalDiskDriveLetter/3-OpticalDiskDriveLetter_SetDriveLetterMulti.ps1 rename to Examples/Resources/OpticalDiskDriveLetter/3-OpticalDiskDriveLetter_SetDriveLetterMulti.ps1 index df6485ac..97d4b2f9 100644 --- a/Modules/StorageDsc/Examples/Resources/OpticalDiskDriveLetter/3-OpticalDiskDriveLetter_SetDriveLetterMulti.ps1 +++ b/Examples/Resources/OpticalDiskDriveLetter/3-OpticalDiskDriveLetter_SetDriveLetterMulti.ps1 @@ -1,12 +1,31 @@ +<#PSScriptInfo +.VERSION 1.0.0 +.GUID ddd99b70-781a-4807-9b40-8281d92ed67e +.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 set the drive letter of the first optical disk drive in the system to 'Y'. It will set the drive letter of the second optical disk drive to 'Z'. It will remove the drive letter from the third optical disk drive in the system. #> -Configuration Example +Configuration OpticalDiskDriveLetter_SetDriveLetterMulti { Import-DSCResource -ModuleName StorageDsc diff --git a/Modules/StorageDsc/Examples/Resources/WaitForDisk/1-WaitForDisk_InitializeDataDisk.ps1 b/Examples/Resources/WaitForDisk/1-WaitForDisk_InitializeDataDisk.ps1 similarity index 64% rename from Modules/StorageDsc/Examples/Resources/WaitForDisk/1-WaitForDisk_InitializeDataDisk.ps1 rename to Examples/Resources/WaitForDisk/1-WaitForDisk_InitializeDataDisk.ps1 index 9f67239d..8e414253 100644 --- a/Modules/StorageDsc/Examples/Resources/WaitForDisk/1-WaitForDisk_InitializeDataDisk.ps1 +++ b/Examples/Resources/WaitForDisk/1-WaitForDisk_InitializeDataDisk.ps1 @@ -1,10 +1,29 @@ +<#PSScriptInfo +.VERSION 1.0.0 +.GUID 4b63a38d-3996-41e3-886a-b4271c6ce367 +.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 WaitForDisk_InitializeDataDisk { Import-DSCResource -ModuleName StorageDsc diff --git a/Modules/StorageDsc/Examples/Resources/WaitForDisk/2-WaitForDisk_InitializeDataDiskWithAccessPath.ps1 b/Examples/Resources/WaitForDisk/2-WaitForDisk_InitializeDataDiskWithAccessPath.ps1 similarity index 61% rename from Modules/StorageDsc/Examples/Resources/WaitForDisk/2-WaitForDisk_InitializeDataDiskWithAccessPath.ps1 rename to Examples/Resources/WaitForDisk/2-WaitForDisk_InitializeDataDiskWithAccessPath.ps1 index 30acce6c..6e544549 100644 --- a/Modules/StorageDsc/Examples/Resources/WaitForDisk/2-WaitForDisk_InitializeDataDiskWithAccessPath.ps1 +++ b/Examples/Resources/WaitForDisk/2-WaitForDisk_InitializeDataDiskWithAccessPath.ps1 @@ -1,10 +1,29 @@ +<#PSScriptInfo +.VERSION 1.0.0 +.GUID fd2dee3d-0f92-4f7c-8ee3-5d94bd0db380 +.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 WaitForDisk_InitializeDataDiskWithAccessPath { Import-DSCResource -ModuleName StorageDsc diff --git a/Modules/StorageDsc/Examples/Resources/WaitForDisk/4-WaitForDisk_InitializeDataDiskWithAccessPathUsingUniqueId.ps1 b/Examples/Resources/WaitForDisk/3-WaitForDisk_InitializeDataDiskWithAccessPathUsingUniqueId.ps1 similarity index 66% rename from Modules/StorageDsc/Examples/Resources/WaitForDisk/4-WaitForDisk_InitializeDataDiskWithAccessPathUsingUniqueId.ps1 rename to Examples/Resources/WaitForDisk/3-WaitForDisk_InitializeDataDiskWithAccessPathUsingUniqueId.ps1 index d09d84a0..d27df4c4 100644 --- a/Modules/StorageDsc/Examples/Resources/WaitForDisk/4-WaitForDisk_InitializeDataDiskWithAccessPathUsingUniqueId.ps1 +++ b/Examples/Resources/WaitForDisk/3-WaitForDisk_InitializeDataDiskWithAccessPathUsingUniqueId.ps1 @@ -1,10 +1,29 @@ +<#PSScriptInfo +.VERSION 1.0.0 +.GUID 774651be-68f5-4e92-a703-c3a2f7a90631 +.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 with Unique Id '5E1E50A401000000001517FFFF0AEB84' 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 WaitForDisk_InitializeDataDiskWithAccessPathUsingUniqueId { Import-DSCResource -ModuleName StorageDsc diff --git a/Examples/Resources/WaitForVolume/1-WaitForVolume_VHD.ps1 b/Examples/Resources/WaitForVolume/1-WaitForVolume_VHD.ps1 new file mode 100644 index 00000000..c08cfb1e --- /dev/null +++ b/Examples/Resources/WaitForVolume/1-WaitForVolume_VHD.ps1 @@ -0,0 +1,40 @@ +<#PSScriptInfo +.VERSION 1.0.0 +.GUID 94eed86a-2961-4a11-8ef7-0a261d547019 +.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 WaitForVolume_VHD +{ + Import-DscResource -ModuleName StorageDsc + + MountImage MountVHD + { + ImagePath = 'd:\Data\Disk1.vhd' + DriveLetter = 'V' + } + + WaitForVolume WaitForVHD + { + DriveLetter = 'V' + RetryIntervalSec = 5 + RetryCount = 10 + } +} diff --git a/Examples/Resources/WaitForVolume/2-WaitForVolume_ISO.ps1 b/Examples/Resources/WaitForVolume/2-WaitForVolume_ISO.ps1 new file mode 100644 index 00000000..e6f4eb98 --- /dev/null +++ b/Examples/Resources/WaitForVolume/2-WaitForVolume_ISO.ps1 @@ -0,0 +1,40 @@ +<#PSScriptInfo +.VERSION 1.0.0 +.GUID b91d822b-ea2e-497e-8056-7774f16565db +.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 WaitForVolume_ISO +{ + Import-DscResource -ModuleName StorageDsc + + MountImage ISO + { + ImagePath = 'c:\Sources\SQL.iso' + DriveLetter = 'S' + } + + WaitForVolume WaitForISO + { + DriveLetter = 'S' + RetryIntervalSec = 5 + RetryCount = 10 + } +} diff --git a/Modules/StorageDsc/Modules/StorageDsc.Common/StorageDsc.Common.psm1 b/Modules/StorageDsc.Common/StorageDsc.Common.psm1 similarity index 100% rename from Modules/StorageDsc/Modules/StorageDsc.Common/StorageDsc.Common.psm1 rename to Modules/StorageDsc.Common/StorageDsc.Common.psm1 diff --git a/Modules/StorageDsc/Modules/StorageDsc.Common/en-us/StorageDsc.Common.strings.psd1 b/Modules/StorageDsc.Common/en-us/StorageDsc.Common.strings.psd1 similarity index 100% rename from Modules/StorageDsc/Modules/StorageDsc.Common/en-us/StorageDsc.Common.strings.psd1 rename to Modules/StorageDsc.Common/en-us/StorageDsc.Common.strings.psd1 diff --git a/Modules/StorageDsc/Modules/StorageDsc.ResourceHelper/StorageDsc.ResourceHelper.psm1 b/Modules/StorageDsc.ResourceHelper/StorageDsc.ResourceHelper.psm1 similarity index 100% rename from Modules/StorageDsc/Modules/StorageDsc.ResourceHelper/StorageDsc.ResourceHelper.psm1 rename to Modules/StorageDsc.ResourceHelper/StorageDsc.ResourceHelper.psm1 diff --git a/Modules/StorageDsc/Examples/Resources/MountImage/1-MountImage_DismountISO.ps1 b/Modules/StorageDsc/Examples/Resources/MountImage/1-MountImage_DismountISO.ps1 deleted file mode 100644 index a033c254..00000000 --- a/Modules/StorageDsc/Examples/Resources/MountImage/1-MountImage_DismountISO.ps1 +++ /dev/null @@ -1,15 +0,0 @@ -<# - .EXAMPLE - This configuration will unmount an ISO file that is mounted in S:. -#> -configuration Example -{ - Import-DscResource -ModuleName StorageDsc - - MountImage ISO - { - ImagePath = 'c:\Sources\SQL.iso' - DriveLetter = 'S' - Ensure = 'Absent' - } -} diff --git a/Modules/StorageDsc/Examples/Resources/MountImage/2-MountImage_MountISO.ps1 b/Modules/StorageDsc/Examples/Resources/MountImage/2-MountImage_MountISO.ps1 deleted file mode 100644 index d264d9eb..00000000 --- a/Modules/StorageDsc/Examples/Resources/MountImage/2-MountImage_MountISO.ps1 +++ /dev/null @@ -1,21 +0,0 @@ -<# - .EXAMPLE - This configuration will mount an ISO file as drive S:. -#> -configuration Example -{ - Import-DscResource -ModuleName StorageDsc - - MountImage ISO - { - ImagePath = 'c:\Sources\SQL.iso' - DriveLetter = 'S' - } - - WaitForVolume WaitForISO - { - DriveLetter = 'S' - RetryIntervalSec = 5 - RetryCount = 10 - } -} diff --git a/Modules/StorageDsc/Examples/Resources/MountImage/3-MountImage_MountVHD.ps1 b/Modules/StorageDsc/Examples/Resources/MountImage/3-MountImage_MountVHD.ps1 deleted file mode 100644 index 2a757846..00000000 --- a/Modules/StorageDsc/Examples/Resources/MountImage/3-MountImage_MountVHD.ps1 +++ /dev/null @@ -1,21 +0,0 @@ -<# - .EXAMPLE - This configuration will mount a VHD file and wait for it to become available. -#> -configuration Example -{ - Import-DscResource -ModuleName StorageDsc - - MountImage MountVHD - { - ImagePath = 'd:\Data\Disk1.vhd' - DriveLetter = 'V' - } - - WaitForVolume WaitForVHD - { - DriveLetter = 'V' - RetryIntervalSec = 5 - RetryCount = 10 - } -} diff --git a/Modules/StorageDsc/Examples/Resources/OpticalDiskDriveLetter/1-OpticalDiskDriveLetter_SetDriveLetter.ps1 b/Modules/StorageDsc/Examples/Resources/OpticalDiskDriveLetter/1-OpticalDiskDriveLetter_SetDriveLetter.ps1 deleted file mode 100644 index 8564a3c6..00000000 --- a/Modules/StorageDsc/Examples/Resources/OpticalDiskDriveLetter/1-OpticalDiskDriveLetter_SetDriveLetter.ps1 +++ /dev/null @@ -1,18 +0,0 @@ -<# - .EXAMPLE - This configuration will set the drive letter of the first - optical disk drive in the system to 'Z'. -#> -Configuration Example -{ - Import-DSCResource -ModuleName StorageDsc - - Node localhost - { - OpticalDiskDriveLetter SetFirstOpticalDiskDriveLetterToZ - { - DiskId = 1 - DriveLetter = 'Z' - } - } -} diff --git a/Modules/StorageDsc/Examples/Resources/OpticalDiskDriveLetter/2-OpticalDiskDriveLetter_RemoveDriveLetter.ps1 b/Modules/StorageDsc/Examples/Resources/OpticalDiskDriveLetter/2-OpticalDiskDriveLetter_RemoveDriveLetter.ps1 deleted file mode 100644 index 6b9bf294..00000000 --- a/Modules/StorageDsc/Examples/Resources/OpticalDiskDriveLetter/2-OpticalDiskDriveLetter_RemoveDriveLetter.ps1 +++ /dev/null @@ -1,19 +0,0 @@ -<# - .EXAMPLE - This configuration will remove the drive letter of the first - optical disk drive. -#> -Configuration Example -{ - Import-DSCResource -ModuleName StorageDsc - - Node localhost - { - OpticalDiskDriveLetter RemoveFirstOpticalDiskDriveLetter - { - DiskId = 1 - DriveLetter = 'X' # This value is ignored - Ensure = 'Absent' - } - } -} diff --git a/Modules/StorageDsc/Examples/Resources/WaitForDisk/3-WaitForDisk_InitializeDataDiskWithAccessPath.ps1 b/Modules/StorageDsc/Examples/Resources/WaitForDisk/3-WaitForDisk_InitializeDataDiskWithAccessPath.ps1 deleted file mode 100644 index 30acce6c..00000000 --- a/Modules/StorageDsc/Examples/Resources/WaitForDisk/3-WaitForDisk_InitializeDataDiskWithAccessPath.ps1 +++ /dev/null @@ -1,37 +0,0 @@ -<# - .EXAMPLE - 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 -{ - Import-DSCResource -ModuleName StorageDsc - - Node localhost - { - WaitForDisk Disk2 - { - DiskId = 2 - RetryIntervalSec = 60 - RetryCount = 60 - } - - DiskAccessPath DataVolume - { - DiskId = 2 - AccessPath = 'c:\SQLData' - Size = 10GB - FSLabel = 'SQLData1' - DependsOn = '[WaitForDisk]Disk2' - } - - DiskAccessPath LogVolume - { - DiskId = 2 - AccessPath = 'c:\SQLLog' - FSLabel = 'SQLLog1' - DependsOn = '[DiskAccessPath]DataVolume' - } - } -} diff --git a/Modules/StorageDsc/Examples/Resources/WaitForVolume/1-WaitForVolume_VHD.ps1 b/Modules/StorageDsc/Examples/Resources/WaitForVolume/1-WaitForVolume_VHD.ps1 deleted file mode 100644 index 2a757846..00000000 --- a/Modules/StorageDsc/Examples/Resources/WaitForVolume/1-WaitForVolume_VHD.ps1 +++ /dev/null @@ -1,21 +0,0 @@ -<# - .EXAMPLE - This configuration will mount a VHD file and wait for it to become available. -#> -configuration Example -{ - Import-DscResource -ModuleName StorageDsc - - MountImage MountVHD - { - ImagePath = 'd:\Data\Disk1.vhd' - DriveLetter = 'V' - } - - WaitForVolume WaitForVHD - { - DriveLetter = 'V' - RetryIntervalSec = 5 - RetryCount = 10 - } -} diff --git a/Modules/StorageDsc/Examples/Resources/WaitForVolume/2-WaitForVolume_ISO.ps1 b/Modules/StorageDsc/Examples/Resources/WaitForVolume/2-WaitForVolume_ISO.ps1 deleted file mode 100644 index d264d9eb..00000000 --- a/Modules/StorageDsc/Examples/Resources/WaitForVolume/2-WaitForVolume_ISO.ps1 +++ /dev/null @@ -1,21 +0,0 @@ -<# - .EXAMPLE - This configuration will mount an ISO file as drive S:. -#> -configuration Example -{ - Import-DscResource -ModuleName StorageDsc - - MountImage ISO - { - ImagePath = 'c:\Sources\SQL.iso' - DriveLetter = 'S' - } - - WaitForVolume WaitForISO - { - DriveLetter = 'S' - RetryIntervalSec = 5 - RetryCount = 10 - } -} diff --git a/README.md b/README.md index b85c79d6..128be31f 100644 --- a/README.md +++ b/README.md @@ -12,10 +12,7 @@ The **StorageDsc** module contains the following resources: - **WaitForDisk** wait for a disk to become available. - **WaitForVolume** wait for a drive to be mounted and become available. -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 [opencode@microsoft.com](mailto:opencode@microsoft.com) with any -additional questions or comments. +This project has adopted [this code of conduct](CODE_OF_CONDUCT.md). ## Documentation and Examples diff --git a/Modules/StorageDsc/StorageDsc.psd1 b/StorageDsc.psd1 similarity index 86% rename from Modules/StorageDsc/StorageDsc.psd1 rename to StorageDsc.psd1 index 481c86eb..3f613390 100644 --- a/Modules/StorageDsc/StorageDsc.psd1 +++ b/StorageDsc.psd1 @@ -10,7 +10,7 @@ # RootModule = '' # Version number of this module. -moduleVersion = '4.3.0.0' +moduleVersion = '4.4.0.0' # ID used to uniquely identify this module GUID = '00d73ca1-58b5-46b7-ac1a-5bfcf5814faf' @@ -102,9 +102,13 @@ PrivateData = @{ # IconUri = '' # ReleaseNotes of this module - ReleaseNotes = '- WaitForDisk: - - Added readonly-property isAvailable which shows the current state - of the disk as a boolean - fixes [Issue 158](https://github.com/PowerShell/StorageDsc/issues/158). + ReleaseNotes = '- 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. +- Explicitly removed extra hidden files from release package ' @@ -132,3 +136,4 @@ PrivateData = @{ + diff --git a/Tests/Integration/MSFTDSC_Disk.Integration.Tests.ps1 b/Tests/Integration/MSFTDSC_Disk.Integration.Tests.ps1 index e5a268b9..7ef0567c 100644 --- a/Tests/Integration/MSFTDSC_Disk.Integration.Tests.ps1 +++ b/Tests/Integration/MSFTDSC_Disk.Integration.Tests.ps1 @@ -5,14 +5,14 @@ Import-Module -Name (Join-Path -Path (Join-Path -Path (Split-Path $PSScriptRoot #region HEADER # Integration Test Template Version: 1.1.1 -[string] $script:moduleRoot = Join-Path -Path $(Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path))) -ChildPath 'Modules\StorageDsc' +[System.String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests'))) -or ` (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1'))) ) { & git @('clone', 'https://github.com/PowerShell/DscResource.Tests.git', (Join-Path -Path $script:moduleRoot -ChildPath '\DSCResource.Tests\')) } -Import-Module (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1') -Force +Import-Module -Name (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1') -Force $TestEnvironment = Initialize-TestEnvironment ` -DSCModuleName $script:DSCModuleName ` -DSCResourceName $script:DSCResourceName ` diff --git a/Tests/Integration/MSFT_DiskAccessPath.Integration.Tests.ps1 b/Tests/Integration/MSFT_DiskAccessPath.Integration.Tests.ps1 index d3a602d8..da5ccff5 100644 --- a/Tests/Integration/MSFT_DiskAccessPath.Integration.Tests.ps1 +++ b/Tests/Integration/MSFT_DiskAccessPath.Integration.Tests.ps1 @@ -5,14 +5,14 @@ Import-Module -Name (Join-Path -Path (Join-Path -Path (Split-Path $PSScriptRoot #region HEADER # Integration Test Template Version: 1.1.1 -[string] $script:moduleRoot = Join-Path -Path $(Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path))) -ChildPath 'Modules\StorageDsc' +[System.String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests'))) -or ` (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1'))) ) { & git @('clone', 'https://github.com/PowerShell/DscResource.Tests.git', (Join-Path -Path $script:moduleRoot -ChildPath '\DSCResource.Tests\')) } -Import-Module (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1') -Force +Import-Module -Name (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1') -Force $TestEnvironment = Initialize-TestEnvironment ` -DSCModuleName $script:DSCModuleName ` -DSCResourceName $script:DSCResourceName ` diff --git a/Tests/Integration/MSFT_MountImage_ISO.Integration.Tests.ps1 b/Tests/Integration/MSFT_MountImage_ISO.Integration.Tests.ps1 index 34377bb5..b625b3aa 100644 --- a/Tests/Integration/MSFT_MountImage_ISO.Integration.Tests.ps1 +++ b/Tests/Integration/MSFT_MountImage_ISO.Integration.Tests.ps1 @@ -11,14 +11,14 @@ Import-Module -Name (Join-Path -Path (Join-Path -Path (Split-Path $PSScriptRoot #region HEADER # Integration Test Template Version: 1.1.1 -[string] $script:moduleRoot = Join-Path -Path $(Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path))) -ChildPath 'Modules\StorageDsc' +[System.String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests'))) -or ` (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1'))) ) { & git @('clone','https://github.com/PowerShell/DscResource.Tests.git',(Join-Path -Path $script:moduleRoot -ChildPath '\DSCResource.Tests\')) } -Import-Module (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1') -Force +Import-Module -Name (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1') -Force $TestEnvironment = Initialize-TestEnvironment ` -DSCModuleName $script:DSCModuleName ` -DSCResourceName $script:DSCResourceName ` diff --git a/Tests/Integration/MSFT_MountImage_VHD.Integration.Tests.ps1 b/Tests/Integration/MSFT_MountImage_VHD.Integration.Tests.ps1 index 965a8008..b0def8fa 100644 --- a/Tests/Integration/MSFT_MountImage_VHD.Integration.Tests.ps1 +++ b/Tests/Integration/MSFT_MountImage_VHD.Integration.Tests.ps1 @@ -5,14 +5,14 @@ Import-Module -Name (Join-Path -Path (Join-Path -Path (Split-Path $PSScriptRoot #region HEADER # Integration Test Template Version: 1.1.1 -[string] $script:moduleRoot = Join-Path -Path $(Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path))) -ChildPath 'Modules\StorageDsc' +[System.String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests'))) -or ` (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1'))) ) { & git @('clone','https://github.com/PowerShell/DscResource.Tests.git',(Join-Path -Path $script:moduleRoot -ChildPath '\DSCResource.Tests\')) } -Import-Module (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1') -Force +Import-Module -Name (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1') -Force $TestEnvironment = Initialize-TestEnvironment ` -DSCModuleName $script:DSCModuleName ` -DSCResourceName $script:DSCResourceName ` diff --git a/Tests/Integration/MSFT_OpticalDiskDriveLetter.Integration.Tests.ps1 b/Tests/Integration/MSFT_OpticalDiskDriveLetter.Integration.Tests.ps1 index e95441ac..e0d7157d 100644 --- a/Tests/Integration/MSFT_OpticalDiskDriveLetter.Integration.Tests.ps1 +++ b/Tests/Integration/MSFT_OpticalDiskDriveLetter.Integration.Tests.ps1 @@ -5,14 +5,14 @@ Import-Module -Name (Join-Path -Path (Join-Path -Path (Split-Path $PSScriptRoot #region HEADER # Integration Test Template Version: 1.1.1 -[string] $script:moduleRoot = Join-Path -Path $(Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path))) -ChildPath 'Modules\StorageDsc' +[System.String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests'))) -or ` (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1'))) ) { & git @('clone', 'https://github.com/PowerShell/DscResource.Tests.git', (Join-Path -Path $script:moduleRoot -ChildPath '\DSCResource.Tests\')) } -Import-Module (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1') -Force +Import-Module -Name (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1') -Force $TestEnvironment = Initialize-TestEnvironment ` -DSCModuleName $script:DSCModuleName ` -DSCResourceName $script:DSCResourceName ` diff --git a/Tests/Integration/MSFT_WaitForDisk.Integration.Tests.ps1 b/Tests/Integration/MSFT_WaitForDisk.Integration.Tests.ps1 index 439cd972..f3290cf9 100644 --- a/Tests/Integration/MSFT_WaitForDisk.Integration.Tests.ps1 +++ b/Tests/Integration/MSFT_WaitForDisk.Integration.Tests.ps1 @@ -5,14 +5,14 @@ Import-Module -Name (Join-Path -Path (Join-Path -Path (Split-Path $PSScriptRoot #region HEADER # Integration Test Template Version: 1.1.1 -[string] $script:moduleRoot = Join-Path -Path $(Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path))) -ChildPath 'Modules\StorageDsc' +[System.String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests'))) -or ` (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1'))) ) { & git @('clone','https://github.com/PowerShell/DscResource.Tests.git',(Join-Path -Path $script:moduleRoot -ChildPath '\DSCResource.Tests\')) } -Import-Module (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1') -Force +Import-Module -Name (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1') -Force $TestEnvironment = Initialize-TestEnvironment ` -DSCModuleName $script:DSCModuleName ` -DSCResourceName $script:DSCResourceName ` diff --git a/Tests/Integration/MSFT_WaitForVolume.Integration.Tests.ps1 b/Tests/Integration/MSFT_WaitForVolume.Integration.Tests.ps1 index 23138bb1..82ba097b 100644 --- a/Tests/Integration/MSFT_WaitForVolume.Integration.Tests.ps1 +++ b/Tests/Integration/MSFT_WaitForVolume.Integration.Tests.ps1 @@ -5,14 +5,14 @@ Import-Module -Name (Join-Path -Path (Join-Path -Path (Split-Path $PSScriptRoot #region HEADER # Integration Test Template Version: 1.1.1 -[string] $script:moduleRoot = Join-Path -Path $(Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path))) -ChildPath 'Modules\StorageDsc' +[System.String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests'))) -or ` (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1'))) ) { & git @('clone','https://github.com/PowerShell/DscResource.Tests.git',(Join-Path -Path $script:moduleRoot -ChildPath '\DSCResource.Tests\')) } -Import-Module (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1') -Force +Import-Module -Name (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1') -Force $TestEnvironment = Initialize-TestEnvironment ` -DSCModuleName $script:DSCModuleName ` -DSCResourceName $script:DSCResourceName ` diff --git a/Tests/Integration/ModuleConflict.Tests.ps1 b/Tests/Integration/ModuleConflict.Tests.ps1 index f9e0a87a..acdc86f3 100644 --- a/Tests/Integration/ModuleConflict.Tests.ps1 +++ b/Tests/Integration/ModuleConflict.Tests.ps1 @@ -3,11 +3,11 @@ $script:DSCModuleName = 'StorageDsc' These integration tests ensure that exported cmdlets names do not conflict with any other names that are exposed by other common resource kit modules. #> -$script:ModulesToTest = @( 'xNetworking','xComputerManagement','xDFS' ) +$script:ModulesToTest = @( 'NetworkingDsc','ComputerManagementDsc','DFSDsc' ) #region HEADER # Integration Test Template Version: 1.1.0 -[string] $script:moduleRoot = Join-Path -Path $(Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path))) -ChildPath 'Modules\StorageDsc' +[System.String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests'))) -or ` (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1'))) ) @@ -15,8 +15,8 @@ if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCR & git @('clone','https://github.com/PowerShell/DscResource.Tests.git',(Join-Path -Path $script:moduleRoot -ChildPath '\DSCResource.Tests\')) } -Import-Module (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1') -Force -Import-Module (Join-Path -Path $script:moduleRoot -ChildPath "$($script:DSCModuleName).psd1") -Force +Import-Module -Name (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1') -Force +Import-Module -Name (Join-Path -Path $script:moduleRoot -ChildPath "$($script:DSCModuleName).psd1") -Force $TestEnvironment = Initialize-TestEnvironment ` -DSCModuleName $script:DSCModuleName ` -DSCResourceName 'All' ` diff --git a/Tests/TestHarness.psm1 b/Tests/TestHarness.psm1 deleted file mode 100644 index e01d11ad..00000000 --- a/Tests/TestHarness.psm1 +++ /dev/null @@ -1,68 +0,0 @@ -function Invoke-TestHarness -{ - [CmdletBinding()] - param - ( - [System.String] - $TestResultsFile, - - [System.String] - $DscTestsPath - ) - - Write-Verbose -Message 'Commencing all StorageDsc tests' - - $repoDir = Join-Path -Path $PSScriptRoot -ChildPath "..\" -Resolve - - $testCoverageFiles = @() - Get-ChildItem -Path "$repoDir\modules\StorageDsc\DSCResources\**\*.psm1" -Recurse | ForEach-Object { - if ($_.FullName -notlike '*\DSCResource.Tests\*') - { - $testCoverageFiles += $_.FullName - } - } - - $testResultSettings = @{ } - if ([String]::IsNullOrEmpty($TestResultsFile) -eq $false) - { - $testResultSettings.Add('OutputFormat', 'NUnitXml' ) - $testResultSettings.Add('OutputFile', $TestResultsFile) - } - - Import-Module -Name "$repoDir\modules\StorageDsc\StorageDsc.psd1" - $testsToRun = @() - - # Run Unit Tests - $unitTestsPath = Join-Path -Path $repoDir -ChildPath 'Tests\Unit' - $testsToRun += @( (Get-ChildItem -Path $unitTestsPath).FullName ) - - # Integration Tests - $integrationTestsPath = Join-Path -Path $repoDir -ChildPath 'Tests\Integration' - $testsToRun += @( (Get-ChildItem -Path $integrationTestsPath -Filter '*.Tests.ps1').FullName ) - - # DSC Common Tests - if ($PSBoundParameters.ContainsKey('DscTestsPath') -eq $true) - { - $getChildItemParameters = @{ - Path = $DscTestsPath - Recurse = $true - Filter = '*.Tests.ps1' - } - - # Get all tests '*.Tests.ps1'. - $commonTestFiles = Get-ChildItem @getChildItemParameters - - # Remove DscResource.Tests unit and integration tests. - $commonTestFiles = $commonTestFiles | Where-Object -FilterScript { - $_.FullName -notmatch 'DSCResource.Tests\\Tests' - } - - $testsToRun += @( $commonTestFiles.FullName ) - } - - $results = Invoke-Pester -Script $testsToRun ` - -CodeCoverage $testCoverageFiles ` - -PassThru @testResultSettings - - return $results -} diff --git a/Tests/TestHelpers/CommonTestHelper.psm1 b/Tests/TestHelpers/CommonTestHelper.psm1 index 840f791f..4afd62a3 100644 --- a/Tests/TestHelpers/CommonTestHelper.psm1 +++ b/Tests/TestHelpers/CommonTestHelper.psm1 @@ -1,4 +1,4 @@ -<# +<# .SYNOPSIS Returns an invalid argument exception object diff --git a/Tests/Unit/MSFTDSC_Disk.Tests.ps1 b/Tests/Unit/MSFTDSC_Disk.Tests.ps1 index 778ee63e..a96b9bea 100644 --- a/Tests/Unit/MSFTDSC_Disk.Tests.ps1 +++ b/Tests/Unit/MSFTDSC_Disk.Tests.ps1 @@ -5,14 +5,14 @@ Import-Module -Name (Join-Path -Path (Join-Path -Path (Split-Path $PSScriptRoot #region HEADER # Unit Test Template Version: 1.1.0 -[string] $script:moduleRoot = Join-Path -Path $(Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path))) -ChildPath 'Modules\StorageDsc' +[System.String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests'))) -or ` (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1'))) ) { & git @('clone', 'https://github.com/PowerShell/DscResource.Tests.git', (Join-Path -Path $script:moduleRoot -ChildPath '\DSCResource.Tests\')) } -Import-Module (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1') -Force +Import-Module -Name (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1') -Force $TestEnvironment = Initialize-TestEnvironment ` -DSCModuleName $script:DSCModuleName ` -DSCResourceName $script:DSCResourceName ` diff --git a/Tests/Unit/MSFT_DiskAccessPath.Tests.ps1 b/Tests/Unit/MSFT_DiskAccessPath.Tests.ps1 index c82ce210..c9e0edac 100644 --- a/Tests/Unit/MSFT_DiskAccessPath.Tests.ps1 +++ b/Tests/Unit/MSFT_DiskAccessPath.Tests.ps1 @@ -5,14 +5,14 @@ Import-Module -Name (Join-Path -Path (Join-Path -Path (Split-Path $PSScriptRoot #region HEADER # Unit Test Template Version: 1.1.0 -[string] $script:moduleRoot = Join-Path -Path $(Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path))) -ChildPath 'Modules\StorageDsc' +[System.String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests'))) -or ` (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1'))) ) { & git @('clone', 'https://github.com/PowerShell/DscResource.Tests.git', (Join-Path -Path $script:moduleRoot -ChildPath '\DSCResource.Tests\')) } -Import-Module (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1') -Force +Import-Module -Name (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1') -Force $TestEnvironment = Initialize-TestEnvironment ` -DSCModuleName $script:DSCModuleName ` -DSCResourceName $script:DSCResourceName ` diff --git a/Tests/Unit/MSFT_MountImage.Tests.ps1 b/Tests/Unit/MSFT_MountImage.Tests.ps1 index bb984550..391502d9 100644 --- a/Tests/Unit/MSFT_MountImage.Tests.ps1 +++ b/Tests/Unit/MSFT_MountImage.Tests.ps1 @@ -5,14 +5,14 @@ Import-Module -Name (Join-Path -Path (Join-Path -Path (Split-Path $PSScriptRoot #region HEADER # Unit Test Template Version: 1.1.0 -[string] $script:moduleRoot = Join-Path -Path $(Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path))) -ChildPath 'Modules\StorageDsc' +[System.String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests'))) -or ` (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1'))) ) { & git @('clone','https://github.com/PowerShell/DscResource.Tests.git',(Join-Path -Path $script:moduleRoot -ChildPath '\DSCResource.Tests\')) } -Import-Module (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1') -Force +Import-Module -Name (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1') -Force $TestEnvironment = Initialize-TestEnvironment ` -DSCModuleName $script:DSCModuleName ` -DSCResourceName $script:DSCResourceName ` diff --git a/Tests/Unit/MSFT_OpticalDiskDriveLetter.Tests.ps1 b/Tests/Unit/MSFT_OpticalDiskDriveLetter.Tests.ps1 index bdc88f8f..e0b475c4 100644 --- a/Tests/Unit/MSFT_OpticalDiskDriveLetter.Tests.ps1 +++ b/Tests/Unit/MSFT_OpticalDiskDriveLetter.Tests.ps1 @@ -5,14 +5,14 @@ Import-Module -Name (Join-Path -Path (Join-Path -Path (Split-Path $PSScriptRoot #region HEADER # Unit Test Template Version: 1.1.0 -[string] $script:moduleRoot = Join-Path -Path $(Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path))) -ChildPath 'Modules\StorageDsc' +[System.String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests'))) -or ` (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1'))) ) { & git @('clone', 'https://github.com/PowerShell/DscResource.Tests.git', (Join-Path -Path $script:moduleRoot -ChildPath '\DSCResource.Tests\')) } -Import-Module (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1') -Force +Import-Module -Name (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1') -Force $TestEnvironment = Initialize-TestEnvironment ` -DSCModuleName $script:DSCModuleName ` -DSCResourceName $script:DSCResourceName ` diff --git a/Tests/Unit/MSFT_WaitForDisk.Tests.ps1 b/Tests/Unit/MSFT_WaitForDisk.Tests.ps1 index 3015f0c0..4c96a97e 100644 --- a/Tests/Unit/MSFT_WaitForDisk.Tests.ps1 +++ b/Tests/Unit/MSFT_WaitForDisk.Tests.ps1 @@ -5,14 +5,14 @@ Import-Module -Name (Join-Path -Path (Join-Path -Path (Split-Path $PSScriptRoot #region HEADER # Unit Test Template Version: 1.1.0 -[string] $script:moduleRoot = Join-Path -Path $(Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path))) -ChildPath 'Modules\StorageDsc' +[System.String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests'))) -or ` (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1'))) ) { & git @('clone', 'https://github.com/PowerShell/DscResource.Tests.git', (Join-Path -Path $script:moduleRoot -ChildPath '\DSCResource.Tests\')) } -Import-Module (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1') -Force +Import-Module -Name (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1') -Force $TestEnvironment = Initialize-TestEnvironment ` -DSCModuleName $script:DSCModuleName ` -DSCResourceName $script:DSCResourceName ` diff --git a/Tests/Unit/MSFT_WaitForVolume.Tests.ps1 b/Tests/Unit/MSFT_WaitForVolume.Tests.ps1 index feb09c9e..20e391c3 100644 --- a/Tests/Unit/MSFT_WaitForVolume.Tests.ps1 +++ b/Tests/Unit/MSFT_WaitForVolume.Tests.ps1 @@ -5,14 +5,14 @@ Import-Module -Name (Join-Path -Path (Join-Path -Path (Split-Path $PSScriptRoot #region HEADER # Unit Test Template Version: 1.1.0 -[string] $script:moduleRoot = Join-Path -Path $(Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path))) -ChildPath 'Modules\StorageDsc' +[System.String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests'))) -or ` (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1'))) ) { & git @('clone','https://github.com/PowerShell/DscResource.Tests.git',(Join-Path -Path $script:moduleRoot -ChildPath '\DSCResource.Tests\')) } -Import-Module (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1') -Force +Import-Module -Name (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1') -Force $TestEnvironment = Initialize-TestEnvironment ` -DSCModuleName $script:DSCModuleName ` -DSCResourceName $script:DSCResourceName ` diff --git a/Tests/Unit/StorageDsc.Common.Tests.ps1 b/Tests/Unit/StorageDsc.Common.Tests.ps1 index 4ab73cab..ed65b750 100644 --- a/Tests/Unit/StorageDsc.Common.Tests.ps1 +++ b/Tests/Unit/StorageDsc.Common.Tests.ps1 @@ -4,15 +4,15 @@ Import-Module -Name (Join-Path -Path (Join-Path -Path (Split-Path $PSScriptRoot #region HEADER # Unit Test Template Version: 1.1.0 -[string] $script:moduleRoot = Join-Path -Path $(Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path))) -ChildPath 'Modules\StorageDsc' +[System.String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests'))) -or ` (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1'))) ) { & git @('clone', 'https://github.com/PowerShell/DscResource.Tests.git', (Join-Path -Path $script:moduleRoot -ChildPath '\DSCResource.Tests\')) } -Import-Module (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1') -Force -Import-Module (Join-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath (Join-Path -Path 'Modules' -ChildPath $script:ModuleName)) -ChildPath "$script:ModuleName.psm1") -Force +Import-Module -Name (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1') -Force +Import-Module -Name (Join-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath (Join-Path -Path 'Modules' -ChildPath $script:ModuleName)) -ChildPath "$script:ModuleName.psm1") -Force #endregion HEADER # Begin Testing diff --git a/appveyor.yml b/appveyor.yml index e5fb85a9..146e15ea 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -7,9 +7,8 @@ install: - ps: | $moduleName = 'StorageDsc' - $mainModuleFolder = "Modules\$moduleName" Import-Module "$env:APPVEYOR_BUILD_FOLDER\DscResource.Tests\AppVeyor.psm1" - Invoke-AppveyorInstallTask -PesterMaximumVersion 4.0.8 + Invoke-AppveyorInstallTask #---------------------------------# # build configuration # @@ -24,9 +23,9 @@ build: false test_script: - ps: | Invoke-AppveyorTestScriptTask ` - -Type 'Harness' ` - -MainModulePath $mainModuleFolder ` - -CodeCovIo + -CodeCoverage ` + -CodeCovIo ` + -ExcludeTag @() #---------------------------------# # deployment configuration # @@ -37,5 +36,7 @@ deploy_script: - ps: | Invoke-AppveyorAfterTestTask ` -Type 'Wiki' ` - -MainModulePath $mainModuleFolder ` -ResourceModuleName $moduleName + + Invoke-AppVeyorDeployTask ` + -OptIn @()