├── Build.PSake.ps1 ├── CONTRIBUTING.md ├── ChangeLog.md ├── Config ├── HostDefaults.json ├── LabClient.cer ├── LabClient.pfx ├── LabRoot.cer ├── LegacyMedia │ ├── 2012R2_x64_Datacenter_Core_EN_Eval.json │ ├── 2012R2_x64_Datacenter_Core_EN_V5_1_Eval.json │ ├── 2012R2_x64_Datacenter_Core_EN_V5_Eval.json │ ├── 2012R2_x64_Datacenter_EN_Eval.json │ ├── 2012R2_x64_Datacenter_EN_V5_1_Eval.json │ ├── 2012R2_x64_Datacenter_EN_V5_Eval.json │ ├── 2012R2_x64_Standard_Core_EN_Eval.json │ ├── 2012R2_x64_Standard_Core_EN_V5_1_Eval.json │ ├── 2012R2_x64_Standard_Core_EN_V5_Eval.json │ ├── 2012R2_x64_Standard_EN_Eval.json │ ├── 2012R2_x64_Standard_EN_V5_1_Eval.json │ ├── 2012R2_x64_Standard_EN_V5_Eval.json │ ├── WIN10_x64_Enterprise_1709_EN_Eval.json │ ├── WIN10_x64_Enterprise_1803_EN_Eval.json │ ├── WIN10_x64_Enterprise_1809_EN_Eval.json │ ├── WIN10_x64_Enterprise_1903_EN_Eval.json │ ├── WIN10_x64_Enterprise_1909_EN_Eval.json │ ├── WIN10_x64_Enterprise_2004_EN_Eval.json │ ├── WIN10_x64_Enterprise_20H2_EN_Eval.json │ ├── WIN10_x64_Enterprise_21H1_EN_Eval.json │ ├── WIN10_x64_Enterprise_21H2_EN_Eval.json │ ├── WIN10_x64_Enterprise_LTSB_2016_EN_Eval.json │ ├── WIN10_x64_Enterprise_LTSC_2019_EN_Eval.json │ ├── WIN10_x86_Enterprise_1709_EN_Eval.json │ ├── WIN10_x86_Enterprise_1803_EN_Eval.json │ ├── WIN10_x86_Enterprise_1809_EN_Eval.json │ ├── WIN10_x86_Enterprise_1903_EN_Eval.json │ ├── WIN10_x86_Enterprise_1909_EN_Eval.json │ ├── WIN10_x86_Enterprise_2004_EN_Eval.json │ ├── WIN10_x86_Enterprise_20H2_EN_Eval.json │ ├── WIN10_x86_Enterprise_21H1_EN_Eval.json │ ├── WIN10_x86_Enterprise_21H2_EN_Eval.json │ ├── WIN10_x86_Enterprise_LTSB_2016_EN_Eval.json │ ├── WIN10_x86_Enterprise_LTSC_2019_EN_Eval.json │ ├── WIN11_x64_Enterprise_21H2_EN_Eval.json │ ├── WIN11_x64_Enterprise_22H2_EN_Eval.json │ ├── WIN11_x64_Enterprise_23H2_EN_Eval.json │ ├── WIN81_x64_Enterprise_EN_Eval.json │ ├── WIN81_x64_Enterprise_EN_V5_1_Eval.json │ ├── WIN81_x64_Enterprise_EN_V5_Eval.json │ ├── WIN81_x86_Enterprise_EN_Eval.json │ ├── WIN81_x86_Enterprise_EN_V5_1_Eval.json │ └── WIN81_x86_Enterprise_EN_V5_Eval.json ├── Media.json └── VMDefaults.json ├── DSCResources ├── xHyper-V │ ├── DSCResources │ │ ├── HyperVCommon │ │ │ ├── HyperVCommon.psm1 │ │ │ └── en-us │ │ │ │ └── HyperVCommon.strings.psd1 │ │ ├── MSFT_xVHD │ │ │ ├── MSFT_xVHD.psm1 │ │ │ └── MSFT_xVHD.schema.mof │ │ ├── MSFT_xVMDvdDrive │ │ │ ├── MSFT_xVMDvdDrive.psm1 │ │ │ ├── MSFT_xVMDvdDrive.schema.mof │ │ │ └── en-us │ │ │ │ └── MSFT_xVMDvdDrive.strings.psd1 │ │ ├── MSFT_xVMHardDiskDrive │ │ │ ├── MSFT_xVMHardDiskDrive.psm1 │ │ │ ├── MSFT_xVMHardDiskDrive.schema.mof │ │ │ └── en-US │ │ │ │ └── MSFT_xVMHardDiskDrive.strings.psd1 │ │ ├── MSFT_xVMHost │ │ │ ├── MSFT_xVMHost.psm1 │ │ │ ├── MSFT_xVMHost.schema.mof │ │ │ └── en-US │ │ │ │ └── MSFT_xVMHost.psd1 │ │ ├── MSFT_xVMHyperV │ │ │ ├── MSFT_xVMHyperV.psm1 │ │ │ ├── MSFT_xVMHyperV.schema.mof │ │ │ └── en-US │ │ │ │ └── MSFT_xVMHyperV.psd1 │ │ ├── MSFT_xVMNetworkAdapter │ │ │ ├── MSFT_xVMNetworkAdapter.psm1 │ │ │ ├── MSFT_xVMNetworkAdapter.schema.mof │ │ │ └── en-US │ │ │ │ └── MSFT_xVMNetworkAdapter.psd1 │ │ ├── MSFT_xVMProcessor │ │ │ ├── MSFT_xVMProcessor.psm1 │ │ │ ├── MSFT_xVMProcessor.schema.mof │ │ │ └── en-US │ │ │ │ └── MSFT_xVMProcessor.psd1 │ │ ├── MSFT_xVMScsiController │ │ │ ├── MSFT_xVMScsiController.psm1 │ │ │ ├── MSFT_xVMScsiController.schema.mof │ │ │ └── en-US │ │ │ │ └── MSFT_xVMScsiController.strings.psd1 │ │ ├── MSFT_xVMSwitch │ │ │ ├── MSFT_xVMSwitch.psm1 │ │ │ ├── MSFT_xVMSwitch.schema.mof │ │ │ └── en-us │ │ │ │ └── MSFT_xVMSwitch.strings.psd1 │ │ └── MSFT_xVhdFileDirectory │ │ │ ├── MSFT_xVhdFileDirectory.psm1 │ │ │ └── MSFT_xVhdFileDirectory.schema.mof │ ├── LICENSE │ └── xHyper-V.psd1 ├── xPSDesiredStateConfiguration │ ├── DSCResources │ │ ├── DSC_xArchive │ │ │ ├── DSC_xArchive.psm1 │ │ │ └── en-US │ │ │ │ ├── DSC_xArchive.schema.mfl │ │ │ │ └── DSC_xArchive.strings.psd1 │ │ ├── DSC_xDSCWebService │ │ │ ├── DSC_xDSCWebService.psm1 │ │ │ └── en-US │ │ │ │ └── DSC_xDSCWebService.strings.psd1 │ │ ├── DSC_xEnvironmentResource │ │ │ ├── DSC_xEnvironmentResource.psm1 │ │ │ └── en-US │ │ │ │ ├── DSC_xEnvironmentResource.schema.mfl │ │ │ │ └── DSC_xEnvironmentResource.strings.psd1 │ │ ├── DSC_xGroupResource │ │ │ ├── DSC_xGroupResource.psm1 │ │ │ └── en-US │ │ │ │ ├── DSC_xGroupResource.schema.mfl │ │ │ │ └── DSC_xGroupResource.strings.psd1 │ │ ├── DSC_xMsiPackage │ │ │ ├── DSC_xMsiPackage.psm1 │ │ │ └── en-US │ │ │ │ ├── DSC_xMsiPackage.schema.mfl │ │ │ │ └── DSC_xMsiPackage.strings.psd1 │ │ ├── DSC_xPSSessionConfiguration │ │ │ ├── DSC_xPSSessionConfiguration.psm1 │ │ │ └── en-US │ │ │ │ └── DSC_xPSSessionConfiguration.strings.psd1 │ │ ├── DSC_xPackageResource │ │ │ ├── DSC_xPackageResource.psm1 │ │ │ └── en-US │ │ │ │ ├── DSC_xPackageResource.schema.mfl │ │ │ │ └── DSC_xPackageResource.strings.psd1 │ │ ├── DSC_xRegistryResource │ │ │ ├── DSC_xRegistryResource.psm1 │ │ │ └── en-US │ │ │ │ ├── DSC_xRegistryResource.schema.mfl │ │ │ │ └── DSC_xRegistryResource.strings.psd1 │ │ ├── DSC_xRemoteFile │ │ │ ├── DSC_xRemoteFile.psm1 │ │ │ └── en-us │ │ │ │ └── DSC_xRemoteFile.strings.psd1 │ │ ├── DSC_xScriptResource │ │ │ ├── DSC_xScriptResource.psm1 │ │ │ └── en-US │ │ │ │ ├── DSC_xScriptResource.schema.mfl │ │ │ │ └── DSC_xScriptResource.strings.psd1 │ │ ├── DSC_xServiceResource │ │ │ ├── DSC_xServiceResource.psm1 │ │ │ └── en-US │ │ │ │ ├── DSC_xServiceResource.schema.mfl │ │ │ │ └── DSC_xServiceResource.strings.psd1 │ │ ├── DSC_xUserResource │ │ │ ├── DSC_xUserResource.psm1 │ │ │ └── en-US │ │ │ │ ├── DSC_xUserResource.schema.mfl │ │ │ │ └── DSC_xUserResource.strings.psd1 │ │ ├── DSC_xWindowsFeature │ │ │ ├── DSC_xWindowsFeature.psm1 │ │ │ └── en-US │ │ │ │ ├── DSC_xWindowsFeature.schema.mfl │ │ │ │ └── DSC_xWindowsFeature.strings.psd1 │ │ ├── DSC_xWindowsOptionalFeature │ │ │ ├── DSC_xWindowsOptionalFeature.psm1 │ │ │ └── en-US │ │ │ │ ├── DSC_xWindowsOptionalFeature.schema.mfl │ │ │ │ └── DSC_xWindowsOptionalFeature.strings.psd1 │ │ ├── DSC_xWindowsPackageCab │ │ │ ├── DSC_xWindowsPackageCab.psm1 │ │ │ └── en-US │ │ │ │ ├── DSC_xWindowsPackageCab.schema.mfl │ │ │ │ └── DSC_xWindowsPackageCab.strings.psd1 │ │ ├── DSC_xWindowsProcess │ │ │ ├── DSC_xWindowsProcess.psm1 │ │ │ └── en-US │ │ │ │ ├── DSC_xWindowsProcess.schema.mfl │ │ │ │ └── DSC_xWindowsProcess.strings.psd1 │ │ ├── xFileUpload │ │ │ ├── xFileUpload.psd1 │ │ │ └── xFileUpload.schema.psm1 │ │ ├── xGroupSet │ │ │ ├── xGroupSet.psd1 │ │ │ └── xGroupSet.schema.psm1 │ │ ├── xProcessSet │ │ │ ├── xProcessSet.psd1 │ │ │ └── xProcessSet.schema.psm1 │ │ ├── xServiceSet │ │ │ ├── xServiceSet.psd1 │ │ │ └── xServiceSet.schema.psm1 │ │ ├── xWindowsFeatureSet │ │ │ ├── xWindowsFeatureSet.psd1 │ │ │ └── xWindowsFeatureSet.schema.psm1 │ │ └── xWindowsOptionalFeatureSet │ │ │ ├── xWindowsOptionalFeatureSet.psd1 │ │ │ └── xWindowsOptionalFeatureSet.schema.psm1 │ ├── Modules │ │ ├── DscPullServerSetup │ │ │ ├── DscPullServerSetup.psm1 │ │ │ ├── DscPullServerSetupTest │ │ │ │ └── DscPullServerSetupTest.ps1 │ │ │ ├── README.md │ │ │ └── en-US │ │ │ │ └── DscPullServerSetup.strings.psd1 │ │ ├── xPSDesiredStateConfiguration.Common │ │ │ ├── en-US │ │ │ │ └── xPSDesiredStateConfiguration.Common.strings.psd1 │ │ │ ├── xPSDesiredStateConfiguration.Common.psd1 │ │ │ └── xPSDesiredStateConfiguration.Common.psm1 │ │ ├── xPSDesiredStateConfiguration.Firewall │ │ │ ├── en-US │ │ │ │ └── xPSDesiredStateConfiguration.Firewall.strings.psd1 │ │ │ ├── xPSDesiredStateConfiguration.Firewall.psd1 │ │ │ └── xPSDesiredStateConfiguration.Firewall.psm1 │ │ ├── xPSDesiredStateConfiguration.PSWSIIS │ │ │ ├── en-US │ │ │ │ └── xPSDesiredStateConfiguration.PSWSIIS.strings.psd1 │ │ │ ├── xPSDesiredStateConfiguration.PSWSIIS.psd1 │ │ │ └── xPSDesiredStateConfiguration.PSWSIIS.psm1 │ │ └── xPSDesiredStateConfiguration.Security │ │ │ ├── en-US │ │ │ └── xPSDesiredStateConfiguration.Security.strings.psd1 │ │ │ ├── xPSDesiredStateConfiguration.Security.psd1 │ │ │ └── xPSDesiredStateConfiguration.Security.psm1 │ ├── PSGetModuleInfo.xml │ ├── ResourceDesignerScripts │ │ ├── GenerateXRemoteFileSchema.ps1 │ │ └── New-PSSessionConfigurationResource.ps1 │ ├── en-US │ │ └── about_xPSDesiredStateConfiguration.help.txt │ └── xPSDesiredStateConfiguration.psd1 └── xPendingReboot │ ├── DSCResources │ └── MSFT_xPendingReboot │ │ ├── MSFT_xPendingReboot.psm1 │ │ └── MSFT_xPendingReboot.schema.mof │ ├── LICENSE │ └── xPendingReboot.psd1 ├── Examples ├── BlankMedia.psd1 ├── CustomDiskSize.psd1 ├── CustomGenerationMedia.psd1 ├── CustomMedia.psd1 ├── CustomResource.psd1 ├── DvdDriveEnvironmentVariable.psd1 ├── ModuleExample.psd1 ├── MultipleDiskExample.psd1 ├── MultipleNetworkExample.ps1 ├── MultipleNetworkExample.psd1 ├── NanoComputeExample.ps1 ├── NanoComputeExample.psd1 ├── NanoContainerExample.ps1 ├── NanoContainerExample.psd1 ├── NanoExample.ps1 ├── NanoExample.psd1 ├── NestedVirtualizationExample.psd1 ├── TestLabGuide.ps1 └── TestLabGuide.psd1 ├── LICENSE ├── Lability.Format.ps1xml ├── Lability.nuspec ├── Lability.png ├── Lability.psd1 ├── Lability.psm1 ├── Readme.md ├── Src ├── Private │ ├── Add-DiskImageHotfix.ps1 │ ├── Add-DiskImagePackage.ps1 │ ├── Add-LabImageOptionalFeature.ps1 │ ├── Add-LabImagePackage.ps1 │ ├── Assert-BitLockerFDV.ps1 │ ├── Assert-LabConfigurationMof.ps1 │ ├── Assert-TimeZone.ps1 │ ├── Assert-VirtualMachineHardDiskDriveParameter.ps1 │ ├── Clear-LabVirtualMachine.ps1 │ ├── Close-GitHubZipArchive.ps1 │ ├── Close-ZipArchive.ps1 │ ├── Convert-PSObjectToHashtable.ps1 │ ├── ConvertTo-ConfigurationData.ps1 │ ├── Copy-Directory.ps1 │ ├── Copy-LabModule.ps1 │ ├── Disable-BitLockerFDV.ps1 │ ├── Expand-GitHubZipArchive.ps1 │ ├── Expand-GitHubZipArchiveItem.ps1 │ ├── Expand-LabImage.ps1 │ ├── Expand-LabIso.ps1 │ ├── Expand-LabModuleCache.ps1 │ ├── Expand-LabResource.ps1 │ ├── Expand-ZipArchive.ps1 │ ├── Expand-ZipArchiveItem.ps1 │ ├── Get-ConfigurationData.ps1 │ ├── Get-DiskImageDriveLetter.ps1 │ ├── Get-DscResourceModule.ps1 │ ├── Get-FormattedMessage.ps1 │ ├── Get-LabDscModule.ps1 │ ├── Get-LabDscResource.ps1 │ ├── Get-LabHostDscConfigurationPath.ps1 │ ├── Get-LabHostSetupConfiguration.ps1 │ ├── Get-LabMediaId.ps1 │ ├── Get-LabModule.ps1 │ ├── Get-LabModuleCache.ps1 │ ├── Get-LabModuleCacheManifest.ps1 │ ├── Get-LabMofModule.ps1 │ ├── Get-LabVMDisk.ps1 │ ├── Get-LabVMSnapshot.ps1 │ ├── Get-LabVirtualMachineProperty.ps1 │ ├── Get-ResourceDownload.ps1 │ ├── Get-WindowsImageByIndex.ps1 │ ├── Get-WindowsImageByName.ps1 │ ├── Import-DismModule.ps1 │ ├── Import-LabDscResource.ps1 │ ├── Invoke-Executable.ps1 │ ├── Invoke-LabDscResource.ps1 │ ├── Invoke-LabMediaDownload.ps1 │ ├── Invoke-LabMediaImageDownload.ps1 │ ├── Invoke-LabModuleCacheDownload.ps1 │ ├── Invoke-LabModuleDownloadFromAzDo.ps1 │ ├── Invoke-LabModuleDownloadFromGitHub.ps1 │ ├── Invoke-LabModuleDownloadFromPSGallery.ps1 │ ├── Invoke-ResourceDownload.ps1 │ ├── Invoke-WebClientDownload.ps1 │ ├── New-Directory.ps1 │ ├── New-DiskImage.ps1 │ ├── New-DiskImageGpt.ps1 │ ├── New-DiskImageMbr.ps1 │ ├── New-DiskPartFat32Partition.ps1 │ ├── New-EmptyDiskImage.ps1 │ ├── New-LabBootStrap.ps1 │ ├── New-LabMedia.ps1 │ ├── New-LabSwitch.ps1 │ ├── New-LabVMSnapshot.ps1 │ ├── New-LabVirtualMachine.ps1 │ ├── New-UnattendXml.ps1 │ ├── Remove-ConfigurationData.ps1 │ ├── Remove-LabSwitch.ps1 │ ├── Remove-LabVMDisk.ps1 │ ├── Remove-LabVMSnapshot.ps1 │ ├── Remove-LabVirtualMachine.ps1 │ ├── Remove-LabVirtualMachineHardDiskDrive.ps1 │ ├── Rename-LabModuleCacheVersion.ps1 │ ├── Reset-LabVMDisk.ps1 │ ├── Resolve-AzDoModuleUri.ps1 │ ├── Resolve-ConfigurationDataPath.ps1 │ ├── Resolve-ConfigurationPath.ps1 │ ├── Resolve-DismPath.ps1 │ ├── Resolve-GitHubModuleUri.ps1 │ ├── Resolve-LabConfigurationModule.ps1 │ ├── Resolve-LabCustomBootStrap.ps1 │ ├── Resolve-LabEnvironmentName.ps1 │ ├── Resolve-LabImage.ps1 │ ├── Resolve-LabMedia.ps1 │ ├── Resolve-LabModule.ps1 │ ├── Resolve-LabResource.ps1 │ ├── Resolve-LabSwitch.ps1 │ ├── Resolve-LabVMDiskGenerationDiskPath.ps1 │ ├── Resolve-LabVMDiskPath.ps1 │ ├── Resolve-LabVMImage.ps1 │ ├── Resolve-NodePropertyValue.ps1 │ ├── Resolve-PSGalleryModuleUri.ps1 │ ├── Resolve-PathEx.ps1 │ ├── Resolve-ProgramFilesFolder.ps1 │ ├── Resolve-VhdHierarchy.ps1 │ ├── Set-ConfigurationData.ps1 │ ├── Set-DiskImageBootVolume.ps1 │ ├── Set-DiskImageBootVolumeGpt.ps1 │ ├── Set-DiskImageBootVolumeMbr.ps1 │ ├── Set-LabBootStrap.ps1 │ ├── Set-LabDscResource.ps1 │ ├── Set-LabSetupCompleteCmd.ps1 │ ├── Set-LabSwitch.ps1 │ ├── Set-LabVMDisk.ps1 │ ├── Set-LabVMDiskFile.ps1 │ ├── Set-LabVMDiskFileBootstrap.ps1 │ ├── Set-LabVMDiskFileCertificate.ps1 │ ├── Set-LabVMDiskFileModule.ps1 │ ├── Set-LabVMDiskFileMof.ps1 │ ├── Set-LabVMDiskFileResource.ps1 │ ├── Set-LabVMDiskFileUnattendXml.ps1 │ ├── Set-LabVMDiskModule.ps1 │ ├── Set-LabVirtualMachine.ps1 │ ├── Set-LabVirtualMachineHardDiskDrive.ps1 │ ├── Set-ResourceChecksum.ps1 │ ├── Set-ResourceDownload.ps1 │ ├── Set-UnattendXml.ps1 │ ├── Start-DscConfigurationCompilation.ps1 │ ├── Start-ShellHWDetectionService.ps1 │ ├── Stop-ShellHWDetectionService.ps1 │ ├── Test-ComputerName.ps1 │ ├── Test-ConfigurationPath.ps1 │ ├── Test-DscResourceModule.ps1 │ ├── Test-LabDscModule.ps1 │ ├── Test-LabDscResource.ps1 │ ├── Test-LabModule.ps1 │ ├── Test-LabModuleCache.ps1 │ ├── Test-LabModuleVersion.ps1 │ ├── Test-LabMofModule.ps1 │ ├── Test-LabNode.ps1 │ ├── Test-LabResourceIsLocal.ps1 │ ├── Test-LabSwitch.ps1 │ ├── Test-LabVMDisk.ps1 │ ├── Test-LabVirtualMachine.ps1 │ ├── Test-ResourceDownload.ps1 │ ├── Test-WindowsBuildNumber.ps1 │ ├── Write-Verbose.ps1 │ └── Write-Warning.ps1 └── Public │ ├── Checkpoint-Lab.ps1 │ ├── Clear-LabModuleCache.ps1 │ ├── Clear-ModulePath.ps1 │ ├── Export-LabHostConfiguration.ps1 │ ├── Export-LabImage.ps1 │ ├── Get-LabHostConfiguration.ps1 │ ├── Get-LabHostDefault.ps1 │ ├── Get-LabImage.ps1 │ ├── Get-LabMedia.ps1 │ ├── Get-LabStatus.ps1 │ ├── Get-LabVM.ps1 │ ├── Get-LabVMDefault.ps1 │ ├── Import-LabHostConfiguration.ps1 │ ├── Install-LabModule.ps1 │ ├── Invoke-LabResourceDownload.ps1 │ ├── New-LabImage.ps1 │ ├── New-LabVM.ps1 │ ├── Register-LabMedia.ps1 │ ├── Remove-LabConfiguration.ps1 │ ├── Remove-LabVM.ps1 │ ├── Reset-Lab.ps1 │ ├── Reset-LabHostDefault.ps1 │ ├── Reset-LabMedia.ps1 │ ├── Reset-LabVM.ps1 │ ├── Reset-LabVMDefault.ps1 │ ├── Restore-Lab.ps1 │ ├── Set-LabHostDefault.ps1 │ ├── Set-LabVMDefault.ps1 │ ├── Start-DscCompilation.ps1 │ ├── Start-Lab.ps1 │ ├── Start-LabConfiguration.ps1 │ ├── Start-LabHostConfiguration.ps1 │ ├── Stop-Lab.ps1 │ ├── Test-LabConfiguration.ps1 │ ├── Test-LabHostConfiguration.ps1 │ ├── Test-LabImage.ps1 │ ├── Test-LabMedia.ps1 │ ├── Test-LabResource.ps1 │ ├── Test-LabStatus.ps1 │ ├── Test-LabVM.ps1 │ ├── Unregister-LabMedia.ps1 │ └── Wait-Lab.ps1 ├── Tests ├── Linting │ ├── FileEncoding.Tests.ps1 │ ├── PSScriptAnalyzer.Tests.ps1 │ └── Style.Tests.ps1 └── Unit │ └── Src │ ├── Private │ ├── Add-DiskImageHotfix.Tests.ps1 │ ├── Assert-BitLockerFDV.Tests.ps1 │ ├── Assert-LabConfigurationMof.Tests.ps1 │ ├── Assert-VirtualMachineHardDiskDriveParameter.Tests.ps1 │ ├── Clear-LabVirtualMachine.Tests.ps1 │ ├── Convert-PSObjectToHashtable.Tests.ps1 │ ├── Disable-BitLockerFDV.Tests.ps1 │ ├── Expand-LabImage.Tests.ps1 │ ├── Expand-LabIso.Tests.ps1 │ ├── Expand-LabModuleCache.Tests.ps1 │ ├── Expand-LabResource.Tests.ps1 │ ├── Get-ConfigurationData.Tests.ps1 │ ├── Get-DiskImageDriveLetter.Tests.ps1 │ ├── Get-DscResourceModule.Tests.ps1 │ ├── Get-FormattedMessage.Tests.ps1 │ ├── Get-LabDscModule.Tests.ps1 │ ├── Get-LabDscResource.Tests.ps1 │ ├── Get-LabHostDscConfigurationPath.Tests.ps1 │ ├── Get-LabHostSetupConfiguration.Tests.ps1 │ ├── Get-LabModuleCache.Tests.ps1 │ ├── Get-LabMofModule.Tests.ps1 │ ├── Get-LabVMDisk.Tests.ps1 │ ├── Get-LabVMSnapshot.Tests.ps1 │ ├── Get-LabVirtualMachineProperty.Tests.ps1 │ ├── Get-ResourceDownload.Tests.ps1 │ ├── Get-WindowsImageByIndex.Tests.ps1 │ ├── Get-WindowsImageByName.Tests.ps1 │ ├── Import-LabDscResource.Tests.ps1 │ ├── Invoke-DscResource.Tests.ps1 │ ├── Invoke-Executable.Tests.ps1 │ ├── Invoke-LabMediaDownload.Tests.ps1 │ ├── Invoke-LabMediaImageDownload.Tests.ps1 │ ├── Invoke-LabModuleCacheDownload.Tests.ps1 │ ├── Invoke-LabModuleDownloadFromAzDevOps.Tests.ps1 │ ├── Invoke-LabModuleDownloadFromGitHub.Tests.ps1 │ ├── Invoke-LabModuleDownloadFromPSGallery.Tests.ps1 │ ├── Invoke-ResourceDownload.Tests.ps1 │ ├── New-Directory.Tests.ps1 │ ├── New-DiskImage.Tests.ps1 │ ├── New-DiskImageGpt.Tests.ps1 │ ├── New-DiskImageMbr.Tests.ps1 │ ├── New-LabBootStrap.Tests.ps1 │ ├── New-LabMedia.Tests.ps1 │ ├── New-LabSwitch.Tests.ps1 │ ├── New-LabVMSnapshot.Tests.ps1 │ ├── New-LabVirtualMachine.Tests.ps1 │ ├── New-UnattendXml.Tests.ps1 │ ├── Remove-ConfigurationData.Tests.ps1 │ ├── Remove-LabSwitch.Tests.ps1 │ ├── Remove-LabVMDisk.Tests.ps1 │ ├── Remove-LabVMSnapshot.Tests.ps1 │ ├── Remove-LabVirtualMachine.Tests.ps1 │ ├── Remove-LabVirtualMachineHardDiskDrive.Tests.ps1 │ ├── Rename-LabModuleCacheVersion.Tests.ps1 │ ├── Reset-LabVMDisk.Tests.ps1 │ ├── Resolve-AzDevOpsModuleUri.Tests.ps1 │ ├── Resolve-ConfigurationDataPath.Tests.ps1 │ ├── Resolve-ConfigurationPath.Tests.ps1 │ ├── Resolve-LabConfigurationModule.Tests.ps1 │ ├── Resolve-LabCustomBootStrap.Tests.ps1 │ ├── Resolve-LabEnvironmentName.Tests.ps1 │ ├── Resolve-LabImage.Tests.ps1 │ ├── Resolve-LabMedia.Tests.ps1 │ ├── Resolve-LabModule.Tests.ps1 │ ├── Resolve-LabResource.Tests.ps1 │ ├── Resolve-LabSwitch.Tests.ps1 │ ├── Resolve-LabVMDisk.Tests.ps1 │ ├── Resolve-LabVMDiskPath.Tests.ps1 │ ├── Resolve-LabVMGenerationDiskPath.Tests.ps1 │ ├── Resolve-NodePropertyValue.Tests.ps1 │ ├── Resolve-PSGalleryModuleUri.Tests.ps1 │ ├── Resolve-PathEx.Tests.ps1 │ ├── Set-ConfigurationData.Tests.ps1 │ ├── Set-DiskImageBootVolume.Tests.ps1 │ ├── Set-DiskImageBootVolumeGpt.Tests.ps1 │ ├── Set-DiskImageBootVolumeMbr.Tests.ps1 │ ├── Set-LabBootStrap.Tests.ps1 │ ├── Set-LabDscResource.Tests.ps1 │ ├── Set-LabSetupCompleteCmd.Tests.ps1 │ ├── Set-LabSwitch.Tests.ps1 │ ├── Set-LabVMDisk.Tests.ps1 │ ├── Set-LabVMDiskFile.Tests.ps1 │ ├── Set-LabVMDiskFileBootstrap.Tests.ps1 │ ├── Set-LabVMDiskFileCertificate.Tests.ps1 │ ├── Set-LabVMDiskFileModule.Tests.ps1 │ ├── Set-LabVMDiskFileMof.Tests.ps1 │ ├── Set-LabVMDiskFileResource.Tests.ps1 │ ├── Set-LabVMDiskFileUnattendXml.Tests.ps1 │ ├── Set-LabVMDiskModule.Tests.ps1 │ ├── Set-LabVirtualMachine.Tests.ps1 │ ├── Set-LabVirtualMachineHardDiskDrive.Tests.ps1 │ ├── Set-ResourceDownload.Tests.ps1 │ ├── Set-UnattendXml.Tests.ps1 │ ├── Test-ComputerName.Tests.ps1 │ ├── Test-ConfigurationPath.Tests.ps1 │ ├── Test-DscResource.Tests.ps1 │ ├── Test-DscResourceModule.Tests.ps1 │ ├── Test-LabDscModule.Tests.ps1 │ ├── Test-LabModuleCache.Tests.ps1 │ ├── Test-LabMofModule.Tests.ps1 │ ├── Test-LabResourceIsLocal.Tests.ps1 │ ├── Test-LabSwitch.Tests.ps1 │ ├── Test-LabVMDisk.Tests.ps1 │ ├── Test-LabVirtualMachine.Tests.ps1 │ ├── Test-ResourceDownload.Tests.ps1 │ ├── Test-WindowsBuildNumber.Tests.ps1 │ ├── Write-Verbose.Tests.ps1 │ └── Write-Warning.Tests.ps1 │ └── Public │ ├── Checkpoint-Lab.Tests.ps1 │ ├── Get-LabHostConfiguration.Tests.ps1 │ ├── Get-LabHostDefault.Tests.ps1 │ ├── Get-LabImage.Tests.ps1 │ ├── Get-LabMedia.Tests.ps1 │ ├── Get-LabVM.Tests.ps1 │ ├── Get-LabVMDefault.Tests.ps1 │ ├── Invoke-LabResourceDownload.Tests.ps1 │ ├── New-LabImage.Tests.ps1 │ ├── New-LabVM.Tests.ps1 │ ├── Register-LabMedia.Tests.ps1 │ ├── Remove-LabConfiguration.Tests.ps1 │ ├── Remove-LabVM.ps1 │ ├── Reset-Lab.Tests.ps1 │ ├── Reset-LabVM.Tests.ps1 │ ├── Reset-LabVMDefault.Tests.ps1 │ ├── Restore-Lab.Tests.ps1 │ ├── Set-LabHostDefault.Tests.ps1 │ ├── Set-LabVMDefault.Tests.ps1 │ ├── Start-Lab.Tests.ps1 │ ├── Start-LabConfiguration.Tests.ps1 │ ├── Start-LabHostConfiguration.Tests.ps1 │ ├── Stop-Lab.Tests.ps1 │ ├── Test-LabConfiguration.Tests.ps1 │ ├── Test-LabHostConfiguration.Tests.ps1 │ ├── Test-LabImage.Tests.ps1 │ ├── Test-LabMedia.Tests.ps1 │ ├── Test-LabResource.Tests.ps1 │ ├── Test-LabVM.Tests.ps1 │ └── Unregister-LabMedia.Tests.ps1 ├── appveyor.yml └── en-US ├── Lability.Resources.psd1 ├── about_Bootstrap.help.txt ├── about_ConfigurationData.help.txt ├── about_CustomResources.help.txt ├── about_Lability.help.txt ├── about_Media.help.txt └── about_Networking.help.txt /Config/HostDefaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConfigurationPath": "%SYSTEMDRIVE%\\Lability\\Configurations", 3 | "DifferencingVhdPath": "%SYSTEMDRIVE%\\Lability\\VMVirtualHardDisks", 4 | "HotfixPath": "%SYSTEMDRIVE%\\Lability\\Hotfixes", 5 | "IsoPath": "%SYSTEMDRIVE%\\Lability\\ISOs", 6 | "ModuleCachePath": "%ALLUSERSPROFILE%\\Lability\\Modules", 7 | "ParentVhdPath": "%SYSTEMDRIVE%\\Lability\\MasterVirtualHardDisks", 8 | "RepositoryUri": "https://www.powershellgallery.com/api/v2/package", 9 | "ResourcePath": "%SYSTEMDRIVE%\\Lability\\Resources", 10 | "ResourceShareName": "Resources", 11 | "DisableLocalFileCaching": false, 12 | "DisableSwitchEnvironmentName": false, 13 | "DisableVhdEnvironmentName": false 14 | } 15 | -------------------------------------------------------------------------------- /Config/LabClient.cer: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIEIjCCAwqgAwIBAgIJAMRIv0r6jbtXMA0GCSqGSIb3DQEBCwUAMIGoMRcwFQYD 3 | VQQKEw5WaXJ0dWFsIEVuZ2luZTERMA8GA1UECxMIVGVzdCBMYWIxHDAaBgkqhkiG 4 | 9w0BCQEWDWxhYkBsYWIubG9jYWwxDzANBgNVBAcTBk94Zm9yZDENMAsGA1UECBME 5 | T1hPTjELMAkGA1UEBhMCR0IxLzAtBgNVBAMTJlZpcnR1YWwgRW5naW5lIFRlc3Qg 6 | TGFiIFJvb3QgQXV0aG9yaXR5MB4XDTE2MDkwMjExMTU1MVoXDTQ0MDExODExMTU1 7 | MVowgaQxFzAVBgNVBAoTDlZpcnR1YWwgRW5naW5lMREwDwYDVQQLEwhUZXN0IExh 8 | YjEcMBoGCSqGSIb3DQEJARYNbGFiQGxhYi5sb2NhbDEPMA0GA1UEBxMGT3hmb3Jk 9 | MQ0wCwYDVQQIEwRPWE9OMQswCQYDVQQGEwJHQjErMCkGA1UEAxMiVmlydHVhbCBF 10 | bmdpbmUgVGVzdCBMYWIgRFNDIENsaWVudDCCASIwDQYJKoZIhvcNAQEBBQADggEP 11 | ADCCAQoCggEBANTQHVEha9il21VmazX8OcVc3HloWx4RBJVAOj77zYSMsqEyTzVR 12 | r2k38IgQTO8S4uFS1+UvhDuT4tFVAzH9SIq/mSFK1asmvORzFIH/joPSEPKdRXxs 13 | 1hZJN/hU9aezzlmEK/J29hJDcJttNwsqFBovaY+bQ72EKWVuEzWxp7VrX5ENW2Ie 14 | zabh2VXYFmWRwpwkOy6MEBtm2Z3frpHbTSh2JT6E18GkivWApJNuZllo6xgRPpiX 15 | 33GhBAMGaoIywGS6iI9i55+SuBZ1nwMtrGwt6R3i5IGL0edDD5z8DygqWFsTOkL4 16 | +UmCTfAi0lI2M9OPccfdC8rAsz5ByWxDHwECAwEAAaNRME8wHwYDVR0jBBgwFoAU 17 | oIqJDwSsH0DzgBW8Mab7YwkOtRgwCQYDVR0TBAIwADALBgNVHQ8EBAMCBDAwFAYD 18 | VR0lBA0wCwYJKwYBBAGCN1ABMA0GCSqGSIb3DQEBCwUAA4IBAQBA13iBwNoAMdFw 19 | 57H5ScgoY/IeNDDexYbERmB74AxsMVmGddHeU79QBFpYkWcAagqgNsbMLoafsXrA 20 | f9gROH90tAn3IBQGiKb2e9VKfi624Tg2UHIXEvu2++VeJc9t46rloDaO6uBhD79j 21 | /t5lakXQ2N6ebkoa8VWWI9cPOizO8N/rf1WM6A99rsFXaIvOyZzB8oxwK3h5xWWR 22 | JuU7VAJD2biVEkW2uOE9FD9t5Ak2Uj1STUH8IJCSX46d9LDbZmjXh47G30n1BFWx 23 | t1b+XgPSEKZ+0BD2JTs3XX8S0Qev+CcyLtGhFoMcvRmKXDxkPww6RyVDEY+u21lu 24 | zIh9NoHY 25 | -----END CERTIFICATE----- 26 | -------------------------------------------------------------------------------- /Config/LabClient.pfx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VirtualEngine/Lability/5faafeeccf22f74da9e8a6d5d31de10fedd59331/Config/LabClient.pfx -------------------------------------------------------------------------------- /Config/LegacyMedia/2012R2_x64_Datacenter_Core_EN_V5_1_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "2012R2_x64_Datacenter_Core_EN_V5_1_Eval", 3 | "Filename": "2012R2_x64_EN_Eval.iso", 4 | "Description": "Windows Server 2012 R2 Datacenter Core 64-bit English Evaluation with WMF 5.1", 5 | "Architecture": "x64", 6 | "ImageName": "3", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "http://download.microsoft.com/download/6/2/A/62A76ABB-9990-4EFC-A4FE-C7D698DAEB96/9600.17050.WINBLUE_REFRESH.140317-1640_X64FRE_SERVER_EVAL_EN-US-IR3_SSS_X64FREE_EN-US_DV9.ISO", 10 | "Checksum": "5B5E08C490AD16B59B1D9FAB0DEF883A", 11 | "CustomData": { 12 | "WindowsOptionalFeature": ["NetFx3"] 13 | }, 14 | "Hotfixes": [ 15 | { 16 | "Id": "Win8.1AndW2K12R2-KB3191564-x64.msu", 17 | "Uri": "https://download.microsoft.com/download/6/F/5/6F5FF66C-6775-42B0-86C4-47D41F2DA187/Win8.1AndW2K12R2-KB3191564-x64.msu" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /Config/LegacyMedia/2012R2_x64_Datacenter_Core_EN_V5_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "2012R2_x64_Datacenter_Core_EN_V5_Eval", 3 | "Filename": "2012R2_x64_EN_Eval.iso", 4 | "Description": "Windows Server 2012 R2 Datacenter Core 64-bit English Evaluation with WMF 5", 5 | "Architecture": "x64", 6 | "ImageName": "3", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "http://download.microsoft.com/download/6/2/A/62A76ABB-9990-4EFC-A4FE-C7D698DAEB96/9600.17050.WINBLUE_REFRESH.140317-1640_X64FRE_SERVER_EVAL_EN-US-IR3_SSS_X64FREE_EN-US_DV9.ISO", 10 | "Checksum": "5B5E08C490AD16B59B1D9FAB0DEF883A", 11 | "CustomData": { 12 | "WindowsOptionalFeature": ["NetFx3"] 13 | }, 14 | "Hotfixes": [ 15 | { 16 | "Id": "Win8.1AndW2K12R2-KB3134758-x64.msu", 17 | "Uri": "https://download.microsoft.com/download/2/C/6/2C6E1B4A-EBE5-48A6-B225-2D2058A9CEFB/Win8.1AndW2K12R2-KB3134758-x64.msu" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /Config/LegacyMedia/2012R2_x64_Datacenter_EN_V5_1_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "2012R2_x64_Datacenter_EN_V5_1_Eval", 3 | "Filename": "2012R2_x64_EN_Eval.iso", 4 | "Description": "Windows Server 2012 R2 Datacenter 64-bit English Evaluation with WMF 5.1", 5 | "Architecture": "x64", 6 | "ImageName": "4", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "http://download.microsoft.com/download/6/2/A/62A76ABB-9990-4EFC-A4FE-C7D698DAEB96/9600.17050.WINBLUE_REFRESH.140317-1640_X64FRE_SERVER_EVAL_EN-US-IR3_SSS_X64FREE_EN-US_DV9.ISO", 10 | "Checksum": "5B5E08C490AD16B59B1D9FAB0DEF883A", 11 | "CustomData": { 12 | "WindowsOptionalFeature": ["NetFx3"] 13 | }, 14 | "Hotfixes": [ 15 | { 16 | "Id": "Win8.1AndW2K12R2-KB3191564-x64.msu", 17 | "Uri": "https://download.microsoft.com/download/6/F/5/6F5FF66C-6775-42B0-86C4-47D41F2DA187/Win8.1AndW2K12R2-KB3191564-x64.msu" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /Config/LegacyMedia/2012R2_x64_Datacenter_EN_V5_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "2012R2_x64_Datacenter_EN_V5_Eval", 3 | "Filename": "2012R2_x64_EN_Eval.iso", 4 | "Description": "Windows Server 2012 R2 Datacenter 64-bit English Evaluation with WMF 5", 5 | "Architecture": "x64", 6 | "ImageName": "4", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "http://download.microsoft.com/download/6/2/A/62A76ABB-9990-4EFC-A4FE-C7D698DAEB96/9600.17050.WINBLUE_REFRESH.140317-1640_X64FRE_SERVER_EVAL_EN-US-IR3_SSS_X64FREE_EN-US_DV9.ISO", 10 | "Checksum": "5B5E08C490AD16B59B1D9FAB0DEF883A", 11 | "CustomData": { 12 | "WindowsOptionalFeature": ["NetFx3"] 13 | }, 14 | "Hotfixes": [ 15 | { 16 | "Id": "Win8.1AndW2K12R2-KB3134758-x64.msu", 17 | "Uri": "https://download.microsoft.com/download/2/C/6/2C6E1B4A-EBE5-48A6-B225-2D2058A9CEFB/Win8.1AndW2K12R2-KB3134758-x64.msu" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /Config/LegacyMedia/2012R2_x64_Standard_Core_EN_V5_1_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "2012R2_x64_Standard_Core_EN_V5_1_Eval", 3 | "Filename": "2012R2_x64_EN_Eval.iso", 4 | "Description": "Windows Server 2012 R2 Standard Core 64-bit English Evaluation with WMF 5.1", 5 | "Architecture": "x64", 6 | "ImageName": "1", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "http://download.microsoft.com/download/6/2/A/62A76ABB-9990-4EFC-A4FE-C7D698DAEB96/9600.17050.WINBLUE_REFRESH.140317-1640_X64FRE_SERVER_EVAL_EN-US-IR3_SSS_X64FREE_EN-US_DV9.ISO", 10 | "Checksum": "5B5E08C490AD16B59B1D9FAB0DEF883A", 11 | "CustomData": { 12 | "WindowsOptionalFeature": ["NetFx3"] 13 | }, 14 | "Hotfixes": [ 15 | { 16 | "Id": "Win8.1AndW2K12R2-KB3191564-x64.msu", 17 | "Uri": "https://download.microsoft.com/download/6/F/5/6F5FF66C-6775-42B0-86C4-47D41F2DA187/Win8.1AndW2K12R2-KB3191564-x64.msu" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /Config/LegacyMedia/2012R2_x64_Standard_Core_EN_V5_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "2012R2_x64_Standard_Core_EN_V5_Eval", 3 | "Filename": "2012R2_x64_EN_Eval.iso", 4 | "Description": "Windows Server 2012 R2 Standard Core 64-bit English Evaluation with WMF 5", 5 | "Architecture": "x64", 6 | "ImageName": "1", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "http://download.microsoft.com/download/6/2/A/62A76ABB-9990-4EFC-A4FE-C7D698DAEB96/9600.17050.WINBLUE_REFRESH.140317-1640_X64FRE_SERVER_EVAL_EN-US-IR3_SSS_X64FREE_EN-US_DV9.ISO", 10 | "Checksum": "5B5E08C490AD16B59B1D9FAB0DEF883A", 11 | "CustomData": { 12 | "WindowsOptionalFeature": ["NetFx3"] 13 | }, 14 | "Hotfixes": [ 15 | { 16 | "Id": "Win8.1AndW2K12R2-KB3134758-x64.msu", 17 | "Uri": "https://download.microsoft.com/download/2/C/6/2C6E1B4A-EBE5-48A6-B225-2D2058A9CEFB/Win8.1AndW2K12R2-KB3134758-x64.msu" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /Config/LegacyMedia/2012R2_x64_Standard_EN_V5_1_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "2012R2_x64_Standard_EN_V5_1_Eval", 3 | "Filename": "2012R2_x64_EN_Eval.iso", 4 | "Description": "Windows Server 2012 R2 Standard 64-bit English Evaluation with WMF 5.1", 5 | "Architecture": "x64", 6 | "ImageName": "2", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "http://download.microsoft.com/download/6/2/A/62A76ABB-9990-4EFC-A4FE-C7D698DAEB96/9600.17050.WINBLUE_REFRESH.140317-1640_X64FRE_SERVER_EVAL_EN-US-IR3_SSS_X64FREE_EN-US_DV9.ISO", 10 | "Checksum": "5B5E08C490AD16B59B1D9FAB0DEF883A", 11 | "CustomData": { 12 | "WindowsOptionalFeature": ["NetFx3"] 13 | }, 14 | "Hotfixes": [ 15 | { 16 | "Id": "Win8.1AndW2K12R2-KB3191564-x64.msu", 17 | "Uri": "https://download.microsoft.com/download/6/F/5/6F5FF66C-6775-42B0-86C4-47D41F2DA187/Win8.1AndW2K12R2-KB3191564-x64.msu" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /Config/LegacyMedia/2012R2_x64_Standard_EN_V5_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "2012R2_x64_Standard_EN_V5_Eval", 3 | "Filename": "2012R2_x64_EN_Eval.iso", 4 | "Description": "Windows Server 2012 R2 Standard 64-bit English Evaluation with WMF 5", 5 | "Architecture": "x64", 6 | "ImageName": "2", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "http://download.microsoft.com/download/6/2/A/62A76ABB-9990-4EFC-A4FE-C7D698DAEB96/9600.17050.WINBLUE_REFRESH.140317-1640_X64FRE_SERVER_EVAL_EN-US-IR3_SSS_X64FREE_EN-US_DV9.ISO", 10 | "Checksum": "5B5E08C490AD16B59B1D9FAB0DEF883A", 11 | "CustomData": { 12 | "WindowsOptionalFeature": ["NetFx3"] 13 | }, 14 | "Hotfixes": [ 15 | { 16 | "Id": "Win8.1AndW2K12R2-KB3134758-x64.msu", 17 | "Uri": "https://download.microsoft.com/download/2/C/6/2C6E1B4A-EBE5-48A6-B225-2D2058A9CEFB/Win8.1AndW2K12R2-KB3134758-x64.msu" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /Config/LegacyMedia/WIN10_x64_Enterprise_1709_EN_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "WIN10_x64_Enterprise_1709_EN_Eval", 3 | "Filename": "WIN10_x64_ENT_RS3_EN_Eval.iso", 4 | "Description": "Windows 10 64bit Enterprise 1709 English Evaluation", 5 | "Architecture": "x64", 6 | "ImageName": "Windows 10 Enterprise Evaluation", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "https://software-download.microsoft.com/download/pr/17134.1.180410-1804.rs4_release_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso", 10 | "Checksum": "89F6B3079B3669560D29F3C4BE9CC74D", 11 | "CustomData": { 12 | "WindowsOptionalFeature": ["NetFx3"], 13 | "CustomBootstrap": [ 14 | "## Unattend.xml will set the Administrator password, but it won't enable the account on client OSes", 15 | "NET USER Administrator /active:yes;", 16 | "Set-ItemProperty -Path HKLM:\\SOFTWARE\\Microsoft\\PowerShell\\1\\ShellIds\\Microsoft.PowerShell -Name ExecutionPolicy -Value RemoteSigned -Force; #306", 17 | "## Kick-start PowerShell remoting on clients to permit applying DSC configurations", 18 | "Enable-PSRemoting -SkipNetworkProfileCheck -Force;" 19 | ], 20 | "MinimumDismVersion": "10.0.0.0" 21 | }, 22 | "Hotfixes": [] 23 | } 24 | -------------------------------------------------------------------------------- /Config/LegacyMedia/WIN10_x64_Enterprise_1803_EN_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "WIN10_x64_Enterprise_1803_EN_Eval", 3 | "Filename": "WIN10_x64_ENT_RS4_EN_Eval.iso", 4 | "Description": "Windows 10 64bit Enterprise 1804 English Evaluation", 5 | "Architecture": "x64", 6 | "ImageName": "Windows 10 Enterprise Evaluation", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "https://software-download.microsoft.com/download/pr/17134.1.180410-1804.rs4_release_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso", 10 | "Checksum": "89F6B3079B3669560D29F3C4BE9CC74D", 11 | "CustomData": { 12 | "WindowsOptionalFeature": ["NetFx3"], 13 | "CustomBootstrap": [ 14 | "## Unattend.xml will set the Administrator password, but it won't enable the account on client OSes", 15 | "NET USER Administrator /active:yes;", 16 | "Set-ItemProperty -Path HKLM:\\SOFTWARE\\Microsoft\\PowerShell\\1\\ShellIds\\Microsoft.PowerShell -Name ExecutionPolicy -Value RemoteSigned -Force; #306", 17 | "## Kick-start PowerShell remoting on clients to permit applying DSC configurations", 18 | "Enable-PSRemoting -SkipNetworkProfileCheck -Force;" 19 | ], 20 | "MinimumDismVersion": "10.0.0.0" 21 | }, 22 | "Hotfixes": [] 23 | } 24 | -------------------------------------------------------------------------------- /Config/LegacyMedia/WIN10_x64_Enterprise_1809_EN_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "WIN10_x64_Enterprise_1809_EN_Eval", 3 | "Filename": "WIN10_x64_ENT_RS5_EN_Eval.iso", 4 | "Description": "Windows 10 64bit Enterprise 1809 English Evaluation", 5 | "Architecture": "x64", 6 | "ImageName": "Windows 10 Enterprise Evaluation", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "https://software-download.microsoft.com/download/sg/17763.107.101029-1455.rs5_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso", 10 | "Checksum": "89AB238E51F0AF6E72C8B7115DE03154", 11 | "CustomData": { 12 | "WindowsOptionalFeature": ["NetFx3"], 13 | "CustomBootstrap": [ 14 | "## Unattend.xml will set the Administrator password, but it won't enable the account on client OSes", 15 | "NET USER Administrator /active:yes;", 16 | "Set-ItemProperty -Path HKLM:\\SOFTWARE\\Microsoft\\PowerShell\\1\\ShellIds\\Microsoft.PowerShell -Name ExecutionPolicy -Value RemoteSigned -Force; #306", 17 | "## Kick-start PowerShell remoting on clients to permit applying DSC configurations", 18 | "Enable-PSRemoting -SkipNetworkProfileCheck -Force;" 19 | ], 20 | "MinimumDismVersion": "10.0.0.0" 21 | }, 22 | "Hotfixes": [] 23 | } 24 | -------------------------------------------------------------------------------- /Config/LegacyMedia/WIN10_x64_Enterprise_1903_EN_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "WIN10_x64_Enterprise_1903_EN_Eval", 3 | "Filename": "WIN10_x64_ENT_19H1_EN_Eval.iso", 4 | "Description": "Windows 10 64bit Enterprise 1903 English Evaluation", 5 | "Architecture": "x64", 6 | "ImageName": "Windows 10 Enterprise Evaluation", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "https://software-download.microsoft.com/download/pr/18362.30.190401-1528.19h1_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso", 10 | "Checksum": "70C7E8F0599BBB4526F08E6814925E50", 11 | "CustomData": { 12 | "WindowsOptionalFeature": [ 13 | "NetFx3" 14 | ], 15 | "CustomBootstrap": [ 16 | "## Unattend.xml will set the Administrator password, but it won't enable the account on client OSes", 17 | "NET USER Administrator /active:yes;", 18 | "Set-ItemProperty -Path HKLM:\\SOFTWARE\\Microsoft\\PowerShell\\1\\ShellIds\\Microsoft.PowerShell -Name ExecutionPolicy -Value RemoteSigned -Force; #306", 19 | "## Kick-start PowerShell remoting on clients to permit applying DSC configurations", 20 | "Enable-PSRemoting -SkipNetworkProfileCheck -Force;" 21 | ], 22 | "MinimumDismVersion": "10.0.0.0" 23 | }, 24 | "Hotfixes": [] 25 | } 26 | -------------------------------------------------------------------------------- /Config/LegacyMedia/WIN10_x64_Enterprise_1909_EN_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "WIN10_x64_Enterprise_1909_EN_Eval", 3 | "Filename": "WIN10_x64_ENT_19H2_EN_Eval.iso", 4 | "Description": "Windows 10 64bit Enterprise 1909 English Evaluation", 5 | "Architecture": "x64", 6 | "ImageName": "Windows 10 Enterprise Evaluation", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "https://software-download.microsoft.com/download/pr/18363.418.191007-0143.19h2_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso", 10 | "Checksum": "B3CD4BAE54E74F1CA497216A3F347CA7", 11 | "CustomData": { 12 | "WindowsOptionalFeature": [ 13 | "NetFx3" 14 | ], 15 | "CustomBootstrap": [ 16 | "## Unattend.xml will set the Administrator password, but it won't enable the account on client OSes", 17 | "NET USER Administrator /active:yes;", 18 | "Set-ItemProperty -Path HKLM:\\SOFTWARE\\Microsoft\\PowerShell\\1\\ShellIds\\Microsoft.PowerShell -Name ExecutionPolicy -Value RemoteSigned -Force; #306", 19 | "## Kick-start PowerShell remoting on clients to permit applying DSC configurations", 20 | "Enable-PSRemoting -SkipNetworkProfileCheck -Force;" 21 | ], 22 | "MinimumDismVersion": "10.0.0.0" 23 | }, 24 | "Hotfixes": [] 25 | } 26 | -------------------------------------------------------------------------------- /Config/LegacyMedia/WIN10_x64_Enterprise_2004_EN_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "WIN10_x64_Enterprise_20H1_EN_Eval", 3 | "Filename": "WIN10_x64_ENT_20H1_EN_Eval.iso", 4 | "Description": "Windows 10 64bit Enterprise 2004 English Evaluation", 5 | "Architecture": "x64", 6 | "ImageName": "Windows 10 Enterprise Evaluation", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "https://software-download.microsoft.com/download/pr/19041.264.200511-0456.vb_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso", 10 | "Checksum": "E85637E135E9B6DBC5FA02B463A95764", 11 | "CustomData": { 12 | "WindowsOptionalFeature": ["NetFx3"], 13 | "CustomBootstrap": [ 14 | "## Unattend.xml will set the Administrator password, but it won't enable the account on client OSes", 15 | "NET USER Administrator /active:yes;", 16 | "Set-ItemProperty -Path HKLM:\\SOFTWARE\\Microsoft\\PowerShell\\1\\ShellIds\\Microsoft.PowerShell -Name ExecutionPolicy -Value RemoteSigned -Force; #306", 17 | "## Kick-start PowerShell remoting on clients to permit applying DSC configurations", 18 | "Enable-PSRemoting -SkipNetworkProfileCheck -Force;" 19 | ], 20 | "MinimumDismVersion": "10.0.0.0" 21 | }, 22 | "Hotfixes": [] 23 | } 24 | -------------------------------------------------------------------------------- /Config/LegacyMedia/WIN10_x64_Enterprise_20H2_EN_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "WIN10_x64_Enterprise_20H2_EN_Eval", 3 | "Filename": "WIN10_x64_ENT_20H2_EN_Eval.iso", 4 | "Description": "Windows 10 64bit Enterprise 2009 English Evaluation", 5 | "Architecture": "x64", 6 | "ImageName": "Windows 10 Enterprise Evaluation", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "https://software-download.microsoft.com/download/pr/19042.631.201119-0144.20h2_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso", 10 | "Checksum": "3B5DA0C84DACDB89ABF4502D79CF0CA4", 11 | "CustomData": { 12 | "WindowsOptionalFeature": ["NetFx3"], 13 | "CustomBootstrap": [ 14 | "## Unattend.xml will set the Administrator password, but it won't enable the account on client OSes", 15 | "NET USER Administrator /active:yes;", 16 | "Set-ItemProperty -Path HKLM:\\SOFTWARE\\Microsoft\\PowerShell\\1\\ShellIds\\Microsoft.PowerShell -Name ExecutionPolicy -Value RemoteSigned -Force; #306", 17 | "## Kick-start PowerShell remoting on clients to permit applying DSC configurations", 18 | "Enable-PSRemoting -SkipNetworkProfileCheck -Force;" 19 | ], 20 | "MinimumDismVersion": "10.0.0.0" 21 | }, 22 | "Hotfixes": [] 23 | } 24 | -------------------------------------------------------------------------------- /Config/LegacyMedia/WIN10_x64_Enterprise_21H1_EN_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "WIN10_x64_Enterprise_21H1_EN_Eval", 3 | "Filename": "WIN10_x64_ENT_21H1_EN_Eval.iso", 4 | "Description": "Windows 10 64bit Enterprise 2104/21H1 English Evaluation", 5 | "Architecture": "x64", 6 | "ImageName": "Windows 10 Enterprise Evaluation", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "https://software-download.microsoft.com/download/sg/19043.928.210409-1212.21h1_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso", 10 | "Checksum": "059EABB2DC0886515808E98910E49D13", 11 | "CustomData": { 12 | "WindowsOptionalFeature": ["NetFx3"], 13 | "CustomBootstrap": [ 14 | "## Unattend.xml will set the Administrator password, but it won't enable the account on client OSes", 15 | "NET USER Administrator /active:yes;", 16 | "Set-ItemProperty -Path HKLM:\\SOFTWARE\\Microsoft\\PowerShell\\1\\ShellIds\\Microsoft.PowerShell -Name ExecutionPolicy -Value RemoteSigned -Force; #306", 17 | "## Kick-start PowerShell remoting on clients to permit applying DSC configurations", 18 | "Enable-PSRemoting -SkipNetworkProfileCheck -Force;" 19 | ], 20 | "MinimumDismVersion": "10.0.0.0" 21 | }, 22 | "Hotfixes": [] 23 | } 24 | -------------------------------------------------------------------------------- /Config/LegacyMedia/WIN10_x64_Enterprise_21H2_EN_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "WIN10_x64_Enterprise_21H2_EN_Eval", 3 | "Filename": "WIN10_x64_ENT_21H2_EN_Eval.iso", 4 | "Description": "Windows 10 64bit Enterprise 2109/21H2 English Evaluation", 5 | "Architecture": "x64", 6 | "ImageName": "Windows 10 Enterprise Evaluation", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "https://software-download.microsoft.com/download/sg/444969d5-f34g-4e03-ac9d-1f9786c69161/19044.1288.211006-0501.21h2_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso", 10 | "Checksum": "AE1DA210FFFA81BB6A8DF455ECA9636B", 11 | "CustomData": { 12 | "WindowsOptionalFeature": ["NetFx3"], 13 | "CustomBootstrap": [ 14 | "## Unattend.xml will set the Administrator password, but it won't enable the account on client OSes", 15 | "NET USER Administrator /active:yes;", 16 | "Set-ItemProperty -Path HKLM:\\SOFTWARE\\Microsoft\\PowerShell\\1\\ShellIds\\Microsoft.PowerShell -Name ExecutionPolicy -Value RemoteSigned -Force; #306", 17 | "## Kick-start PowerShell remoting on clients to permit applying DSC configurations", 18 | "Enable-PSRemoting -SkipNetworkProfileCheck -Force;" 19 | ], 20 | "MinimumDismVersion": "10.0.0.0" 21 | }, 22 | "Hotfixes": [] 23 | } 24 | -------------------------------------------------------------------------------- /Config/LegacyMedia/WIN10_x64_Enterprise_LTSB_2016_EN_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "WIN10_x64_Enterprise_LTSB_2016_EN_Eval", 3 | "Filename": "WIN10_x64_ENT_LTSB_2016_EN_Eval.iso", 4 | "Description": "Windows 10 64bit Enterprise LTSB 2016 English Evaluation", 5 | "Architecture": "x64", 6 | "ImageName": "1", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "http://download.microsoft.com/download/1/B/F/1BFE5194-5951-452C-B62C-B2F667F9B86D/14393.0.160715-1616.RS1_RELEASE_CLIENTENTERPRISE_S_EVAL_X64FRE_EN-US.ISO", 10 | "Checksum": "4D4828CB40554278D376F86CBAED0E03", 11 | "CustomData": { 12 | "WindowsOptionalFeature": ["NetFx3"], 13 | "CustomBootstrap": [ 14 | "## Unattend.xml will set the Administrator password, but it won't enable the account on client OSes", 15 | "NET USER Administrator /active:yes;", 16 | "Set-ItemProperty -Path HKLM:\\SOFTWARE\\Microsoft\\PowerShell\\1\\ShellIds\\Microsoft.PowerShell -Name ExecutionPolicy -Value RemoteSigned -Force; #306", 17 | "## Kick-start PowerShell remoting on clients to permit applying DSC configurations", 18 | "Enable-PSRemoting -SkipNetworkProfileCheck -Force;" 19 | ], 20 | "MinimumDismVersion": "10.0.0.0" 21 | }, 22 | "Hotfixes": [] 23 | } 24 | -------------------------------------------------------------------------------- /Config/LegacyMedia/WIN10_x64_Enterprise_LTSC_2019_EN_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "WIN10_x64_Enterprise_LTSC_2019_EN_Eval", 3 | "Filename": "WIN10_x64_ENT_LTSC_2019_EN_Eval.iso", 4 | "Description": "Windows 10 64bit Enterprise LTSC 2019 English Evaluation", 5 | "Architecture": "x64", 6 | "ImageName": "1", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "https://software-download.microsoft.com/download/sg/17763.107.101029-1455.rs5_release_svc_refresh_CLIENT_LTSC_EVAL_x64FRE_en-us.iso", 10 | "Checksum": "B254BA13C50D777E4776A98684E11E11", 11 | "CustomData": { 12 | "WindowsOptionalFeature": ["NetFx3"], 13 | "CustomBootstrap": [ 14 | "## Unattend.xml will set the Administrator password, but it won't enable the account on client OSes", 15 | "NET USER Administrator /active:yes;", 16 | "Set-ItemProperty -Path HKLM:\\SOFTWARE\\Microsoft\\PowerShell\\1\\ShellIds\\Microsoft.PowerShell -Name ExecutionPolicy -Value RemoteSigned -Force; #306", 17 | "## Kick-start PowerShell remoting on clients to permit applying DSC configurations", 18 | "Enable-PSRemoting -SkipNetworkProfileCheck -Force;" 19 | ], 20 | "MinimumDismVersion": "10.0.0.0" 21 | }, 22 | "Hotfixes": [] 23 | } 24 | -------------------------------------------------------------------------------- /Config/LegacyMedia/WIN10_x86_Enterprise_1709_EN_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "WIN10_x86_Enterprise_1709_EN_Eval", 3 | "Filename": "WIN10_x86_ENT_RS3_EN_Eval.iso", 4 | "Description": "Windows 10 32bit Enterprise 1709 English Evaluation", 5 | "Architecture": "x86", 6 | "ImageName": "Windows 10 Enterprise Evaluation", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "http://download.microsoft.com/download/6/5/D/65D18931-F626-4A35-AD5B-F5DA41FE6B76/16299.15.170928-1534.rs3_release_CLIENTENTERPRISEEVAL_OEMRET_x86FRE_en-us.iso", 10 | "Checksum": "F2C39358D7186ADAE6825096C514EDD6", 11 | "CustomData": { 12 | "WindowsOptionalFeature": ["NetFx3"], 13 | "CustomBootstrap": [ 14 | "## Unattend.xml will set the Administrator password, but it won't enable the account on client OSes", 15 | "NET USER Administrator /active:yes;", 16 | "Set-ItemProperty -Path HKLM:\\SOFTWARE\\Microsoft\\PowerShell\\1\\ShellIds\\Microsoft.PowerShell -Name ExecutionPolicy -Value RemoteSigned -Force; #306", 17 | "## Kick-start PowerShell remoting on clients to permit applying DSC configurations", 18 | "Enable-PSRemoting -SkipNetworkProfileCheck -Force;" 19 | ], 20 | "MinimumDismVersion": "10.0.0.0" 21 | }, 22 | "Hotfixes": [] 23 | } 24 | -------------------------------------------------------------------------------- /Config/LegacyMedia/WIN10_x86_Enterprise_1803_EN_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "WIN10_x86_Enterprise_1803_EN_Eval", 3 | "Filename": "WIN10_x86_ENT_RS4_EN_Eval.iso", 4 | "Description": "Windows 10 32bit Enterprise 1804 English Evaluation", 5 | "Architecture": "x86", 6 | "ImageName": "Windows 10 Enterprise Evaluation", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "https://software-download.microsoft.com/download/pr/17134.1.180410-1804.rs4_release_CLIENTENTERPRISEEVAL_OEMRET_x86FRE_en-us.iso", 10 | "Checksum": "F4F85D77516721D9A19CA866172A5ECB", 11 | "CustomData": { 12 | "WindowsOptionalFeature": ["NetFx3"], 13 | "CustomBootstrap": [ 14 | "## Unattend.xml will set the Administrator password, but it won't enable the account on client OSes", 15 | "NET USER Administrator /active:yes;", 16 | "Set-ItemProperty -Path HKLM:\\SOFTWARE\\Microsoft\\PowerShell\\1\\ShellIds\\Microsoft.PowerShell -Name ExecutionPolicy -Value RemoteSigned -Force; #306", 17 | "## Kick-start PowerShell remoting on clients to permit applying DSC configurations", 18 | "Enable-PSRemoting -SkipNetworkProfileCheck -Force;" 19 | ], 20 | "MinimumDismVersion": "10.0.0.0" 21 | }, 22 | "Hotfixes": [] 23 | } 24 | -------------------------------------------------------------------------------- /Config/LegacyMedia/WIN10_x86_Enterprise_1809_EN_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "WIN10_x86_Enterprise_1809_EN_Eval", 3 | "Filename": "WIN10_x86_ENT_RS5_EN_Eval.iso", 4 | "Description": "Windows 10 32bit Enterprise 1809 English Evaluation", 5 | "Architecture": "x86", 6 | "ImageName": "Windows 10 Enterprise Evaluation", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "https://software-download.microsoft.com/download/sg/17763.107.101029-1455.rs5_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x86FRE_en-us.iso", 10 | "Checksum": "6E5BF0A4812EDF06537FBD69E84C7FAB", 11 | "CustomData": { 12 | "WindowsOptionalFeature": ["NetFx3"], 13 | "CustomBootstrap": [ 14 | "## Unattend.xml will set the Administrator password, but it won't enable the account on client OSes", 15 | "NET USER Administrator /active:yes;", 16 | "Set-ItemProperty -Path HKLM:\\SOFTWARE\\Microsoft\\PowerShell\\1\\ShellIds\\Microsoft.PowerShell -Name ExecutionPolicy -Value RemoteSigned -Force; #306", 17 | "## Kick-start PowerShell remoting on clients to permit applying DSC configurations", 18 | "Enable-PSRemoting -SkipNetworkProfileCheck -Force;" 19 | ], 20 | "MinimumDismVersion": "10.0.0.0" 21 | }, 22 | "Hotfixes": [] 23 | } 24 | -------------------------------------------------------------------------------- /Config/LegacyMedia/WIN10_x86_Enterprise_1903_EN_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "WIN10_x86_Enterprise_1903_EN_Eval", 3 | "Filename": "WIN10_x86_ENT_19H1_EN_Eval.iso", 4 | "Description": "Windows 10 32bit Enterprise 1903 English Evaluation", 5 | "Architecture": "x86", 6 | "ImageName": "Windows 10 Enterprise Evaluation", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "https://software-download.microsoft.com/download/pr/18362.30.190401-1528.19h1_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x86FRE_en-us.iso", 10 | "Checksum": "1945092B75613D7822B82D3AFB378F1D", 11 | "CustomData": { 12 | "WindowsOptionalFeature": [ 13 | "NetFx3" 14 | ], 15 | "CustomBootstrap": [ 16 | "## Unattend.xml will set the Administrator password, but it won't enable the account on client OSes", 17 | "NET USER Administrator /active:yes;", 18 | "Set-ItemProperty -Path HKLM:\\SOFTWARE\\Microsoft\\PowerShell\\1\\ShellIds\\Microsoft.PowerShell -Name ExecutionPolicy -Value RemoteSigned -Force; #306", 19 | "## Kick-start PowerShell remoting on clients to permit applying DSC configurations", 20 | "Enable-PSRemoting -SkipNetworkProfileCheck -Force;" 21 | ], 22 | "MinimumDismVersion": "10.0.0.0" 23 | }, 24 | "Hotfixes": [] 25 | } 26 | -------------------------------------------------------------------------------- /Config/LegacyMedia/WIN10_x86_Enterprise_1909_EN_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "WIN10_x86_Enterprise_1909_EN_Eval", 3 | "Filename": "WIN10_x86_ENT_19H2_EN_Eval.iso", 4 | "Description": "Windows 10 32bit Enterprise 1909 English Evaluation", 5 | "Architecture": "x86", 6 | "ImageName": "Windows 10 Enterprise Evaluation", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "https://software-download.microsoft.com/download/pr/18363.418.191007-0143.19h2_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x86FRE_en-us.iso", 10 | "Checksum": "B700FF7684BE392F266B22289CA75979", 11 | "CustomData": { 12 | "WindowsOptionalFeature": [ 13 | "NetFx3" 14 | ], 15 | "CustomBootstrap": [ 16 | "## Unattend.xml will set the Administrator password, but it won't enable the account on client OSes", 17 | "NET USER Administrator /active:yes;", 18 | "Set-ItemProperty -Path HKLM:\\SOFTWARE\\Microsoft\\PowerShell\\1\\ShellIds\\Microsoft.PowerShell -Name ExecutionPolicy -Value RemoteSigned -Force; #306", 19 | "## Kick-start PowerShell remoting on clients to permit applying DSC configurations", 20 | "Enable-PSRemoting -SkipNetworkProfileCheck -Force;" 21 | ], 22 | "MinimumDismVersion": "10.0.0.0" 23 | }, 24 | "Hotfixes": [] 25 | } 26 | -------------------------------------------------------------------------------- /Config/LegacyMedia/WIN10_x86_Enterprise_2004_EN_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "WIN10_x86_Enterprise_20H1_EN_Eval", 3 | "Filename": "WIN10_x86_ENT_20H1_EN_Eval.iso", 4 | "Description": "Windows 10 32bit Enterprise 2004 English Evaluation", 5 | "Architecture": "x86", 6 | "ImageName": "Windows 10 Enterprise Evaluation", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "https://software-download.microsoft.com/download/pr/19041.264.200511-0456.vb_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x86FRE_en-us.iso", 10 | "Checksum": "895283EEA7A5D53A2BD6F071BABBB4F1", 11 | "CustomData": { 12 | "WindowsOptionalFeature": ["NetFx3"], 13 | "CustomBootstrap": [ 14 | "## Unattend.xml will set the Administrator password, but it won't enable the account on client OSes", 15 | "NET USER Administrator /active:yes;", 16 | "Set-ItemProperty -Path HKLM:\\SOFTWARE\\Microsoft\\PowerShell\\1\\ShellIds\\Microsoft.PowerShell -Name ExecutionPolicy -Value RemoteSigned -Force; #306", 17 | "## Kick-start PowerShell remoting on clients to permit applying DSC configurations", 18 | "Enable-PSRemoting -SkipNetworkProfileCheck -Force;" 19 | ], 20 | "MinimumDismVersion": "10.0.0.0" 21 | }, 22 | "Hotfixes": [] 23 | } 24 | -------------------------------------------------------------------------------- /Config/LegacyMedia/WIN10_x86_Enterprise_20H2_EN_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "WIN10_x86_Enterprise_20H2_EN_Eval", 3 | "Filename": "WIN10_x86_ENT_20H2_EN_Eval.iso", 4 | "Description": "Windows 10 32bit Enterprise 2009 English Evaluation", 5 | "Architecture": "x86", 6 | "ImageName": "Windows 10 Enterprise Evaluation", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "https://software-download.microsoft.com/download/pr/19042.631.201119-0144.20h2_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x86FRE_en-us.iso", 10 | "Checksum": "7C4EAAC7A6FE514EA0CB48AE8AC790FE", 11 | "CustomData": { 12 | "WindowsOptionalFeature": ["NetFx3"], 13 | "CustomBootstrap": [ 14 | "## Unattend.xml will set the Administrator password, but it won't enable the account on client OSes", 15 | "NET USER Administrator /active:yes;", 16 | "Set-ItemProperty -Path HKLM:\\SOFTWARE\\Microsoft\\PowerShell\\1\\ShellIds\\Microsoft.PowerShell -Name ExecutionPolicy -Value RemoteSigned -Force; #306", 17 | "## Kick-start PowerShell remoting on clients to permit applying DSC configurations", 18 | "Enable-PSRemoting -SkipNetworkProfileCheck -Force;" 19 | ], 20 | "MinimumDismVersion": "10.0.0.0" 21 | }, 22 | "Hotfixes": [] 23 | } 24 | -------------------------------------------------------------------------------- /Config/LegacyMedia/WIN10_x86_Enterprise_21H1_EN_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "WIN10_x86_Enterprise_21H1_EN_Eval", 3 | "Filename": "WIN10_x86_ENT_21H1_EN_Eval.iso", 4 | "Description": "Windows 10 32bit Enterprise 2104/21H1 English Evaluation", 5 | "Architecture": "x86", 6 | "ImageName": "Windows 10 Enterprise Evaluation", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "https://software-download.microsoft.com/download/sg/19043.928.210409-1212.21h1_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x86FRE_en-us.iso", 10 | "Checksum": "C8201DBBF6B8FFC06DBD854D78FF8337", 11 | "CustomData": { 12 | "WindowsOptionalFeature": ["NetFx3"], 13 | "CustomBootstrap": [ 14 | "## Unattend.xml will set the Administrator password, but it won't enable the account on client OSes", 15 | "NET USER Administrator /active:yes;", 16 | "Set-ItemProperty -Path HKLM:\\SOFTWARE\\Microsoft\\PowerShell\\1\\ShellIds\\Microsoft.PowerShell -Name ExecutionPolicy -Value RemoteSigned -Force; #306", 17 | "## Kick-start PowerShell remoting on clients to permit applying DSC configurations", 18 | "Enable-PSRemoting -SkipNetworkProfileCheck -Force;" 19 | ], 20 | "MinimumDismVersion": "10.0.0.0" 21 | }, 22 | "Hotfixes": [] 23 | } 24 | -------------------------------------------------------------------------------- /Config/LegacyMedia/WIN10_x86_Enterprise_21H2_EN_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "WIN10_x86_Enterprise_21H2_EN_Eval", 3 | "Filename": "WIN10_x86_ENT_21H2_EN_Eval.iso", 4 | "Description": "Windows 10 32bit Enterprise 2109/21H2 English Evaluation", 5 | "Architecture": "x86", 6 | "ImageName": "Windows 10 Enterprise Evaluation", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "https://software-download.microsoft.com/download/sg/444969d5-f34g-4e03-ac9d-1f9786c69161/19044.1288.211006-0501.21h2_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x86FRE_en-us.iso", 10 | "Checksum": "5EE2786AD091B95399A79D46DEF7D43B", 11 | "CustomData": { 12 | "WindowsOptionalFeature": ["NetFx3"], 13 | "CustomBootstrap": [ 14 | "## Unattend.xml will set the Administrator password, but it won't enable the account on client OSes", 15 | "NET USER Administrator /active:yes;", 16 | "Set-ItemProperty -Path HKLM:\\SOFTWARE\\Microsoft\\PowerShell\\1\\ShellIds\\Microsoft.PowerShell -Name ExecutionPolicy -Value RemoteSigned -Force; #306", 17 | "## Kick-start PowerShell remoting on clients to permit applying DSC configurations", 18 | "Enable-PSRemoting -SkipNetworkProfileCheck -Force;" 19 | ], 20 | "MinimumDismVersion": "10.0.0.0" 21 | }, 22 | "Hotfixes": [] 23 | } 24 | -------------------------------------------------------------------------------- /Config/LegacyMedia/WIN10_x86_Enterprise_LTSB_2016_EN_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "WIN10_x86_Enterprise_LTSB_2016_EN_Eval", 3 | "Filename": "WIN10_x86_ENT_LTSB_2016_EN_Eval.iso", 4 | "Description": "Windows 10 32bit Enterprise LTSB 2016 English Evaluation", 5 | "Architecture": "x86", 6 | "ImageName": "1", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "http://download.microsoft.com/download/1/B/F/1BFE5194-5951-452C-B62C-B2F667F9B86D/14393.0.160715-1616.RS1_RELEASE_CLIENTENTERPRISE_S_EVAL_X86FRE_EN-US.ISO", 10 | "Checksum": "D057D6229343CF875D66334A2C06A010", 11 | "CustomData": { 12 | "WindowsOptionalFeature": ["NetFx3"], 13 | "CustomBootstrap": [ 14 | "## Unattend.xml will set the Administrator password, but it won't enable the account on client OSes", 15 | "NET USER Administrator /active:yes;", 16 | "Set-ItemProperty -Path HKLM:\\SOFTWARE\\Microsoft\\PowerShell\\1\\ShellIds\\Microsoft.PowerShell -Name ExecutionPolicy -Value RemoteSigned -Force; #306", 17 | "## Kick-start PowerShell remoting on clients to permit applying DSC configurations", 18 | "Enable-PSRemoting -SkipNetworkProfileCheck -Force;" 19 | ], 20 | "MinimumDismVersion": "10.0.0.0" 21 | }, 22 | "Hotfixes": [] 23 | } 24 | -------------------------------------------------------------------------------- /Config/LegacyMedia/WIN10_x86_Enterprise_LTSC_2019_EN_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "WIN10_x86_Enterprise_LTSC_2019_EN_Eval", 3 | "Filename": "WIN10_x86_ENT_LTSC_2019_EN_Eval.iso", 4 | "Description": "Windows 10 32bit Enterprise LTSC 2019 English Evaluation", 5 | "Architecture": "x86", 6 | "ImageName": "1", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "https://software-download.microsoft.com/download/sg/17763.107.101029-1455.rs5_release_svc_refresh_CLIENT_LTSC_EVAL_x86FRE_en-us.iso", 10 | "Checksum": "51EABBDA9645683F9FF6A620A2014318", 11 | "CustomData": { 12 | "WindowsOptionalFeature": ["NetFx3"], 13 | "CustomBootstrap": [ 14 | "## Unattend.xml will set the Administrator password, but it won't enable the account on client OSes", 15 | "NET USER Administrator /active:yes;", 16 | "Set-ItemProperty -Path HKLM:\\SOFTWARE\\Microsoft\\PowerShell\\1\\ShellIds\\Microsoft.PowerShell -Name ExecutionPolicy -Value RemoteSigned -Force; #306", 17 | "## Kick-start PowerShell remoting on clients to permit applying DSC configurations", 18 | "Enable-PSRemoting -SkipNetworkProfileCheck -Force;" 19 | ], 20 | "MinimumDismVersion": "10.0.0.0" 21 | }, 22 | "Hotfixes": [] 23 | } 24 | -------------------------------------------------------------------------------- /Config/LegacyMedia/WIN11_x64_Enterprise_21H2_EN_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "WIN11_x64_Enterprise_21H2_EN_Eval", 3 | "Filename": "WIN11_x64_ENT_21H2_EN_Eval.iso", 4 | "Description": "Windows 11 64bit Enterprise 21H2 English Evaluation", 5 | "Architecture": "x64", 6 | "ImageName": "1", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "https://software-download.microsoft.com/download/sg/22000.194.210913-1444.co_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso", 10 | "Checksum": "86034E9DA681217E0C7D8A23A27BCF13", 11 | "CustomData": { 12 | "WindowsOptionalFeature": ["NetFx3"], 13 | "CustomBootstrap": [ 14 | "## Unattend.xml will set the Administrator password, but it won't enable the account on client OSes", 15 | "NET USER Administrator /active:yes;", 16 | "Set-ItemProperty -Path HKLM:\\SOFTWARE\\Microsoft\\PowerShell\\1\\ShellIds\\Microsoft.PowerShell -Name ExecutionPolicy -Value RemoteSigned -Force; #306", 17 | "## Kick-start PowerShell remoting on clients to permit applying DSC configurations", 18 | "Enable-PSRemoting -SkipNetworkProfileCheck -Force;" 19 | ], 20 | "MinimumDismVersion": "10.0.0.0" 21 | }, 22 | "Hotfixes": [] 23 | } 24 | -------------------------------------------------------------------------------- /Config/LegacyMedia/WIN11_x64_Enterprise_22H2_EN_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "WIN11_x64_Enterprise_22H2_EN_Eval", 3 | "Filename": "WIN11_x64_ENT_22H2_EN_Eval.iso", 4 | "Description": "Windows 11 64-bit Enterprise 22H2 English Evaluation", 5 | "Architecture": "x64", 6 | "ImageName": "1", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "https://software-static.download.prss.microsoft.com/dbazure/988969d5-f34g-4e03-ac9d-1f9786c66751/22621.525.220925-0207.ni_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso", 10 | "Checksum": "06D32714E332D506E3C565BC08204CAB", 11 | "CustomData": { 12 | "WindowsOptionalFeature": ["NetFx3"], 13 | "CustomBootstrap": [ 14 | "## Unattend.xml will set the Administrator password, but it won't enable the account on client OSes", 15 | "NET USER Administrator /active:yes;", 16 | "Set-ItemProperty -Path HKLM:\\SOFTWARE\\Microsoft\\PowerShell\\1\\ShellIds\\Microsoft.PowerShell -Name ExecutionPolicy -Value RemoteSigned -Force; #306", 17 | "## Kick-start PowerShell remoting on clients to permit applying DSC configurations", 18 | "Enable-PSRemoting -SkipNetworkProfileCheck -Force;" 19 | ], 20 | "MinimumDismVersion": "10.0.0.0" 21 | }, 22 | "Hotfixes": [] 23 | } 24 | -------------------------------------------------------------------------------- /Config/LegacyMedia/WIN11_x64_Enterprise_23H2_EN_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "WIN11_x64_Enterprise_23H2_EN_Eval", 3 | "Filename": "WIN11_x64_ENT_23H2_EN_Eval.iso", 4 | "Description": "Windows 11 64-bit Enterprise 23H2 US English Evaluation", 5 | "Architecture": "x64", 6 | "ImageName": "1", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "https://software-static.download.prss.microsoft.com/dbazure/888969d5-f34g-4e03-ac9d-1f9786c66749/22631.2428.231001-0608.23H2_NI_RELEASE_SVC_REFRESH_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso", 10 | "Checksum": "981426E2651BB45D65D528A63B361977", 11 | "CustomData": { 12 | "WindowsOptionalFeature": ["NetFx3"], 13 | "CustomBootstrap": [ 14 | "## Unattend.xml will set the Administrator password, but it won't enable the account on client OSes", 15 | "NET USER Administrator /active:yes;", 16 | "Set-ItemProperty -Path HKLM:\\SOFTWARE\\Microsoft\\PowerShell\\1\\ShellIds\\Microsoft.PowerShell -Name ExecutionPolicy -Value RemoteSigned -Force; #306", 17 | "## Kick-start PowerShell remoting on clients to permit applying DSC configurations", 18 | "Enable-PSRemoting -SkipNetworkProfileCheck -Force;" 19 | ], 20 | "MinimumDismVersion": "10.0.0.0" 21 | }, 22 | "Hotfixes": [] 23 | } 24 | -------------------------------------------------------------------------------- /Config/LegacyMedia/WIN81_x64_Enterprise_EN_V5_1_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "WIN81_x64_Enterprise_EN_V5_1_Eval", 3 | "Filename": "WIN81_x64_ENT_EN_Eval.iso", 4 | "Description": "Windows 8.1 64bit Enterprise English Evaluation with WMF 5.1", 5 | "Architecture": "x64", 6 | "ImageName": "Windows 8.1 Enterprise Evaluation", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "http://download.microsoft.com/download/B/9/9/B999286E-0A47-406D-8B3D-5B5AD7373A4A/9600.17050.WINBLUE_REFRESH.140317-1640_X64FRE_ENTERPRISE_EVAL_EN-US-IR3_CENA_X64FREE_EN-US_DV9.ISO", 10 | "Checksum": "EE63618E3BE220D86B993C1ABBCF32EB", 11 | "CustomData": { 12 | "WindowsOptionalFeature": ["NetFx3"], 13 | "CustomBootstrap": [ 14 | "## Unattend.xml will set the Administrator password, but it won't enable the account on client OSes", 15 | "NET USER Administrator /active:yes;", 16 | "Set-ItemProperty -Path HKLM:\\SOFTWARE\\Microsoft\\PowerShell\\1\\ShellIds\\Microsoft.PowerShell -Name ExecutionPolicy -Value RemoteSigned -Force; #306", 17 | "## Kick-start PowerShell remoting on clients to permit applying DSC configurations", 18 | "Enable-PSRemoting -SkipNetworkProfileCheck -Force;" 19 | ] 20 | }, 21 | "Hotfixes": [ 22 | { 23 | "Id": "Win8.1AndW2K12R2-KB3191564-x64.msu", 24 | "Uri": "https://download.microsoft.com/download/6/F/5/6F5FF66C-6775-42B0-86C4-47D41F2DA187/Win8.1AndW2K12R2-KB3191564-x64.msu" 25 | } 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /Config/LegacyMedia/WIN81_x64_Enterprise_EN_V5_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "WIN81_x64_Enterprise_EN_V5_Eval", 3 | "Filename": "WIN81_x64_ENT_EN_Eval.iso", 4 | "Description": "Windows 8.1 64bit Enterprise English Evaluation with WMF 5", 5 | "Architecture": "x64", 6 | "ImageName": "Windows 8.1 Enterprise Evaluation", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "http://download.microsoft.com/download/B/9/9/B999286E-0A47-406D-8B3D-5B5AD7373A4A/9600.17050.WINBLUE_REFRESH.140317-1640_X64FRE_ENTERPRISE_EVAL_EN-US-IR3_CENA_X64FREE_EN-US_DV9.ISO", 10 | "Checksum": "EE63618E3BE220D86B993C1ABBCF32EB", 11 | "CustomData": { 12 | "WindowsOptionalFeature": ["NetFx3"], 13 | "CustomBootstrap": [ 14 | "## Unattend.xml will set the Administrator password, but it won't enable the account on client OSes", 15 | "NET USER Administrator /active:yes;", 16 | "Set-ItemProperty -Path HKLM:\\SOFTWARE\\Microsoft\\PowerShell\\1\\ShellIds\\Microsoft.PowerShell -Name ExecutionPolicy -Value RemoteSigned -Force; #306", 17 | "## Kick-start PowerShell remoting on clients to permit applying DSC configurations", 18 | "Enable-PSRemoting -SkipNetworkProfileCheck -Force;" 19 | ] 20 | }, 21 | "Hotfixes": [ 22 | { 23 | "Id": "Win8.1AndW2K12R2-KB3134758-x64.msu", 24 | "Uri": "https://download.microsoft.com/download/2/C/6/2C6E1B4A-EBE5-48A6-B225-2D2058A9CEFB/Win8.1AndW2K12R2-KB3134758-x64.msu" 25 | } 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /Config/LegacyMedia/WIN81_x86_Enterprise_EN_V5_1_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "WIN81_x86_Enterprise_EN_V5_1_Eval", 3 | "Filename": "WIN81_x86_ENT_EN_Eval.iso", 4 | "Description": "Windows 8.1 32bit Enterprise English Evaluation with WMF 5.1", 5 | "Architecture": "x86", 6 | "ImageName": "Windows 8.1 Enterprise Evaluation", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "http://download.microsoft.com/download/B/9/9/B999286E-0A47-406D-8B3D-5B5AD7373A4A/9600.17050.WINBLUE_REFRESH.140317-1640_X86FRE_ENTERPRISE_EVAL_EN-US-IR3_CENA_X86FREE_EN-US_DV9.ISO", 10 | "Checksum": "B2ACCD5F135C3EEDE256D398856AEEAD", 11 | "CustomData": { 12 | "WindowsOptionalFeature": ["NetFx3"], 13 | "CustomBootstrap": [ 14 | "## Unattend.xml will set the Administrator password, but it won't enable the account on client OSes", 15 | "NET USER Administrator /active:yes;", 16 | "Set-ItemProperty -Path HKLM:\\SOFTWARE\\Microsoft\\PowerShell\\1\\ShellIds\\Microsoft.PowerShell -Name ExecutionPolicy -Value RemoteSigned -Force; #306", 17 | "## Kick-start PowerShell remoting on clients to permit applying DSC configurations", 18 | "Enable-PSRemoting -SkipNetworkProfileCheck -Force;" 19 | ] 20 | }, 21 | "Hotfixes": [ 22 | { 23 | "Id": "Win8.1-KB3191564-x86.msu", 24 | "Uri": "https://download.microsoft.com/download/6/F/5/6F5FF66C-6775-42B0-86C4-47D41F2DA187/Win8.1-KB3191564-x86.msu" 25 | } 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /Config/LegacyMedia/WIN81_x86_Enterprise_EN_V5_Eval.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "WIN81_x86_Enterprise_EN_V5_Eval", 3 | "Filename": "WIN81_x86_ENT_EN_Eval.iso", 4 | "Description": "Windows 8.1 32bit Enterprise English Evaluation with WMF 5", 5 | "Architecture": "x86", 6 | "ImageName": "Windows 8.1 Enterprise Evaluation", 7 | "MediaType": "ISO", 8 | "OperatingSystem": "Windows", 9 | "Uri": "http://download.microsoft.com/download/B/9/9/B999286E-0A47-406D-8B3D-5B5AD7373A4A/9600.17050.WINBLUE_REFRESH.140317-1640_X86FRE_ENTERPRISE_EVAL_EN-US-IR3_CENA_X86FREE_EN-US_DV9.ISO", 10 | "Checksum": "B2ACCD5F135C3EEDE256D398856AEEAD", 11 | "CustomData": { 12 | "WindowsOptionalFeature": ["NetFx3"], 13 | "CustomBootstrap": [ 14 | "## Unattend.xml will set the Administrator password, but it won't enable the account on client OSes", 15 | "NET USER Administrator /active:yes;", 16 | "Set-ItemProperty -Path HKLM:\\SOFTWARE\\Microsoft\\PowerShell\\1\\ShellIds\\Microsoft.PowerShell -Name ExecutionPolicy -Value RemoteSigned -Force; #306", 17 | "## Kick-start PowerShell remoting on clients to permit applying DSC configurations", 18 | "Enable-PSRemoting -SkipNetworkProfileCheck -Force;" 19 | ] 20 | }, 21 | "Hotfixes": [ 22 | { 23 | "Id": "Win8.1-KB3134758-x86.msu", 24 | "Uri": "https://download.microsoft.com/download/2/C/6/2C6E1B4A-EBE5-48A6-B225-2D2058A9CEFB/Win8.1-KB3134758-x86.msu" 25 | } 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /Config/VMDefaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "StartupMemory": 2147483648, 3 | "MinimumMemory": 536870912, 4 | "MaximumMemory": 1099511627776, 5 | "ProcessorCount": 1, 6 | "SwitchName": "Default Switch", 7 | "Media": "2022_x64_Datacenter_EN_Eval", 8 | "TimeZone": "UTC", 9 | "UILanguage": "en-US", 10 | "SystemLocale": "en-US", 11 | "InputLocale": "en-US", 12 | "UserLocale": "en-US", 13 | "RegisteredOwner": "Lability", 14 | "RegisteredOrganization": "Virtual Engine", 15 | "ClientCertificatePath": "%ALLUSERSPROFILE%\\Lability\\Certificates\\LabClient.pfx", 16 | "RootCertificatePath": "%ALLUSERSPROFILE%\\Lability\\Certificates\\LabRoot.cer", 17 | "BootOrder": 99, 18 | "BootDelay": 0, 19 | "CustomBootstrapOrder": "MediaFirst", 20 | "UseNetBIOSName": false 21 | } 22 | -------------------------------------------------------------------------------- /DSCResources/xHyper-V/DSCResources/HyperVCommon/en-us/HyperVCommon.strings.psd1: -------------------------------------------------------------------------------- 1 | ConvertFrom-StringData @' 2 | UpdatingVMProperties = Updating VM '{0}' properties. 3 | VMPropertiesUpdated = VM '{0}' properties have been updated. 4 | WaitingForVMIPAddress = Waiting for IP Address for VM '{0}' ... 5 | StoppingVM = Stopping VM '{0}'. 6 | SuspendingVM = Suspending VM '{0}'. 7 | StartingVM = Starting VM '{0}'. 8 | ResumingVM = Resuming VM '{0}'. 9 | 10 | VMStateWillBeOffWarning = VM '{0}' state will be 'OFF' and not 'Paused'. 11 | 12 | CannotUpdatePropertiesOnlineError = Can not change properties for VM '{0}' in '{1}' state unless 'RestartIfNeeded' is set to true. 13 | WaitForVMIPAddressTimeoutError = Waiting for VM '{0}' IP address timed out after {1} seconds. 14 | RoleMissingError = Please ensure that '{0}' role is installed with its PowerShell module. 15 | MoreThanOneVMExistsError = More than one VM with the name '{0}' exists. 16 | '@ 17 | -------------------------------------------------------------------------------- /DSCResources/xHyper-V/DSCResources/MSFT_xVHD/MSFT_xVHD.schema.mof: -------------------------------------------------------------------------------- 1 | [ClassVersion("1.0.0"), FriendlyName("xVHD")] 2 | class MSFT_xVHD : OMI_BaseResource 3 | { 4 | [Key, Description("Name of the VHD File")] String Name; 5 | [Key, Description("Folder where the VHD will be created")] String Path; 6 | [Write, Description("Parent VHD file path, for differencing disk")] String ParentPath; 7 | [Write, Description("Maximum size of Vhd to be created")] Uint64 MaximumSizeBytes; 8 | [Write, Description("Virtual disk format - Vhd or Vhdx"), ValueMap{"Vhd","Vhdx"}, Values{"Vhd","Vhdx"}] String Generation; 9 | [Write, Description("Should the VHD be created or deleted"), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure; 10 | [Read, Description("Virtual Disk Identifier")] String ID; 11 | [Write, Description("Type of Vhd - Dynamic, Fixed, Differencing"), ValueMap{"Dynamic","Fixed","Differencing"}, Values{"Dynamic","Fixed","Differencing"}] String Type; 12 | [Read, Description("Current size of the VHD")] Uint64 FileSizeBytes; 13 | [Read, Description("Is the VHD attached to a VM or not")] Boolean IsAttached; 14 | }; 15 | 16 | -------------------------------------------------------------------------------- /DSCResources/xHyper-V/DSCResources/MSFT_xVMDvdDrive/MSFT_xVMDvdDrive.schema.mof: -------------------------------------------------------------------------------- 1 | [ClassVersion("1.0.0.0"), FriendlyName("xVMDvdDrive")] 2 | class MSFT_xVMDvdDrive : OMI_BaseResource 3 | { 4 | [Key, Description("Specifies the name of the virtual machine to which the DVD drive is to be added.")] String VMName; 5 | [Key, Description("Specifies the number of the controller to which the DVD drive is to be added.")] Uint32 ControllerNumber; 6 | [Key, Description("Specifies the number of the location on the controller at which the DVD drive is to be added.")] Uint32 ControllerLocation; 7 | [Write, Description("Specifies the full path to the virtual hard disk file or physical hard disk volume for the added DVD drive.")] String Path; 8 | [Write, Description("Specifies if the DVD Drive should exist or not."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure; 9 | }; 10 | -------------------------------------------------------------------------------- /DSCResources/xHyper-V/DSCResources/MSFT_xVMHardDiskDrive/MSFT_xVMHardDiskDrive.schema.mof: -------------------------------------------------------------------------------- 1 | [ClassVersion("1.0.0"), FriendlyName("xVMHardDiskDrive")] 2 | class MSFT_xVMHardDiskDrive : OMI_BaseResource 3 | { 4 | [Key, Description("Specifies the name of the virtual machine whose hard disk drive is to be manipulated.")] String VMName; 5 | [Key, Description("Specifies the full path to the location of the VHD that represents the hard disk drive.")] String Path; 6 | [Write, Description("Specifies the controller type - IDE/SCSI where the disk is attached. If not specified, it defaults to SCSI."), ValueMap{"IDE","SCSI"}, Values{"IDE","SCSI"}] String ControllerType; 7 | [Write, Description("Specifies the number of the controller where the disk is attached. If not specified, it defaults to 0."), ValueMap{"0","1","2","3"}, Values{"0","1","2","3"}] Uint32 ControllerNumber; 8 | [Write, Description("Specifies the number of the location on the controller where the disk is attached. If not specified, it defaults to 0.")] Uint32 ControllerLocation; 9 | [Write, Description("Specifies if the hard disk drive must be present or absent. If not specified, it defaults to Present."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure; 10 | }; 11 | -------------------------------------------------------------------------------- /DSCResources/xHyper-V/DSCResources/MSFT_xVMHardDiskDrive/en-US/MSFT_xVMHardDiskDrive.strings.psd1: -------------------------------------------------------------------------------- 1 | ConvertFrom-StringData @' 2 | DiskFound = Found hard disk '{0}' attached to VM '{1}'. 3 | DiskNotFound = Hard disk '{0}' missing from VM '{1}' 4 | CheckingDiskIsAttached = Checking if the disk is already attached to the VM. 5 | CheckingExistingDiskLocation = Checking if there is an existing disk in the specified location. 6 | AddingDisk = Adding the disk '{0}' to VM '{1}'. 7 | RemovingDisk = Removing disk '{0}' from VM '{1}'. 8 | ComparingParameter = Comparing '{0}'; expected '{1}', actual '{2}'. 9 | 10 | DiskPresentError = There is already a disk present in controller '{0}', location '{1}'. 11 | IdeLocationError = ControllerNumber '{0}' or ControllerLocation '{1}' are not valid for IDE controller. 12 | '@ 13 | -------------------------------------------------------------------------------- /DSCResources/xHyper-V/DSCResources/MSFT_xVMHost/en-US/MSFT_xVMHost.psd1: -------------------------------------------------------------------------------- 1 | ConvertFrom-StringData @' 2 | QueryingVMHost = Querying VM host configuration. 3 | PropertyMismatch = Property '{0}' mismatch; expected value '{1}', but was '{2}'. 4 | VMHostInDesiredState = VM host in desired state. 5 | VMHostNotInDesiredState = VM host not in desired state. 6 | UpdatingVMHostProperties = Updating VM host properties. 7 | VMHostPropertiesUpdated = VM host properties have been updated. 8 | EnableLiveMigration = Enabling VM Live Migration. 9 | DisableLiveMigration = Disabling VM Live Migration. 10 | LiveMigrationDomainOnly = Enabling VM Live Migration requires the computer to be joined to an Active Directory domain. 11 | '@ 12 | -------------------------------------------------------------------------------- /DSCResources/xHyper-V/DSCResources/MSFT_xVMNetworkAdapter/MSFT_xVMNetworkAdapter.schema.mof: -------------------------------------------------------------------------------- 1 | 2 | [ClassVersion("2.0.0.0"), FriendlyName("xVMNetworkAdapter")] 3 | class MSFT_xVMNetworkAdapter : OMI_BaseResource 4 | { 5 | [Key] String Id; 6 | [Required] String Name; 7 | [Required] String SwitchName; 8 | [Required] String VMName; 9 | [Write] String MacAddress; 10 | [Write, ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure; 11 | [Read] Boolean DynamicMacAddress; 12 | }; 13 | -------------------------------------------------------------------------------- /DSCResources/xHyper-V/DSCResources/MSFT_xVMProcessor/en-US/MSFT_xVMProcessor.psd1: -------------------------------------------------------------------------------- 1 | ConvertFrom-StringData @' 2 | QueryingVMProcessor = Querying VM '{0}' processor(s). 3 | PropertyMismatch = Property '{0}' mismatch; expected value '{1}', but was '{2}'. 4 | VMProcessorInDesiredState = VM '{0}' processor(s) in desired state. 5 | VMProcessorNotInDesiredState = VM '{0}' processor(s) not in desired state. 6 | UpdatingVMProperties = Updating VM '{0}' properties. 7 | VMPropertiesUpdated = VM '{0}' properties have been updated. 8 | 9 | VMNotFoundError = VM '{0}' was not found. 10 | UnsupportedSystemError = Parameter '{0}' is not supported on operating system builds earlier than '{1}'. 11 | CannotUpdateVmOnlineError = Cannot change online property '{0}' unless 'RestartIfNeeded' is set to true. 12 | '@ 13 | -------------------------------------------------------------------------------- /DSCResources/xHyper-V/DSCResources/MSFT_xVMScsiController/MSFT_xVMScsiController.schema.mof: -------------------------------------------------------------------------------- 1 | [ClassVersion("1.0.0"), FriendlyName("xVMScsiController")] 2 | class MSFT_xVMScsiController : OMI_BaseResource 3 | { 4 | [Key, Description("Specifies the name of the virtual machine whose SCSI controller status is to be controlled")] String VMName; 5 | [Key, Description("Specifies the number of the SCSI controller whose status is to be controlled. If not specified, it defaults to 0."), ValueMap{"0","1","2","3"}, Values{"0","1","2","3"}] Uint32 ControllerNumber; 6 | [Write, Description("Specifies if the SCSI controller should exist or not. If not specified, it defaults to Present."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure; 7 | [Write, Description("Specifies if the VM should be restarted if needed for property changes. If not specified, it defaults to False.")] Boolean RestartIfNeeded; 8 | }; 9 | -------------------------------------------------------------------------------- /DSCResources/xHyper-V/DSCResources/MSFT_xVMScsiController/en-US/MSFT_xVMScsiController.strings.psd1: -------------------------------------------------------------------------------- 1 | ConvertFrom-StringData @' 2 | ControllerFound = Found controller '{0}' attached to VM '{1}'. 3 | ControllerNotFound = Controller '{0}' missing from VM '{1}' 4 | ComparingParameter = Comparing '{0}'; expected '{1}', actual '{2}'. 5 | AddingController = Adding controller number '{0}'. 6 | CheckingExistingDisks = Checking for existing disks on controller '{0}'. 7 | RemovingController = Removing controller '{0}' from VM '{1}'. 8 | 9 | RemovingDiskWarning = Removing disk '{0}' from the controller '{1}'. 10 | 11 | CannotUpdateVmOnlineError = Cannot update a running VM unless 'RestartIfNeeded' is set to true. 12 | CannotAddScsiControllerError = Cannot add controller number '{0}'. Ensure that all intermediate controllers are present on the system. 13 | CannotRemoveScsiControllerError = Cannot remove controller number '{0}'. Ensure that you are removing the last controller to ensure that controller numbers are not reordered. 14 | '@ 15 | -------------------------------------------------------------------------------- /DSCResources/xHyper-V/DSCResources/MSFT_xVMSwitch/MSFT_xVMSwitch.schema.mof: -------------------------------------------------------------------------------- 1 | [ClassVersion("1.0.0.0"), FriendlyName("xVMSwitch")] 2 | class MSFT_xVMSwitch : OMI_BaseResource 3 | { 4 | [Key, Description("Name of the VM Switch")] String Name; 5 | [Key, Description("Type of switch"), ValueMap{"External","Internal","Private"}, Values{"External","Internal","Private"}] String Type; 6 | [Write, Description("Network adapter name(s) for external switch type")] String NetAdapterName[]; 7 | [Write, Description("Specify if the VM host has access to the physical NIC")] Boolean AllowManagementOS; 8 | [Write, Description("Should embedded NIC teaming be used (Windows Server 2016 only)")] Boolean EnableEmbeddedTeaming; 9 | [Write, Description("Type of Bandwidth Reservation Mode to use for the switch"), ValueMap{"Default","Weight","Absolute","None","NA"}, Values{"Default","Weight","Absolute","None","NA"}] String BandwidthReservationMode; 10 | [Write, Description("Specifies the load balancing algorithm that this switch team uses"), ValueMap{"Dynamic","HyperVPort"}, Values{"Dynamic","HyperVPort"}] String LoadBalancingAlgorithm; 11 | [Write, Description("Whether switch should be present or absent"), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure; 12 | [Write, Description("Unique ID for the switch (Only settable on Windows Server 2016!)")] String Id; 13 | [Read, Description("Description of the network interface")] String NetAdapterInterfaceDescription; 14 | }; 15 | -------------------------------------------------------------------------------- /DSCResources/xHyper-V/DSCResources/MSFT_xVhdFileDirectory/MSFT_xVhdFileDirectory.schema.mof: -------------------------------------------------------------------------------- 1 | 2 | [ClassVersion("1.0.0.0")] 3 | Class MSFT_xFileDirectory 4 | { 5 | [Required] string DestinationPath; 6 | [Write] string SourcePath; 7 | [Write,ValueMap{"Present", "Absent"},Values{"Present", "Absent"}] string Ensure; 8 | [Write,ValueMap{"File", "Directory"},Values{"File", "Directory"}] string Type; 9 | [Write] boolean Recurse; 10 | [Write] boolean Force ; 11 | [write] string Content; 12 | [Write,ValueMap{"ReadOnly", "Hidden", "System", "Archive"},Values{"ReadOnly", "Hidden", "System", "Archive"}] string Attributes[]; 13 | }; 14 | 15 | [ClassVersion("1.0.0.0"), FriendlyName("xVhdFile")] 16 | class MSFT_xVhdFileDirectory : OMI_BaseResource 17 | { 18 | [Key, Description("Path to the VHD")] String VhdPath; 19 | [Required, EmbeddedInstance("MSFT_xFileDirectory"), Description("The FileDirectory objects to copy to the VHD")] String FileDirectory[]; 20 | [Write,ValueMap{"ModifiedDate","SHA-1","SHA-256","SHA-512"},Values{"ModifiedDate","SHA-1","SHA-256","SHA-512"}] string CheckSum; 21 | }; 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /DSCResources/xHyper-V/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Microsoft Corporation. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /DSCResources/xPSDesiredStateConfiguration/DSCResources/DSC_xDSCWebService/en-US/DSC_xDSCWebService.strings.psd1: -------------------------------------------------------------------------------- 1 | # culture="en-US" 2 | ConvertFrom-StringData -StringData @' 3 | ThrowCertificateThumbprint = CertificateThumbprint must contain a certificate thumbprint, or "AllowUnencryptedTraffic" to opt-out from being secure. 4 | ThrowUseSecurityBestPractice = Error: Cannot use best practice security settings with unencrypted traffic. Please set UseSecurityBestPractices to $false or use a certificate to encrypt pull server traffic. 5 | FindCertificateBySubjectMultiple = More than one certificate found with subject containing {0} and using template "{1}". 6 | FindCertificateBySubjectNotFound = Certificate not found with subject containing {0} and using template "{1}". 7 | IISInstallationPathNotFound = IIS installation path not found 8 | IISWebAdministrationAssemblyNotFound = IIS version of Microsoft.Web.Administration.dll not found 9 | ConfigFirewallDeprecated = The support for configuring firewall rules is deprecated. Please set ConfigureFirewall to false and use the Firewall resource from NetworkingDSC module to configure required firewall rules. 10 | ThrowApplicationPoolNotFound = IIS Application pool "{0}" not found. 11 | '@ 12 | -------------------------------------------------------------------------------- /DSCResources/xPSDesiredStateConfiguration/DSCResources/DSC_xEnvironmentResource/en-US/DSC_xEnvironmentResource.schema.mfl: -------------------------------------------------------------------------------- 1 | [Description("The xEnvironment resource provides a mechanism to manage machine-wide environment variables.") : Amended,AMENDMENT, LOCALE("MS_409")] 2 | class DSC_xEnvironmentResource : OMI_BaseResource 3 | { 4 | [Key, Description("The name of the environment variable for which you want to ensure a specific state.") : Amended] String Name; 5 | [Description("The desired value for the environment variable.") : Amended] String Value; 6 | [Description("Specifies if the environment varaible should exist.") : Amended] String Ensure; 7 | [Description("Indicates whether or not the environment variable is the Path variable.") : Amended] Boolean Path; 8 | [Description("Indicates the target where the environment variable should be set.") : Amended] String Target[]; 9 | }; 10 | -------------------------------------------------------------------------------- /DSCResources/xPSDesiredStateConfiguration/DSCResources/DSC_xEnvironmentResource/en-US/DSC_xEnvironmentResource.strings.psd1: -------------------------------------------------------------------------------- 1 | # Localized resources for DSC_xEnvironmentResource 2 | 3 | ConvertFrom-StringData @' 4 | ArgumentTooLong = Argument is too long. 5 | CannotSetValueToEmpty = Cannot create environment variable with an empty value. Set Ensure = Absent to remove environment variable '{0}'. 6 | EnvVarCreated = Environment variable '{0}' created with value '{1}'. 7 | EnvVarSetError = Failed to set environment variable '{0}' to value '{1}'. 8 | EnvVarRemoveError = Failed to remove environment variable '{0}' holding value '{1}'. 9 | EnvVarUnchanged = Environment variable '{0}' with value '{1}' was not updated. 10 | EnvVarUpdated = Environment variable '{0}' updated from value '{1}' to value '{2}'. 11 | EnvVarPathUnchanged = Path environment variable '{0}' with value '{1}' was not updated. 12 | EnvVarPathUpdated = Environment variable '{0}' updated from value '{1}' to value '{2}'. 13 | EnvVarNotFound = Environment variable '{0}' does not exist. 14 | EnvVarFound = Environment variable '{0}' with value '{1}' was successfully found. 15 | EnvVarFoundWithMisMatchingValue = Environment variable '{0}' with value '{1}' mismatched the specified value '{2}'. 16 | EnvVarRemoved = Environment variable '{0}' removed. 17 | GetItemPropertyFailure = Failed to get the item property for variable '{0}' with path '{1}'. 18 | RemoveNonExistentVarError = Environment variable '{0}' cannot be removed because it does not exist. 19 | '@ 20 | -------------------------------------------------------------------------------- /DSCResources/xPSDesiredStateConfiguration/DSCResources/DSC_xGroupResource/en-US/DSC_xGroupResource.schema.mfl: -------------------------------------------------------------------------------- 1 | [Description("The xGroup resource provides a mechanism to manage local groups on the target node.") : Amended,AMENDMENT, LOCALE("MS_409")] 2 | class DSC_xGroupResource : OMI_BaseResource 3 | { 4 | [Key,Description("The name of the group to create, modify, or remove.") : Amended] String GroupName; 5 | [Description("Indicates if the group should exist or not.") : Amended] String Ensure; 6 | [Description("The description the group should have.") : Amended] String Description; 7 | [Description("The members the group should have.") : Amended] String Members[]; 8 | [Description("The members the group should include.") : Amended] String MembersToInclude[]; 9 | [Description("The members the group should exclude.") : Amended] String MembersToExclude[]; 10 | [Description("A credential to resolve non-local group members.") : Amended] String Credential; 11 | }; 12 | -------------------------------------------------------------------------------- /DSCResources/xPSDesiredStateConfiguration/DSCResources/DSC_xScriptResource/en-US/DSC_xScriptResource.schema.mfl: -------------------------------------------------------------------------------- 1 | [Description("This resource is used to perform Get, Set and Test functionality on the DSC managed nodes through Powershell scripts. \n") : Amended,AMENDMENT, LOCALE("ms_409")] 2 | class DSC_xScriptResource : OMI_BaseResource 3 | { 4 | [Key,Description("A string that can be used to create a PowerShell script block that retrieves the current state of the resource.") : Amended] String GetScript; 5 | [Key,Description("A string that can be used to create a PowerShell script block that sets the resource to the desired state.") : Amended] String SetScript; 6 | [Key,Description("A string that can be used to create a PowerShell script block that validates whether or not the resource is in the desired state.") : Amended] String TestScript; 7 | [Description("The credential of the user account to run the script under if needed.") : Amended] String Credential; 8 | [Read, Description("The result from the GetScript script block.") : Amended] String DisplayName; 9 | }; 10 | -------------------------------------------------------------------------------- /DSCResources/xPSDesiredStateConfiguration/DSCResources/DSC_xScriptResource/en-US/DSC_xScriptResource.strings.psd1: -------------------------------------------------------------------------------- 1 | # Localized resources for DSC_xScriptResource 2 | 3 | ConvertFrom-StringData @' 4 | GetTargetResourceStartVerboseMessage = Begin executing get script. 5 | GetScriptThrewError = The get script threw an error. 6 | GetScriptDidNotReturnHashtable = The get script did not return a hashtable. 7 | GetTargetResourceEndVerboseMessage = End executing get script. 8 | SetTargetResourceStartVerboseMessage = Begin executing set script. 9 | SetScriptThrewError = The set script threw an error. 10 | SetTargetResourceEndVerboseMessage = End executing set script. 11 | TestTargetResourceStartVerboseMessage = Begin executing test script. 12 | TestScriptThrewError = The test script threw an error. 13 | TestScriptDidNotReturnBoolean = The test script did not return a boolean. 14 | TestTargetResourceEndVerboseMessage = End executing test script. 15 | ExecutingScriptMessage = Executing script: {0} 16 | '@ 17 | -------------------------------------------------------------------------------- /DSCResources/xPSDesiredStateConfiguration/DSCResources/DSC_xUserResource/en-US/DSC_xUserResource.schema.mfl: -------------------------------------------------------------------------------- 1 | [Description("This resource is used to manage local user accounts.") : Amended,AMENDMENT, LOCALE("MS_409")] 2 | class DSC_xUserResource : OMI_BaseResource 3 | { 4 | [Key, Description("The name of the User to Create/Modify/Delete") : Amended] String UserName; 5 | [Write, Description("An enumerated value that describes if the user is expected to exist on the machine, ValueMap{"Present", "Absent"}, Values{"Present", "Absent"}] String Ensure; 6 | [Write, Description("The full name of the user") : Amended] String FullName; 7 | [Write, Description("A description for the user") : Amended] String Description; 8 | [Write, Description("The password for the user"), (EmbeddedInstance("MSFT_Credential") : Amended] String Password; 9 | [Write, Description("Value used to disable/enable a user account") : Amended] Boolean Disabled; 10 | [Write, Description("Value used to set whether a user's password expires or not") : Amended] Boolean PasswordNeverExpires; 11 | [Write, Description("Value used to require a user to change their password") : Amended] Boolean PasswordChangeRequired; 12 | [Write, Description("Value used to set whether a user can/cannot change their password") : Amended] Boolean PasswordChangeNotAllowed; 13 | }; 14 | -------------------------------------------------------------------------------- /DSCResources/xPSDesiredStateConfiguration/DSCResources/DSC_xUserResource/en-US/DSC_xUserResource.strings.psd1: -------------------------------------------------------------------------------- 1 | # Localized resources for DSC_xUserResource 2 | 3 | ConvertFrom-StringData @' 4 | UserWithName = User: {0} 5 | RemoveOperation = Remove 6 | AddOperation = Add 7 | SetOperation = Set 8 | ConfigurationStarted = Configuration of user {0} started. 9 | ConfigurationCompleted = Configuration of user {0} completed successfully. 10 | UserCreated = User {0} created successfully. 11 | UserUpdated = User {0} properties updated successfully. 12 | UserRemoved = User {0} removed successfully. 13 | NoConfigurationRequired = User {0} exists on this node with the desired properties. No action required. 14 | NoConfigurationRequiredUserDoesNotExist = User {0} does not exist on this node. No action required. 15 | InvalidUserName = The name {0} cannot be used. Names may not consist entirely of periods and/or spaces, or contain these characters: {1} 16 | UserExists = A user with the name {0} exists. 17 | UserDoesNotExist = A user with the name {0} does not exist. 18 | PropertyMismatch = The value of the {0} property is expected to be {1} but it is {2}. 19 | PasswordPropertyMismatch = The value of the {0} property does not match. 20 | AllUserPropertisMatch = All {0} {1} properties match. 21 | ConnectionError = There could be a possible connection error while trying to use the System.DirectoryServices API's. 22 | MultipleMatches = There could be a possible multiple matches exception while trying to use the System.DirectoryServices API's. 23 | '@ 24 | -------------------------------------------------------------------------------- /DSCResources/xPSDesiredStateConfiguration/DSCResources/DSC_xWindowsFeature/en-US/DSC_xWindowsFeature.schema.mfl: -------------------------------------------------------------------------------- 1 | [Description("This resource is used to install, uninstall and query roles or features on the DSC managed node.") : Amended,AMENDMENT, LOCALE("MS_409")] 2 | class DSC_xWindowsFeature : OMI_BaseResource 3 | { 4 | [Key, Description("The name of the role or feature to install or uninstall.") : Amended] String Name; 5 | [Write, Description("Specifies whether the role or feature should be installed or uninstalled. To install the feature, set this property to Present. To uninstall the feature, set the property to Absent.") : Amended] String Ensure; 6 | [Write, Description("Specifies whether the subfeatures of the main feature should also be installed.") : Amended] Boolean IncludeAllSubFeature; 7 | [Write, Description("The path to the log file to log this operation.") : Amended] String LogPath; 8 | [Write, Description("A credential, if needed, to install or uninstall the role or feature."), EmbeddedInstance("MSFT_Credential") : Amended] String Credential; 9 | [Read, Description("The display name of the retrieved role or feature.") : Amended] String DisplayName; 10 | }; 11 | 12 | -------------------------------------------------------------------------------- /DSCResources/xPSDesiredStateConfiguration/DSCResources/DSC_xWindowsOptionalFeature/en-US/DSC_xWindowsOptionalFeature.strings.psd1: -------------------------------------------------------------------------------- 1 | # Localized resources for DSC_xWindowsOptionalFeature 2 | 3 | ConvertFrom-StringData @' 4 | DismNotAvailable = PowerShell module DISM could not be imported. 5 | NotSupportedSku = This resource is available only on Windows client operating systems and Windows Server 2012 or later. 6 | ElevationRequired = This resource must run as an Administrator. 7 | ValidatingPrerequisites = Validating resource prerequisites. 8 | CouldNotConvertFeatureState = Could not convert feature state '{0}' into Absent or Present. 9 | RestartNeeded = Target machine needs to restart. 10 | GetTargetResourceStartMessage = Started Get-TargetResource on the '{0}' feature. 11 | GetTargetResourceEndMessage = Finished Get-TargetResource on the '{0}' feature. 12 | SetTargetResourceStartMessage = Started Set-TargetResource on the '{0}' feature. 13 | SetTargetResourceEndMessage = Finished Set-TargetResource on the '{0}' feature. 14 | TestTargetResourceStartMessage = Started Test-TargetResource on the '{0}' feature. 15 | TestTargetResourceEndMessage = Finished Test-TargetResource on the '{0}' feature. 16 | FeatureInstalled = Installed feature '{0}'. 17 | FeatureUninstalled = Uninstalled feature '{0}'. 18 | ShouldProcessEnableFeature = Enable Windows optional feature. 19 | ShouldProcessDisableFeature = Disable Windows optional feature. 20 | '@ 21 | -------------------------------------------------------------------------------- /DSCResources/xPSDesiredStateConfiguration/DSCResources/DSC_xWindowsPackageCab/en-US/DSC_xWindowsPackageCab.schema.mfl: -------------------------------------------------------------------------------- 1 | [Description("This resource is used to install or uninstall a package from a windows cabinet (cab) file.") : Amended,AMENDMENT, LOCALE("MS_409")] 2 | class DSC_xWindowsPackageCab : OMI_BaseResource 3 | { 4 | [Key, Description("The name of the package to install or uninstall.") : Amended] String Name; 5 | [Description("Specifies whether the package should be installed or uninstalled. To install the package, set this property to Present. To uninstall the package, set the property to Absent.") : Amended] String Ensure; 6 | [Description("The path to the cab file to install or uninstall the package from.") : Amended] String SourcePath; 7 | [Description("The path to a file to log the operation to.") : Amended] String LogPath; 8 | }; 9 | -------------------------------------------------------------------------------- /DSCResources/xPSDesiredStateConfiguration/DSCResources/DSC_xWindowsPackageCab/en-US/DSC_xWindowsPackageCab.strings.psd1: -------------------------------------------------------------------------------- 1 | # Localized resources for DSC_xWindowsPackageCab 2 | 3 | ConvertFrom-StringData @' 4 | RetrievingPackage = Retrieving information for the package {0} 5 | PackageEnsureState = The package {0} is currently {1} 6 | SourcePathDoesNotExist = Could not find the source file at path {0} 7 | SetTargetResourceStarting = Starting configuration of the WindowsPackageCab resource {0} 8 | SetTargetResourceFinished = Finished configuration of WindowsPackageCab resource {0} 9 | AddingPackage = Adding a package from the source at path {0} 10 | RemovingPackage = Removing package from the source at path {0} 11 | EnsureStatesMatch = Ensure states match for package {0} 12 | EnsureStatesDoNotMatch = Ensure states do not match for package {0} 13 | '@ 14 | -------------------------------------------------------------------------------- /DSCResources/xPSDesiredStateConfiguration/DSCResources/xFileUpload/xFileUpload.psd1: -------------------------------------------------------------------------------- 1 | @{ 2 | # Script module or binary module file associated with this manifest. 3 | RootModule = 'xFileUpload.schema.psm1' 4 | 5 | # Version number of this module. 6 | ModuleVersion = '1.0.0.0' 7 | 8 | # ID used to uniquely identify this module 9 | GUID = '1fbfd112-4272-4fb8-b31c-fb5b417484bc' 10 | 11 | # Author of this module 12 | Author = 'DSC Community' 13 | 14 | # Company or vendor of this module 15 | CompanyName = 'DSC Community' 16 | 17 | # Copyright statement for this module 18 | Copyright = 'Copyright the DSC Community contributors. All rights reserved.' 19 | 20 | # Description of the functionality provided by this module 21 | Description = '' 22 | 23 | # Minimum version of the Windows PowerShell engine required by this module 24 | PowerShellVersion = '4.0' 25 | } 26 | -------------------------------------------------------------------------------- /DSCResources/xPSDesiredStateConfiguration/DSCResources/xGroupSet/xGroupSet.psd1: -------------------------------------------------------------------------------- 1 | @{ 2 | # Script module or binary module file associated with this manifest. 3 | RootModule = 'xGroupSet.schema.psm1' 4 | 5 | # Version number of this module. 6 | ModuleVersion = '1.0.0.0' 7 | 8 | # ID used to uniquely identify this module 9 | GUID = 'c5e227b5-52dc-4653-b08f-6d94e06bb90b' 10 | 11 | # Author of this module 12 | Author = 'DSC Community' 13 | 14 | # Company or vendor of this module 15 | CompanyName = 'DSC Community' 16 | 17 | # Copyright statement for this module 18 | Copyright = 'Copyright the DSC Community contributors. All rights reserved.' 19 | 20 | # Description of the functionality provided by this module 21 | Description = 'Configures multiple xGroup resources with common settings but different names.' 22 | 23 | # Minimum version of the Windows PowerShell engine required by this module 24 | PowerShellVersion = '4.0' 25 | } 26 | -------------------------------------------------------------------------------- /DSCResources/xPSDesiredStateConfiguration/DSCResources/xProcessSet/xProcessSet.psd1: -------------------------------------------------------------------------------- 1 | @{ 2 | # Script module or binary module file associated with this manifest. 3 | RootModule = 'xProcessSet.schema.psm1' 4 | 5 | # Version number of this module. 6 | ModuleVersion = '1.0.0.0' 7 | 8 | # ID used to uniquely identify this module 9 | GUID = '0cb71def-366f-4f3b-88a9-b9b37d266dd6' 10 | 11 | # Author of this module 12 | Author = 'DSC Community' 13 | 14 | # Company or vendor of this module 15 | CompanyName = 'DSC Community' 16 | 17 | # Copyright statement for this module 18 | Copyright = 'Copyright the DSC Community contributors. All rights reserved.' 19 | 20 | # Description of the functionality provided by this module 21 | Description = 'Provides a mechanism to configure and manage multiple xWindowsProcess resources on a target node.' 22 | 23 | # Minimum version of the Windows PowerShell engine required by this module 24 | PowerShellVersion = '4.0' 25 | } 26 | -------------------------------------------------------------------------------- /DSCResources/xPSDesiredStateConfiguration/DSCResources/xServiceSet/xServiceSet.psd1: -------------------------------------------------------------------------------- 1 | @{ 2 | # Script module or binary module file associated with this manifest. 3 | RootModule = 'xServiceSet.schema.psm1' 4 | 5 | # Version number of this module. 6 | ModuleVersion = '1.0.0.0' 7 | 8 | # ID used to uniquely identify this module 9 | GUID = 'c3ac5e1f-c1fd-4ed0-be24-b271c7062484' 10 | 11 | # Author of this module 12 | Author = 'DSC Community' 13 | 14 | # Company or vendor of this module 15 | CompanyName = 'DSC Community' 16 | 17 | # Copyright statement for this module 18 | Copyright = 'Copyright the DSC Community contributors. All rights reserved.' 19 | 20 | # Description of the functionality provided by this module 21 | Description = 'Allows starting, stopping and change in state or account type for a group of services.' 22 | 23 | # Minimum version of the Windows PowerShell engine required by this module 24 | PowerShellVersion = '4.0' 25 | } 26 | -------------------------------------------------------------------------------- /DSCResources/xPSDesiredStateConfiguration/DSCResources/xWindowsFeatureSet/xWindowsFeatureSet.psd1: -------------------------------------------------------------------------------- 1 | @{ 2 | # Script module or binary module file associated with this manifest. 3 | RootModule = 'xWindowsFeatureSet.schema.psm1' 4 | 5 | # Version number of this module. 6 | ModuleVersion = '1.0.0.0' 7 | 8 | # ID used to uniquely identify this module 9 | GUID = 'b18a27e2-f710-4a4a-92b8-6cd076970eb2' 10 | 11 | # Author of this module 12 | Author = 'DSC Community' 13 | 14 | # Company or vendor of this module 15 | CompanyName = 'DSC Community' 16 | 17 | # Copyright statement for this module 18 | Copyright = 'Copyright the DSC Community contributors. All rights reserved.' 19 | 20 | # Description of the functionality provided by this module 21 | Description = 'Provides a mechanism to configure and manage multiple xWindowsFeature resources on a target node.' 22 | 23 | # Minimum version of the Windows PowerShell engine required by this module 24 | PowerShellVersion = '4.0' 25 | } 26 | -------------------------------------------------------------------------------- /DSCResources/xPSDesiredStateConfiguration/DSCResources/xWindowsOptionalFeatureSet/xWindowsOptionalFeatureSet.psd1: -------------------------------------------------------------------------------- 1 | @{ 2 | # Script module or binary module file associated with this manifest. 3 | RootModule = 'xWindowsOptionalFeatureSet.schema.psm1' 4 | 5 | # Version number of this module. 6 | ModuleVersion = '1.0.0.0' 7 | 8 | # ID used to uniquely identify this module 9 | GUID = 'a88c1458-db46-402c-947b-7d43ab57e27a' 10 | 11 | # Author of this module 12 | Author = 'DSC Community' 13 | 14 | # Company or vendor of this module 15 | CompanyName = 'DSC Community' 16 | 17 | # Copyright statement for this module 18 | Copyright = 'Copyright the DSC Community contributors. All rights reserved.' 19 | 20 | # Description of the functionality provided by this module 21 | Description = 'Provides a mechanism to configure and manage multiple xWindowsOptionalFeature resources on a target node.' 22 | 23 | # Minimum version of the Windows PowerShell engine required by this module 24 | PowerShellVersion = '4.0' 25 | } 26 | -------------------------------------------------------------------------------- /DSCResources/xPSDesiredStateConfiguration/Modules/xPSDesiredStateConfiguration.Common/en-US/xPSDesiredStateConfiguration.Common.strings.psd1: -------------------------------------------------------------------------------- 1 | # Localized resources for xPSDesiredStateConfiguration.Common 2 | 3 | ConvertFrom-StringData @' 4 | PropertyTypeInvalidForDesiredValues = Property 'DesiredValues' must be either a [System.Collections.Hashtable], [CimInstance] or [PSBoundParametersDictionary]. The type detected was {0}. 5 | PropertyTypeInvalidForValuesToCheck = If 'DesiredValues' is a CimInstance, then property 'ValuesToCheck' must contain a value. 6 | PropertyValidationError = Expected to find an array value for property {0} in the current values, but it was either not present or was null. This has caused the test method to return false. 7 | PropertiesDoesNotMatch = Found an array for property {0} in the current values, but this array does not match the desired state. Details of the changes are below. 8 | PropertyThatDoesNotMatch = {0} - {1} 9 | ValueOfTypeDoesNotMatch = {0} value for property {1} does not match. Current state is '{2}' and desired state is '{3}'. 10 | UnableToCompareProperty = Unable to compare property {0} as the type {1} is not handled by the Test-DscParameterState cmdlet. 11 | '@ 12 | -------------------------------------------------------------------------------- /DSCResources/xPSDesiredStateConfiguration/Modules/xPSDesiredStateConfiguration.Firewall/en-US/xPSDesiredStateConfiguration.Firewall.strings.psd1: -------------------------------------------------------------------------------- 1 | # Localized resources for xPSDesiredStateConfiguration.Firewall 2 | 3 | ConvertFrom-StringData @' 4 | '@ 5 | -------------------------------------------------------------------------------- /DSCResources/xPSDesiredStateConfiguration/Modules/xPSDesiredStateConfiguration.PSWSIIS/en-US/xPSDesiredStateConfiguration.PSWSIIS.strings.psd1: -------------------------------------------------------------------------------- 1 | # Localized resources for xPSDesiredStateConfiguration.PSWSIIS 2 | 3 | ConvertFrom-StringData @' 4 | '@ 5 | -------------------------------------------------------------------------------- /DSCResources/xPSDesiredStateConfiguration/Modules/xPSDesiredStateConfiguration.Security/en-US/xPSDesiredStateConfiguration.Security.strings.psd1: -------------------------------------------------------------------------------- 1 | # Localized resources for xPSDesiredStateConfiguration.Firewall 2 | 3 | ConvertFrom-StringData @' 4 | '@ 5 | -------------------------------------------------------------------------------- /DSCResources/xPSDesiredStateConfiguration/ResourceDesignerScripts/GenerateXRemoteFileSchema.ps1: -------------------------------------------------------------------------------- 1 | $DestinationPath = New-xDscResourceProperty -Name DestinationPath -Type String -Attribute Key -Description 'Path under which downloaded or copied file should be accessible after operation.' 2 | $Uri = New-xDscResourceProperty -Name Uri -Type String -Attribute Required -Description 'Uri of a file which should be copied or downloaded. This parameter supports HTTP and HTTPS values.' 3 | $Headers = New-xDscResourceProperty -Name Headers -Type Hashtable[] -Attribute Write -Description 'Headers of the web request.' 4 | $UserAgent = New-xDscResourceProperty -Name UserAgent -Type String -Attribute Write -Description 'User agent for the web request.' 5 | $Ensure = New-xDscResourceProperty -Name Ensure -Type String -Attribute Read -ValidateSet "Present", "Absent" -Description 'Says whether DestinationPath exists on the machine' 6 | $Credential = New-xDscResourceProperty -Name Credential -Type PSCredential -Attribute Write -Description 'Specifies a user account that has permission to send the request.' 7 | 8 | New-xDscResource -Name MSFT_xRemoteFile -Property @($DestinationPath, $Uri, $Headers, $UserAgent, $Ensure, $Credential, $CertificateThumbprint) -ModuleName xPSDesiredStateConfiguration2 -FriendlyName xRemoteFile 9 | 10 | -------------------------------------------------------------------------------- /DSCResources/xPSDesiredStateConfiguration/en-US/about_xPSDesiredStateConfiguration.help.txt: -------------------------------------------------------------------------------- 1 | TOPIC 2 | about_xPSDesiredStateConfiguration 3 | 4 | SHORT DESCRIPTION 5 | DSC resources for configuring common operating systems features, files and 6 | settings. 7 | 8 | LONG DESCRIPTION 9 | This module contains DSC resources for configuring common operating systems 10 | features, files and settings. 11 | 12 | EXAMPLES 13 | PS C:\> Get-DscResource -Module xPSDesiredStateConfiguration 14 | 15 | NOTE: 16 | Thank you to the DSC Community contributors who contributed to this module by 17 | writing code, sharing opinions, and provided feedback. 18 | 19 | TROUBLESHOOTING NOTE: 20 | Go to the Github repository for read about issues, submit a new issue, and read 21 | about new releases. https://github.com/dsccommunity/xPSDesiredStateConfiguration 22 | 23 | SEE ALSO 24 | - https://github.com/dsccommunity/xPSDesiredStateConfiguration 25 | 26 | KEYWORDS 27 | DSC, DscResource, Archive, Environment, Group, MSI, Package, File, 28 | RemoteFile, Registry, Script, Service, User, 29 | WindowsFeature, WindowsOptionalFeature, WindowsPackageCab, WindowsProcess 30 | -------------------------------------------------------------------------------- /DSCResources/xPendingReboot/DSCResources/MSFT_xPendingReboot/MSFT_xPendingReboot.schema.mof: -------------------------------------------------------------------------------- 1 | [ClassVersion("0.1.0.0"), FriendlyName("xPendingReboot")] 2 | class MSFT_xPendingReboot : OMI_BaseResource 3 | { 4 | [key, Description("Name of this pending reboot check")] string Name; 5 | [write, Description("Specifies whether to skip reboots triggered by the Component-Based Servicing component")] boolean SkipComponentBasedServicing; 6 | [read, Description("A value indicating whether the Component-Based Servicing component requested a reboot")] boolean ComponentBasedServicing; 7 | 8 | [write, Description("Specifies whether to skip reboots triggered by Windows Update")] boolean SkipWindowsUpdate; 9 | [read, Description("A value indicating whether Windows Update requested a reboot")] boolean WindowsUpdate; 10 | 11 | [write, Description("Specifies whether to skip pending file rename reboots")] boolean SkipPendingFileRename; 12 | [read, Description("A value indicating whether a pending file rename triggered a reboot")] boolean PendingFileRename; 13 | 14 | [write, Description("Specifies whether to skip reboots triggered by a pending computer rename")] boolean SkipPendingComputerRename; 15 | [read, Description("A value indicating whether a pending computer rename triggered a reboot")] boolean PendingComputerRename; 16 | 17 | [write, Description("Specifies whether to skip reboots triggered by the ConfigMgr client")] boolean SkipCcmClientSDK; 18 | [read, Description("A value indicating whether the ConfigMgr client triggered a reboot")] boolean CcmClientSDK; 19 | }; 20 | 21 | -------------------------------------------------------------------------------- /DSCResources/xPendingReboot/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Microsoft Corporation. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /Examples/BlankMedia.psd1: -------------------------------------------------------------------------------- 1 | @{ 2 | AllNodes = @( 3 | @{ 4 | NodeName = 'BLANKDISK'; 5 | Lability_ProcessorCount = 2; 6 | Lability_Media = 'BlankMedia'; 7 | } 8 | ); 9 | NonNodeData = @{ 10 | Lability = @{ 11 | Media = @( 12 | @{ 13 | Id = 'BlankMedia' 14 | Filename = '' 15 | Description = 'Empty VHD for Linux (or manual Windows) installation' 16 | Architecture = 'x64' 17 | MediaType = 'NULL' 18 | Uri = '' 19 | CustomData = @{ 20 | DiskType = 'Fixed' 21 | DiskSize = 10GB 22 | } 23 | } 24 | ); 25 | }; 26 | }; 27 | }; 28 | -------------------------------------------------------------------------------- /Examples/CustomGenerationMedia.psd1: -------------------------------------------------------------------------------- 1 | @{ 2 | AllNodes = @( 3 | @{ 4 | NodeName = '2012R2GEN1'; 5 | Lability_ProcessorCount = 2; 6 | Lability_Media = '2016_x64_Standard_EN_Eval_Gen1'; 7 | } 8 | ); 9 | NonNodeData = @{ 10 | Lability = @{ 11 | Media = @( 12 | @{ 13 | Id = '2016_x64_Standard_EN_Eval_Gen1'; 14 | Filename = '2016_x64_EN_Eval.iso'; 15 | Description = 'Windows Server 2016 Standard 64bit English Evaluation MBR'; 16 | Architecture = 'x64'; 17 | ImageName = 'Windows Server 2016 SERVERSTANDARD'; 18 | MediaType = 'ISO'; 19 | OperatingSystem = 'Windows'; 20 | Uri = 'http://download.microsoft.com/download/1/6/F/16FA20E6-4662-482A-920B-1A45CF5AAE3C/14393.0.160715-1616.RS1_RELEASE_SERVER_EVAL_X64FRE_EN-US.ISO'; 21 | Checksum = '18A4F00A675B0338F3C7C93C4F131BEB'; 22 | CustomData = @{ 23 | ## Ensure the disk is partitioned with a master boot record 24 | PartitionStyle = 'MBR'; 25 | WindowsOptionalFeature = 'NetFx3'; 26 | ## Override the VM generation 27 | VmGeneration = 1; 28 | } 29 | } 30 | ); 31 | }; 32 | }; 33 | }; 34 | -------------------------------------------------------------------------------- /Examples/DvdDriveEnvironmentVariable.psd1: -------------------------------------------------------------------------------- 1 | @{ 2 | AllNodes = @( 3 | @{ 4 | NodeName = 'DVDDRIVE'; 5 | Lability_Media = '2016_x64_Datacenter_Nano_EN_Eval'; 6 | Lability_SwitchName = 'Internal'; 7 | 8 | ## Attach an ISO file to the default controller in location #1 9 | ## Location #0 is taken by the first/default VHD/X file 10 | Lability_DvdDrive = @{ 11 | ## This will not create a IDE/SCSI controller. Therefore, you must enusre 12 | ## that the target controller already exists and does not already contain a disk 13 | ControllerNumber = 0; 14 | ControllerLocation = 1; 15 | ## Lability can resolve the ISO path using the built-in environment variables 16 | ## NOTE: variable expansion is only available to Lability-specific node properties 17 | Path = '%LabilityConfigurationPath%\DvdDrive.iso'; 18 | } 19 | } 20 | ); 21 | }; 22 | -------------------------------------------------------------------------------- /Examples/ModuleExample.psd1: -------------------------------------------------------------------------------- 1 | @{ 2 | AllNodes = @( 3 | @{ 4 | NodeName = '2012R2'; 5 | 6 | ## Array (list) of modules to inject into the VHD(X). If left empty, 7 | ## all modules defined in the NonNodeData\Lability\Module node will be copied. 8 | Lability_Module = 'PScribo'; 9 | } 10 | ); 11 | NonNodeData = @{ 12 | Lability = @{ 13 | ## The Module node follows the same schema as the DSCResource node (essentially they're the same!) 14 | Module = @( 15 | ## Downloads the latest published module version from the PowerShell Gallery 16 | @{ Name = 'PScribo' } 17 | ## Downloads the development branch of the Lability module directly from Github 18 | @{ Name = 'Lability'; Provider = 'GitHub'; Owner = 'VirtualEngine'; Branch = 'dev'; } 19 | ## Force a download the latest published module version from the PSGallery - every configuration run 20 | @{ Name = 'PSReadLine'; Latest = $true } 21 | ) 22 | }; 23 | }; 24 | }; 25 | -------------------------------------------------------------------------------- /Examples/MultipleNetworkExample.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | .SYNOPSIS 3 | Example configuration for consistently deploying VMs with 4 | multiple network adapters using MAC address for mapping. 5 | #> 6 | configuration MultipleNetworkExample { 7 | param () 8 | 9 | Import-DscResource -ModuleName xNetworking; 10 | 11 | node $AllNodes.NodeName { 12 | 13 | ## Enumerate all MAC addresses of the node 14 | for ($i = 0; $i -lt @($node.Lability_MACAddress).Count; $i++) { 15 | 16 | ## Use the NetAdapterName resource to rename the network adapter 17 | ## to the corresponding 'NICName' using the MAC address key. 18 | xNetAdapterName "RenameNetAdapter$i" { 19 | 20 | NewName = $node.Lability_NICName[$i]; 21 | MacAddress = $node.Lability_MACAddress[$i]; 22 | } 23 | 24 | } #end for 25 | 26 | } #end node 27 | 28 | } #end configuration 29 | -------------------------------------------------------------------------------- /Examples/MultipleNetworkExample.psd1: -------------------------------------------------------------------------------- 1 | @{ 2 | AllNodes = @( 3 | @{ 4 | NodeName = 'MULTINETWORK'; 5 | 6 | ## Hyper-V MAC address range '00-15-5d-00-00-00' thru '00-15-5d-ff-ff-ff'. 7 | ## NOTE: BE CAREFUL OF DUPLICATE MAC ADDRESSES IF USING EXTERNAL SWITCHES! 8 | Lability_MACAddress = '00-15-5d-ff-ff-01', '00-15-5d-ff-ff-02'; 9 | 10 | ## Hyper-V switch name to attach each NIC to. The first network adapter 11 | ## with be attached to the 'Default Switch' virtual switch and given the 12 | ## '00-15-5d-ff-ff-01' MAC address. 13 | Lability_SwitchName = 'Default Switch', 'Internal'; 14 | 15 | ## Name to be given to the NIC (inside the VM) using xNetAdapterName 16 | ## resource. This is implemented in the 'MultipleNetworkExample.ps1' 17 | ## configuration. After renaming the interfaces, these names can then 18 | ## reliably be used in the 'InterfaceAlias' property of xDNSServerAddress, 19 | ## xIPAddress and xDefaultGatewayAddress resources etc. 20 | Lability_NICName = 'Public', 'Management'; 21 | } 22 | ); 23 | NonNodeData = @{ 24 | Lability = @{ 25 | DscResource = @( 26 | @{ Name = 'xNetworking'; RequiredVersion = '5.7.0.0'; } 27 | ) 28 | } 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /Examples/NanoExample.psd1: -------------------------------------------------------------------------------- 1 | @{ 2 | AllNodes = @( 3 | @{ 4 | NodeName = '*'; 5 | InterfaceAlias = 'Ethernet'; 6 | DefaultGateway = '10.0.0.254'; 7 | PrefixLength = 24; 8 | AddressFamily = 'IPv4'; 9 | DnsServerAddress = '10.0.0.1'; 10 | PSDscAllowPlainTextPassword = $true; 11 | Lability_SwitchName = 'Internal'; 12 | } 13 | @{ 14 | NodeName = 'NANO1'; 15 | IPAddress = '10.0.0.10'; 16 | Lability_Media = '2016_x64_Datacenter_Nano_EN_Eval'; 17 | Lability_ProcessorCount = 2; 18 | Lability_StartupMemory = 2GB; 19 | Lability_WarningMessage = "Keyboard layout will be 'EN-US'"; 20 | } 21 | ); 22 | NonNodeData = @{ 23 | Lability = @{ 24 | DSCResource = @( 25 | @{ Name = 'xNetworking'; RequiredVersion = '3.2.0.0'; } 26 | @{ Name = 'xPSDesiredStateConfiguration'; RequiredVersion = '6.0.0.0'; } 27 | ) 28 | }; 29 | }; 30 | }; 31 | -------------------------------------------------------------------------------- /Examples/NestedVirtualizationExample.psd1: -------------------------------------------------------------------------------- 1 | @{ 2 | AllNodes = @( 3 | @{ 4 | NodeName = 'NESTEDHYPERV'; 5 | Lability_StartupMemory = 4GB; 6 | Lability_ProcessorCount = 2; 7 | Lability_Media = 'WIN10_x64_Enterprise_EN_Eval'; 8 | Lability_ProcessorOption = @{ 9 | ## Enable nested virtualization feature using xVMProcessor 10 | ExposeVirtualizationExtensions = $true; 11 | } 12 | } 13 | ); 14 | }; 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2025 Virtual Engine Limited 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Lability.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | lability 5 | Lability 6 | 0.0.0 7 | Iain Brighton 8 | Virtual Engine 9 | The Lability module contains cmdlets for provisioning Hyper-V test lab and development environments. 10 | The Lability module contains cmdlets for provisioning Hyper-V test lab and development environments. 11 | https://github.com/VirtualEngine/Lability 12 | (c) 2025 Virtual Engine Limited. All rights reserved. 13 | https://raw.githubusercontent.com/VirtualEngine/Lability/master/Lability.png 14 | MIT 15 | false 16 | VirtualEngine Lability Powershell Development Build HyperV Hyper-V Test Lab TestLab 17 | 18 | 19 | -------------------------------------------------------------------------------- /Lability.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VirtualEngine/Lability/5faafeeccf22f74da9e8a6d5d31de10fedd59331/Lability.png -------------------------------------------------------------------------------- /Src/Private/Assert-BitLockerFDV.ps1: -------------------------------------------------------------------------------- 1 | function Assert-BitLockerFDV { 2 | <# 3 | .SYNOPSIS 4 | Enables BitLocker full disk write protection (if enabled on the host system) 5 | #> 6 | [CmdletBinding()] 7 | param ( ) 8 | process { 9 | 10 | if ($fdvDenyWriteAccess) { 11 | 12 | Write-Verbose -Message $localized.EnablingBitlockerWriteProtection 13 | Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Policies\Microsoft\FVE' -Name 'FDVDenyWriteAccess' -Value 1 14 | } 15 | 16 | } #end process 17 | } #end function 18 | -------------------------------------------------------------------------------- /Src/Private/Assert-TimeZone.ps1: -------------------------------------------------------------------------------- 1 | function Assert-TimeZone { 2 | <# 3 | .SYNOPSIS 4 | Validates a timezone string. 5 | #> 6 | [CmdletBinding()] 7 | [OutputType([System.String])] 8 | param ( 9 | [Parameter(Mandatory, ValueFromPipeline)] 10 | [System.String] $TimeZone 11 | ) 12 | process { 13 | 14 | try { 15 | 16 | $TZ = [TimeZoneInfo]::FindSystemTimeZoneById($TimeZone) 17 | return $TZ.Id; 18 | } 19 | catch [System.TimeZoneNotFoundException] { 20 | 21 | throw $_; 22 | } 23 | 24 | } #end process 25 | } #end function 26 | -------------------------------------------------------------------------------- /Src/Private/Close-GitHubZipArchive.ps1: -------------------------------------------------------------------------------- 1 | function Close-GitHubZipArchive { 2 | <# 3 | .SYNOPSIS 4 | Tidies up and closes Zip Archive and file handles 5 | #> 6 | [CmdletBinding()] 7 | param () 8 | process { 9 | 10 | Write-Verbose -Message ($localized.ClosingZipArchive -f $Path); 11 | 12 | if ($null -ne $zipArchive) { 13 | 14 | $zipArchive.Dispose(); 15 | } 16 | 17 | if ($null -ne $fileStream) { 18 | 19 | $fileStream.Close(); 20 | } 21 | 22 | } # end process 23 | } #end function 24 | -------------------------------------------------------------------------------- /Src/Private/Close-ZipArchive.ps1: -------------------------------------------------------------------------------- 1 | function Close-ZipArchive { 2 | <# 3 | .SYNOPSIS 4 | Tidies up and closes Zip Archive and file handles 5 | #> 6 | [CmdletBinding()] 7 | param () 8 | process { 9 | 10 | Write-Verbose -Message ($localized.ClosingZipArchive -f $Path); 11 | 12 | if ($null -ne $zipArchive) { 13 | 14 | $zipArchive.Dispose(); 15 | } 16 | 17 | if ($null -ne $fileStream) { 18 | 19 | $fileStream.Close(); 20 | } 21 | 22 | } # end process 23 | } #end function 24 | -------------------------------------------------------------------------------- /Src/Private/ConvertTo-ConfigurationData.ps1: -------------------------------------------------------------------------------- 1 | function ConvertTo-ConfigurationData { 2 | <# 3 | .SYNOPSIS 4 | Converts a file path string to a hashtable. This mimics the -ConfigurationData parameter of the 5 | Start-DscConfiguration cmdlet. 6 | #> 7 | [CmdletBinding()] 8 | [OutputType([System.Collections.Hashtable])] 9 | param ( 10 | [Parameter(Mandatory, ValueFromPipeline)] 11 | [System.String] $ConfigurationData 12 | ) 13 | process { 14 | 15 | $configurationDataPath = Resolve-Path -Path $ConfigurationData -ErrorAction Stop; 16 | if (-not (Test-Path -Path $configurationDataPath -PathType Leaf)) { 17 | 18 | throw ($localized.InvalidConfigurationDataFileError -f $ConfigurationData); 19 | } 20 | elseif ([System.IO.Path]::GetExtension($configurationDataPath) -ne '.psd1') { 21 | 22 | throw ($localized.InvalidConfigurationDataFileError -f $ConfigurationData); 23 | } 24 | $configurationDataContent = Get-Content -Path $configurationDataPath -Raw; 25 | $configData = Invoke-Command -ScriptBlock ([System.Management.Automation.ScriptBlock]::Create($configurationDataContent)); 26 | if ($configData -isnot [System.Collections.Hashtable]) { 27 | 28 | throw ($localized.InvalidConfigurationDataType -f $configData.GetType()); 29 | } 30 | return $configData; 31 | 32 | } #end process 33 | } #end function ConvertTo-ConfigurationData 34 | -------------------------------------------------------------------------------- /Src/Private/Disable-BitLockerFDV.ps1: -------------------------------------------------------------------------------- 1 | function Disable-BitLockerFDV { 2 | <# 3 | .SYNOPSIS 4 | Disables BitLocker full disk write protection (if enabled on the host system) 5 | #> 6 | [CmdletBinding()] 7 | param ( ) 8 | process { 9 | 10 | if ($fdvDenyWriteAccess) { 11 | 12 | Write-Verbose -Message $localized.DisablingBitlockerWriteProtection 13 | Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Policies\Microsoft\FVE' -Name 'FDVDenyWriteAccess' -Value 0; 14 | } 15 | 16 | } #end process 17 | } #end function 18 | -------------------------------------------------------------------------------- /Src/Private/Expand-LabIso.ps1: -------------------------------------------------------------------------------- 1 | function Expand-LabIso { 2 | <# 3 | .SYNOPSIS 4 | Expands an ISO disk image resource 5 | #> 6 | param ( 7 | ## Source ISO file path 8 | [Parameter(Mandatory, ValueFromPipeline)] 9 | [System.String] $Path, 10 | 11 | ## Destination folder path 12 | [Parameter(Mandatory, ValueFromPipelineByPropertyName)] 13 | [System.String] $DestinationPath 14 | ) 15 | process { 16 | 17 | ## Disable BitLocker fixed drive write protection (if enabled) 18 | Disable-BitLockerFDV; 19 | 20 | Write-Verbose -Message ($localized.MountingDiskImage -f $Path); 21 | $iso = Storage\Mount-DiskImage -ImagePath $Path -StorageType ISO -Access ReadOnly -PassThru -Verbose:$false; 22 | ## Refresh drives 23 | [ref] $null = Get-PSDrive; 24 | $isoDriveLetter = $iso | Storage\Get-Volume | Select-Object -ExpandProperty DriveLetter; 25 | $sourcePath = '{0}:\' -f $isoDriveLetter; 26 | Write-Verbose -Message ($localized.ExpandingIsoResource -f $DestinationPath); 27 | CopyDirectory -SourcePath $sourcePath -DestinationPath $DestinationPath -Force -Verbose:$false; 28 | Write-Verbose -Message ($localized.DismountingDiskImage -f $Path); 29 | $null = Storage\Dismount-DiskImage -ImagePath $Path; 30 | 31 | ## Enable BitLocker (if required) 32 | Assert-BitLockerFDV; 33 | 34 | } #end process 35 | } #end function 36 | -------------------------------------------------------------------------------- /Src/Private/Get-DiskImageDriveLetter.ps1: -------------------------------------------------------------------------------- 1 | function Get-DiskImageDriveLetter { 2 | <# 3 | .SYNOPSIS 4 | Return a disk image's associated/mounted drive letter. 5 | #> 6 | [CmdletBinding()] 7 | param ( 8 | [Parameter(Mandatory, ValueFromPipeline)] 9 | [System.Object] $DiskImage, 10 | 11 | [Parameter(Mandatory)] 12 | [ValidateSet('Basic','System','IFS')] 13 | [System.String] $PartitionType 14 | ) 15 | process { 16 | 17 | # Microsoft.Vhd.PowerShell.VirtualHardDisk 18 | $driveLetter = Storage\Get-Partition -DiskNumber $DiskImage.DiskNumber | 19 | Where-Object Type -eq $PartitionType | 20 | Where-Object DriveLetter | 21 | Select-Object -Last 1 -ExpandProperty DriveLetter; 22 | 23 | if (-not $driveLetter) { 24 | 25 | throw ($localized.CannotLocateDiskImageLetter -f $DiskImage.Path); 26 | } 27 | return $driveLetter; 28 | } 29 | } #end function 30 | -------------------------------------------------------------------------------- /Src/Private/Get-FormattedMessage.ps1: -------------------------------------------------------------------------------- 1 | function Get-FormattedMessage { 2 | <# 3 | .SYNOPSIS 4 | Generates a formatted output message with timestamp. 5 | #> 6 | [CmdletBinding()] 7 | param ( 8 | [Parameter(Mandatory, ValueFromPipeline)] 9 | [System.String] $Message 10 | ) 11 | process { 12 | 13 | if (($labDefaults.CallStackLogging) -and ($labDefaults.CallStackLogging -eq $true)) { 14 | 15 | $parentCallStack = (Get-PSCallStack)[1]; # store the parent Call Stack 16 | $functionName = $parentCallStack.FunctionName; 17 | $lineNumber = $parentCallStack.ScriptLineNumber; 18 | $scriptName = ($parentCallStack.Location -split ':')[0]; 19 | $formattedMessage = '[{0}] [Script:{1}] [Function:{2}] [Line:{3}] {4}' -f (Get-Date).ToLongTimeString(), $scriptName, $functionName, $lineNumber, $Message; 20 | } 21 | else { 22 | 23 | $formattedMessage = '[{0}] {1}' -f (Get-Date).ToLongTimeString(), $Message; 24 | } 25 | 26 | return $formattedMessage; 27 | 28 | } #end process 29 | } #end function 30 | -------------------------------------------------------------------------------- /Src/Private/Get-LabDscModule.ps1: -------------------------------------------------------------------------------- 1 | function Get-LabDscModule { 2 | <# 3 | .SYNOPSIS 4 | Locates the directory path of the ResourceName within the specified DSC ModuleName. 5 | #> 6 | [CmdletBinding()] 7 | [OutputType([System.String])] 8 | param ( 9 | [Parameter(Mandatory)] 10 | [System.String] $ModuleName, 11 | 12 | [Parameter()] 13 | [System.String] $ResourceName, 14 | 15 | [Parameter()] 16 | [ValidateNotNullOrEmpty()] 17 | [System.String] $MinimumVersion 18 | ) 19 | process { 20 | 21 | $module = Get-Module -Name $ModuleName -ListAvailable; 22 | $dscModulePath = Split-Path -Path $module.Path -Parent; 23 | 24 | if ($ResourceName) { 25 | 26 | $ModuleName = '{0}\{1}' -f $ModuleName, $ResourceName; 27 | $dscModulePath = Join-Path -Path $dscModulePath -ChildPath "DSCResources\$ResourceName"; 28 | } 29 | 30 | if (-not (Test-Path -Path $dscModulePath)) { 31 | 32 | Write-Error -Message ($localized.DscResourceNotFoundError -f $ModuleName); 33 | return $null; 34 | } 35 | 36 | if ($MinimumVersion) { 37 | 38 | if ($Module.Version -lt [System.Version]$MinimumVersion) { 39 | 40 | Write-Error -Message ($localized.ResourceVersionMismatchError -f $ModuleName, $module.Version.ToString(), $MinimumVersion); 41 | return $null; 42 | } 43 | } 44 | 45 | return $dscModulePath; 46 | 47 | } #end process 48 | } #end function 49 | -------------------------------------------------------------------------------- /Src/Private/Get-LabHostDscConfigurationPath.ps1: -------------------------------------------------------------------------------- 1 | function Get-LabHostDscConfigurationPath { 2 | <# 3 | .SYNOPSIS 4 | Shortcut function to resolve the host's default ConfigurationPath property 5 | #> 6 | [CmdletBinding()] 7 | [OutputType([System.String])] 8 | param ( ) 9 | process { 10 | 11 | $labHostDefaults = Get-ConfigurationData -Configuration Host; 12 | return $labHostDefaults.ConfigurationPath; 13 | 14 | } #end process 15 | } #end function Get-LabHostDscConfigurationPath 16 | 17 | -------------------------------------------------------------------------------- /Src/Private/Get-LabMediaId.ps1: -------------------------------------------------------------------------------- 1 | function Get-LabMediaId 2 | { 3 | <# 4 | .SYNOPSIS 5 | Helper method for dynamic media Id parameters, returning all valid media Ids and Aliases. 6 | #> 7 | [CmdletBinding()] 8 | param( ) 9 | process 10 | { 11 | $availableMedia = Get-LabMedia 12 | $mediaIds = @{ } 13 | foreach ($media in $availableMedia) 14 | { 15 | $mediaIds[$media.Id] = $media.Id 16 | if ($null -ne $media.Alias) 17 | { 18 | if ($mediaIds.ContainsKey($media.Alias)) 19 | { 20 | Write-Warning -Message ($localizedData.DuplicateMediaAliasIgnoredWarning -f $media.Id, $media.Alias) 21 | } 22 | else 23 | { 24 | $mediaIds[$media.Alias] = $media.Alias 25 | } 26 | } 27 | } 28 | return $mediaIds.Keys 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Src/Private/Get-LabModule.ps1: -------------------------------------------------------------------------------- 1 | function Get-LabModule { 2 | <# 3 | .SYNOPSIS 4 | Tests whether an exising PowerShell module meets the minimum or required version 5 | #> 6 | [CmdletBinding()] 7 | [OutputType([System.Boolean])] 8 | param ( 9 | [Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] 10 | [ValidateNotNullOrEmpty()] 11 | [System.String] $Name 12 | ) 13 | process { 14 | 15 | Write-Verbose -Message ($localized.LocatingModule -f $Name); 16 | ## Only return modules in the %ProgramFiles%\WindowsPowerShell\Modules location, ignore other $env:PSModulePaths 17 | $programFiles = [System.Environment]::GetFolderPath('ProgramFiles'); 18 | $modulesPath = ('{0}\WindowsPowerShell\Modules' -f $programFiles).Replace('\','\\'); 19 | $module = Get-Module -Name $Name -ListAvailable -Verbose:$false | Where-Object Path -match $modulesPath; 20 | 21 | if (-not $module) { 22 | Write-Verbose -Message ($localized.ModuleNotFound -f $Name); 23 | } 24 | else { 25 | Write-Verbose -Message ($localized.ModuleFoundInPath -f $module.Path); 26 | } 27 | return $module; 28 | 29 | } #end process 30 | } #end function 31 | -------------------------------------------------------------------------------- /Src/Private/Get-LabVMSnapshot.ps1: -------------------------------------------------------------------------------- 1 | function Get-LabVMSnapshot { 2 | <# 3 | .SYNOPSIS 4 | Gets snapshots of all virtual machines with the specified snapshot name. 5 | #> 6 | [CmdletBinding()] 7 | param ( 8 | ## VM/node name. 9 | [Parameter(Mandatory, ValueFromPipeline)] [ValidateNotNullOrEmpty()] 10 | [System.String[]] $Name, 11 | 12 | ## Snapshot name to restore. 13 | [Parameter(Mandatory, ValueFromPipelineByPropertyName)] [ValidateNotNullOrEmpty()] 14 | [System.String] $SnapshotName 15 | ) 16 | process { 17 | 18 | foreach ($vmName in $Name) { 19 | 20 | $snapshot = Hyper-V\Get-VMSnapshot -VMName $vmName -Name $SnapshotName -ErrorAction SilentlyContinue; 21 | if (-not $snapshot) { 22 | 23 | Write-Warning -Message ($localized.SnapshotMissingWarning -f $SnapshotName, $vmName); 24 | } 25 | else { 26 | 27 | Write-Output -InputObject $snapshot; 28 | } 29 | } #end foreach VM 30 | 31 | } #end process 32 | } #end function 33 | -------------------------------------------------------------------------------- /Src/Private/Get-WindowsImageByIndex.ps1: -------------------------------------------------------------------------------- 1 | function Get-WindowsImageByIndex { 2 | <# 3 | .SYNOPSIS 4 | Locates the specified WIM image name by its index. 5 | #> 6 | [CmdletBinding()] 7 | [OutputType([System.String])] 8 | param ( 9 | # WIM image path 10 | [Parameter(Mandatory, ValueFromPipeline)] 11 | [ValidateNotNullOrEmpty()] 12 | [System.String] $ImagePath, 13 | 14 | # Windows image index 15 | [Parameter(Mandatory, ValueFromPipelineByPropertyName)] 16 | [ValidateNotNullOrEmpty()] 17 | [System.Int32] $ImageIndex 18 | ) 19 | process { 20 | 21 | Write-Verbose -Message ($localized.LocatingWimImageName -f $ImageIndex); 22 | Get-WindowsImage -ImagePath $ImagePath -Verbose:$false | 23 | Where-Object ImageIndex -eq $ImageIndex | 24 | Select-Object -ExpandProperty ImageName; 25 | 26 | } #end process 27 | } #end function Get-WindowsImageByIndex 28 | -------------------------------------------------------------------------------- /Src/Private/Get-WindowsImageByName.ps1: -------------------------------------------------------------------------------- 1 | function Get-WindowsImageByName { 2 | <# 3 | .SYNOPSIS 4 | Locates the specified WIM image index by its name, i.e. SERVERSTANDARD or SERVERDATACENTERSTANDARD. 5 | .OUTPUTS 6 | The WIM image index. 7 | #> 8 | [CmdletBinding()] 9 | [OutputType([System.Int32])] 10 | param ( 11 | # WIM image path 12 | [Parameter(Mandatory, ValueFromPipeline)] 13 | [ValidateNotNullOrEmpty()] 14 | [System.String] $ImagePath, 15 | 16 | # Windows image name 17 | [Parameter(Mandatory, ValueFromPipelineByPropertyName)] 18 | [ValidateNotNullOrEmpty()] 19 | [System.String] $ImageName 20 | ) 21 | process { 22 | 23 | Write-Verbose -Message ($localized.LocatingWimImageIndex -f $ImageName); 24 | Get-WindowsImage -ImagePath $ImagePath -Verbose:$false | 25 | Where-Object ImageName -eq $ImageName | 26 | Select-Object -ExpandProperty ImageIndex; 27 | 28 | } #end process 29 | } #end function Get-WindowsImageByName 30 | -------------------------------------------------------------------------------- /Src/Private/Import-DismModule.ps1: -------------------------------------------------------------------------------- 1 | function Import-DismModule { 2 | <# 3 | .SYNOPSIS 4 | Imports the required DISM dll. 5 | #> 6 | [CmdletBinding()] 7 | param ( ) 8 | process { 9 | 10 | $dismPath = (Get-LabHostDefault).DismPath; 11 | Remove-Module -Name 'Microsoft.Dism.PowerShell' -ErrorAction SilentlyContinue; 12 | $dismModule = Import-Module -Name $dismPath -Force -Scope Global -PassThru -Verbose:$false; 13 | $labDefaults.DismVersion = $dismModule.Version; 14 | Write-Verbose -Message ($localized.LoadedModuleVersion -f 'Dism', $dismModule.Version); 15 | 16 | } #end process 17 | } #end function 18 | -------------------------------------------------------------------------------- /Src/Private/New-DiskImageMbr.ps1: -------------------------------------------------------------------------------- 1 | function New-DiskImageMbr { 2 | <# 3 | .SYNOPSIS 4 | Create a new MBR-formatted disk image. 5 | #> 6 | [CmdletBinding()] 7 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions','')] 8 | param ( 9 | ## Mounted VHD(X) Operating System disk image 10 | [Parameter(Mandatory)] 11 | [ValidateNotNull()] 12 | [System.Object] $Vhd # Microsoft.Vhd.PowerShell.VirtualHardDisk 13 | ) 14 | process { 15 | 16 | ## Temporarily disable Windows Explorer popup disk initialization and format notifications 17 | ## http://blogs.technet.com/b/heyscriptingguy/archive/2013/05/29/use-powershell-to-initialize-raw-disks-and-partition-and-format-volumes.aspx 18 | 19 | Stop-ShellHWDetectionService; 20 | 21 | Write-Verbose -Message ($localized.CreatingDiskPartition -f 'Windows'); 22 | $osPartition = Storage\New-Partition -DiskNumber $Vhd.DiskNumber -UseMaximumSize -MbrType IFS -IsActive | 23 | Storage\Add-PartitionAccessPath -AssignDriveLetter -PassThru | 24 | Storage\Get-Partition; 25 | Write-Verbose -Message ($localized.FormattingDiskPartition -f 'Windows'); 26 | [ref] $null = Storage\Format-Volume -Partition $osPartition -FileSystem NTFS -Force -Confirm:$false; 27 | 28 | Start-ShellHWDetectionService; 29 | 30 | } #end proces 31 | } #end function 32 | -------------------------------------------------------------------------------- /Src/Private/New-DiskPartFat32Partition.ps1: -------------------------------------------------------------------------------- 1 | function New-DiskPartFat32Partition { 2 | <# 3 | .SYNOPSIS 4 | Uses DISKPART.EXE to create a new FAT32 system partition. This permits mocking of DISKPART calls. 5 | #> 6 | [CmdletBinding()] 7 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions','')] 8 | param ( 9 | [Parameter(Mandatory)] 10 | [System.Int32] $DiskNumber, 11 | 12 | [Parameter(Mandatory)] 13 | [System.Int32] $PartitionNumber 14 | ) 15 | process { 16 | 17 | @" 18 | select disk $DiskNumber 19 | select partition $PartitionNumber 20 | format fs=fat32 label="System" 21 | "@ | & "$env:SystemRoot\System32\DiskPart.exe" | Out-Null; 22 | 23 | } #end process 24 | } #end function 25 | -------------------------------------------------------------------------------- /Src/Private/New-LabVMSnapshot.ps1: -------------------------------------------------------------------------------- 1 | function New-LabVMSnapshot { 2 | <# 3 | .SYNOPSIS 4 | Creates a snapshot of all virtual machines with the specified snapshot name. 5 | #> 6 | [CmdletBinding()] 7 | [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions','')] 8 | param ( 9 | [Parameter(Mandatory, ValueFromPipeline)] [ValidateNotNullOrEmpty()] 10 | [System.String[]] $Name, 11 | 12 | [Parameter(Mandatory, ValueFromPipelineByPropertyName)] [ValidateNotNullOrEmpty()] 13 | [System.String] $SnapshotName 14 | ) 15 | process { 16 | foreach ($vmName in $Name) { 17 | 18 | Write-Verbose -Message ($localized.CreatingVirtualMachineSnapshot -f $vmName, $SnapshotName); 19 | Hyper-V\Checkpoint-VM -VMName $vmName -SnapshotName $SnapshotName; 20 | } #end foreach VM 21 | 22 | } #end process 23 | } #end function 24 | -------------------------------------------------------------------------------- /Src/Private/Remove-ConfigurationData.ps1: -------------------------------------------------------------------------------- 1 | function Remove-ConfigurationData { 2 | <# 3 | .SYNOPSIS 4 | Removes custom lab configuration data file. 5 | #> 6 | [CmdletBinding(SupportsShouldProcess)] 7 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSShouldProcess','')] 8 | param ( 9 | [Parameter(Mandatory)] 10 | [ValidateSet('Host','VM','Media','CustomMedia')] 11 | [System.String] $Configuration 12 | ) 13 | process { 14 | 15 | $configurationPath = Resolve-ConfigurationDataPath -Configuration $Configuration; 16 | if (Test-Path -Path $configurationPath) { 17 | Write-Verbose -Message ($localized.ResettingConfigurationDefaults -f $Configuration); 18 | Remove-Item -Path $configurationPath -Force; 19 | } 20 | 21 | } #end process 22 | } # end function Remove-ConfigurationData 23 | -------------------------------------------------------------------------------- /Src/Private/Remove-LabSwitch.ps1: -------------------------------------------------------------------------------- 1 | function Remove-LabSwitch { 2 | <# 3 | .SYNOPSIS 4 | Removes a virtual network switch configuration. 5 | .DESCRIPTION 6 | Deletes a virtual network switch configuration using the xVMSwitch DSC resource. 7 | #> 8 | [CmdletBinding(SupportsShouldProcess)] 9 | param ( 10 | ## Switch Id/Name 11 | [Parameter(Mandatory, ValueFromPipeline)] 12 | [System.String] $Name, 13 | 14 | ## Specifies a PowerShell DSC configuration document (.psd1) containing the lab configuration. 15 | [Parameter(Mandatory, ValueFromPipeline)] 16 | [System.Collections.Hashtable] 17 | [Microsoft.PowerShell.DesiredStateConfiguration.ArgumentToConfigurationDataTransformationAttribute()] 18 | $ConfigurationData 19 | ) 20 | process { 21 | 22 | $networkSwitch = Resolve-LabSwitch @PSBoundParameters; 23 | if (($null -ne $networkSwitch.IsExisting) -and ($networkSwitch.IsExisting -eq $true)) { 24 | 25 | if ($PSCmdlet.ShouldProcess($Name)) { 26 | 27 | $networkSwitch['Ensure'] = 'Absent'; 28 | [ref] $null = $networkSwitch.Remove('IsExisting'); 29 | Import-LabDscResource -ModuleName xHyper-V -ResourceName MSFT_xVMSwitch -Prefix VMSwitch; 30 | [ref] $null = Invoke-LabDscResource -ResourceName VMSwitch -Parameters $networkSwitch; 31 | } 32 | } 33 | 34 | } #end process 35 | } #end function 36 | -------------------------------------------------------------------------------- /Src/Private/Remove-LabVMSnapshot.ps1: -------------------------------------------------------------------------------- 1 | function Remove-LabVMSnapshot { 2 | <# 3 | .SYNOPSIS 4 | Removes a VM snapshot. 5 | #> 6 | [CmdletBinding(SupportsShouldProcess)] 7 | param ( 8 | [Parameter(Mandatory, ValueFromPipeline)] [ValidateNotNullOrEmpty()] 9 | [System.String[]] $Name, 10 | 11 | [Parameter(ValueFromPipelineByPropertyName)] [ValidateNotNullOrEmpty()] 12 | [System.String] $SnapshotName = '*' 13 | ) 14 | process { 15 | <## TODO: Add the ability to force/wait for the snapshots to be removed. When removing snapshots it take a minute 16 | or two before the files are actually removed. This causes issues when performing a lab reset #> 17 | foreach ($vmName in $Name) { 18 | 19 | # Sort by descending CreationTime to ensure we will not have to commit changes from one snapshot to another 20 | Hyper-V\Get-VMSnapshot -VMName $vmName -ErrorAction SilentlyContinue | 21 | Where-Object Name -like $SnapshotName | 22 | Sort-Object -Property CreationTime -Descending | 23 | ForEach-Object { 24 | Write-Verbose -Message ($localized.RemovingSnapshot -f $vmName, $_.Name); 25 | Hyper-V\Remove-VMSnapshot -VMName $_.VMName -Name $_.Name -Confirm:$false; 26 | } 27 | 28 | } #end foreach VM 29 | 30 | } #end process 31 | } #end function 32 | -------------------------------------------------------------------------------- /Src/Private/Reset-LabVMDisk.ps1: -------------------------------------------------------------------------------- 1 | function Reset-LabVMDisk { 2 | <# 3 | .SYNOPSIS 4 | Removes and resets lab VM disk file (VHDX) configuration. 5 | #> 6 | [CmdletBinding()] 7 | [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions','')] 8 | param ( 9 | ## VM/node display name 10 | [Parameter(Mandatory, ValueFromPipeline)] 11 | [System.String] $Name, 12 | 13 | ## Media Id 14 | [Parameter(Mandatory, ValueFromPipelineByPropertyName)] 15 | [System.String] $Media, 16 | 17 | ## VM/node name 18 | [Parameter(ValueFromPipelineByPropertyName)] 19 | [System.String] $NodeName = $Name, 20 | 21 | ## Lab DSC configuration data 22 | [Parameter(ValueFromPipelineByPropertyName)] 23 | [System.Collections.Hashtable] 24 | [Microsoft.PowerShell.DesiredStateConfiguration.ArgumentToConfigurationDataTransformationAttribute()] 25 | $ConfigurationData 26 | ) 27 | process { 28 | 29 | $null = $PSBoundParameters.Remove('NodeName'); 30 | 31 | Remove-LabVMSnapshot -Name $Name; 32 | Remove-LabVMDisk -NodeName $NodeName @PSBoundParameters; 33 | Set-LabVMDisk @PSBoundParameters; 34 | 35 | } #end process 36 | } #end function 37 | -------------------------------------------------------------------------------- /Src/Private/Resolve-DismPath.ps1: -------------------------------------------------------------------------------- 1 | function Resolve-DismPath { 2 | <# 3 | .SYNOPSIS 4 | Resolves the specified path to a path to DISM dll. 5 | #> 6 | [CmdletBinding()] 7 | param ( 8 | [Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] 9 | [System.String] $Path 10 | ) 11 | process { 12 | 13 | if (-not (Test-Path -Path $Path)) { 14 | 15 | ## Path doesn't exist 16 | throw ($localized.InvalidPathError -f 'Directory', $DismPath); 17 | } 18 | else { 19 | 20 | $dismItem = Get-Item -Path $Path; 21 | $dismDllName = 'Microsoft.Dism.Powershell.dll'; 22 | 23 | if ($dismItem.Name -ne $dismDllName) { 24 | 25 | if ($dismItem -is [System.IO.DirectoryInfo]) { 26 | 27 | $dismItemPath = Join-Path -Path $DismPath -ChildPath $dismDllName; 28 | 29 | if (-not (Test-Path -Path $dismItemPath)) { 30 | 31 | throw ($localized.CannotLocateDismDllError -f $Path); 32 | } 33 | else { 34 | 35 | $dismItem = Get-Item -Path $dismItemPath; 36 | } 37 | } 38 | else { 39 | 40 | throw ($localized.InvalidPathError -f 'File', $DismPath); 41 | } 42 | 43 | } 44 | } 45 | 46 | return $dismItem.FullName; 47 | 48 | } #end process 49 | } #end function 50 | -------------------------------------------------------------------------------- /Src/Private/Resolve-GitHubModuleUri.ps1: -------------------------------------------------------------------------------- 1 | function Resolve-GitHubModuleUri { 2 | <# 3 | .SYNOPSIS 4 | Resolves the correct GitHub URI for the specified Owner, Repository and Branch. 5 | #> 6 | [CmdletBinding()] 7 | [OutputType([System.Uri])] 8 | param ( 9 | ## GitHub repository owner 10 | [Parameter(Mandatory, ValueFromPipelineByPropertyName)] 11 | [System.String] $Owner, 12 | 13 | ## GitHub repository name 14 | [Parameter(Mandatory, ValueFromPipelineByPropertyName)] 15 | [System.String] $Repository, 16 | 17 | ## GitHub repository branch 18 | [Parameter(ValueFromPipelineByPropertyName)] [ValidateNotNullOrEmpty()] 19 | [System.String] $Branch = 'master', 20 | 21 | ## Catch all to be able to pass parameter via $PSBoundParameters 22 | [Parameter(ValueFromRemainingArguments)] $RemainingArguments 23 | ) 24 | process { 25 | 26 | $uri = 'https://github.com/{0}/{1}/archive/{2}.zip' -f $Owner, $Repository, $Branch; 27 | return New-Object -TypeName System.Uri -ArgumentList $uri; 28 | 29 | } #end process 30 | } #end function 31 | -------------------------------------------------------------------------------- /Src/Private/Resolve-LabEnvironmentName.ps1: -------------------------------------------------------------------------------- 1 | function Resolve-LabEnvironmentName { 2 | <# 3 | .SYNOPSIS 4 | Resolves a name with an environment prefix and suffix. 5 | #> 6 | [CmdletBinding()] 7 | [OutputType([System.String])] 8 | param ( 9 | ## Switch Id/Name 10 | [Parameter(Mandatory, ValueFromPipeline)] 11 | [System.String] $Name, 12 | 13 | ## PowerShell DSC configuration document (.psd1) containing lab metadata. 14 | [Parameter(Mandatory, ValueFromPipeline)] 15 | [System.Collections.Hashtable] 16 | [Microsoft.PowerShell.DesiredStateConfiguration.ArgumentToConfigurationDataTransformationAttribute()] 17 | $ConfigurationData 18 | ) 19 | process { 20 | 21 | ## Add a prefix if defined 22 | if ($ConfigurationData.NonNodeData.($labDefaults.ModuleName).EnvironmentPrefix) { 23 | 24 | $Name = '{1}{0}' -f $Name, $ConfigurationData.NonNodeData.($labDefaults.ModuleName).EnvironmentPrefix; 25 | } 26 | if ($ConfigurationData.NonNodeData.($labDefaults.ModuleName).EnvironmentSuffix) { 27 | 28 | $Name = '{0}{1}' -f $Name, $ConfigurationData.NonNodeData.($labDefaults.ModuleName).EnvironmentSuffix; 29 | } 30 | 31 | return $Name; 32 | 33 | } #end process 34 | } #end function 35 | -------------------------------------------------------------------------------- /Src/Private/Resolve-LabImage.ps1: -------------------------------------------------------------------------------- 1 | function Resolve-LabImage { 2 | <# 3 | .SYNOPSIS 4 | Resolves a Lability image by its path. 5 | .DESCRIPTION 6 | When running Remove-LabVM there is not always a configuration document supplied. This 7 | causes issues removing a VMs VHD/X file. The ResolveLabImage function locates the image 8 | by its physical path. 9 | #> 10 | [CmdletBinding()] 11 | param ( 12 | [Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] 13 | [System.String] $Path 14 | ) 15 | process { 16 | 17 | $vhdParentPaths = Resolve-VhdHierarchy -VhdPath $Path; 18 | Write-Output (Get-LabImage | Where-Object ImagePath -in $vhdParentPaths); 19 | 20 | } #end process 21 | } #end function Resolve-LabImage 22 | -------------------------------------------------------------------------------- /Src/Private/Resolve-LabResource.ps1: -------------------------------------------------------------------------------- 1 | function Resolve-LabResource { 2 | <# 3 | .SYNOPSIS 4 | Resolves a lab resource by its ID 5 | #> 6 | param ( 7 | ## Specifies a PowerShell DSC configuration document (.psd1) containing the lab configuration. 8 | [Parameter(Mandatory, ValueFromPipeline)] 9 | [System.Collections.Hashtable] 10 | [Microsoft.PowerShell.DesiredStateConfiguration.ArgumentToConfigurationDataTransformationAttribute()] 11 | $ConfigurationData, 12 | 13 | ## Lab resource ID 14 | [Parameter(Mandatory, ValueFromPipelineByPropertyName)] 15 | [ValidateNotNullOrEmpty()] 16 | [System.String] $ResourceId 17 | ) 18 | process { 19 | 20 | $resource = $ConfigurationData.NonNodeData.($labDefaults.ModuleName).Resource | Where-Object Id -eq $ResourceId; 21 | if ($resource) { 22 | 23 | return $resource; 24 | } 25 | else { 26 | 27 | throw ($localized.CannotResolveResourceIdError -f $resourceId); 28 | } 29 | 30 | } #end process 31 | } #end function 32 | -------------------------------------------------------------------------------- /Src/Private/Resolve-LabVMDiskGenerationDiskPath.ps1: -------------------------------------------------------------------------------- 1 | function Resolve-LabVMGenerationDiskPath { 2 | <# 3 | .SYNOPSIS 4 | Resolves the specified VM name's target VHD/X path. 5 | #> 6 | [CmdletBinding()] 7 | param ( 8 | ## VM/node name. 9 | [Parameter(Mandatory, ValueFromPipeline)] 10 | [ValidateNotNullOrEmpty()] 11 | [System.String] $Name, 12 | 13 | ## Media Id 14 | [Parameter(Mandatory, ValueFromPipelineByPropertyName)] 15 | [System.String] $Media, 16 | 17 | ## Lab DSC configuration data 18 | [Parameter(Mandatory, ValueFromPipeline)] 19 | [System.Collections.Hashtable] 20 | [Microsoft.PowerShell.DesiredStateConfiguration.ArgumentToConfigurationDataTransformationAttribute()] 21 | $ConfigurationData 22 | ) 23 | process { 24 | 25 | $image = Get-LabImage -Id $Media -ConfigurationData $ConfigurationData; 26 | 27 | $resolveLabVMDiskPathParams = @{ 28 | Name = $Name; 29 | Generation = $image.Generation; 30 | EnvironmentName = $ConfigurationData.NonNodeData.$($labDefaults.ModuleName).EnvironmentName; 31 | } 32 | $vhdPath = Resolve-LabVMDiskPath @resolveLabVMDiskPathParams 33 | 34 | return $vhdPath; 35 | 36 | } #end process 37 | } #end function 38 | -------------------------------------------------------------------------------- /Src/Private/Resolve-LabVMDiskPath.ps1: -------------------------------------------------------------------------------- 1 | function Resolve-LabVMDiskPath { 2 | <# 3 | .SYNOPSIS 4 | Resolves the specified VM name to it's target VHDX path. 5 | #> 6 | param ( 7 | ## VM/node name. 8 | [Parameter(Mandatory, ValueFromPipeline)] 9 | [ValidateNotNullOrEmpty()] 10 | [System.String] $Name, 11 | 12 | [Parameter()] 13 | [ValidateSet('VHD','VHDX')] 14 | [System.String] $Generation = 'VHDX', 15 | 16 | ## Configuration environment name 17 | [Parameter()] 18 | [AllowNull()] 19 | [System.String] $EnvironmentName, 20 | 21 | ## Return the parent/folder path 22 | [Parameter()] 23 | [System.Management.Automation.SwitchParameter] $Parent 24 | ) 25 | process { 26 | 27 | $hostDefaults = Get-ConfigurationData -Configuration Host; 28 | $differencingVhdPath = $hostDefaults.DifferencingVhdPath; 29 | 30 | if ((-not $hostDefaults.DisableVhdEnvironmentName) -and 31 | (-not [System.String]::IsNullOrEmpty($EnvironmentName))) { 32 | 33 | $differencingVhdPath = Join-Path -Path $differencingVhdPath -ChildPath $EnvironmentName; 34 | } 35 | 36 | if ($Parent) { 37 | 38 | $vhdPath = $differencingVhdPath; 39 | } 40 | else { 41 | 42 | $vhdName = '{0}.{1}' -f $Name, $Generation.ToLower(); 43 | $vhdPath = Join-Path -Path $differencingVhdPath -ChildPath $vhdName; 44 | } 45 | 46 | return $vhdPath; 47 | 48 | } #end process 49 | } #end function 50 | -------------------------------------------------------------------------------- /Src/Private/Resolve-LabVMImage.ps1: -------------------------------------------------------------------------------- 1 | function Resolve-LabVMImage { 2 | <# 3 | .SYNOPSIS 4 | Resolves a virtual machine's Lability image. 5 | #> 6 | [CmdletBinding()] 7 | param ( 8 | ## VM name 9 | [Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] 10 | [System.String] $Name 11 | ) 12 | process { 13 | 14 | Hyper-V\Get-VM -Name $Name | 15 | Hyper-V\Get-VMHardDiskDrive | 16 | Select-Object -First 1 -ExpandProperty $Path | 17 | Resolve-LabImage; 18 | 19 | } #'end process 20 | } #end function Resolve-LabVMImage 21 | -------------------------------------------------------------------------------- /Src/Private/Resolve-PathEx.ps1: -------------------------------------------------------------------------------- 1 | function Resolve-PathEx { 2 | <# 3 | .SYNOPSIS 4 | Resolves the wildcard characters in a path, and displays the path contents, ignoring non-existent paths. 5 | .DESCRIPTION 6 | The Resolve-Path cmdlet interprets the wildcard characters in a path and displays the items and containers at 7 | the location specified by the path, such as the files and folders or registry keys and subkeys. 8 | #> 9 | [CmdletBinding()] 10 | [OutputType([System.String])] 11 | param ( 12 | [Parameter(Mandatory)] 13 | [System.String] $Path 14 | ) 15 | process { 16 | 17 | try { 18 | 19 | $expandedPath = [System.Environment]::ExpandEnvironmentVariables($Path); 20 | $resolvedPath = Resolve-Path -Path $expandedPath -ErrorAction Stop; 21 | $Path = $resolvedPath.ProviderPath; 22 | } 23 | catch [System.Management.Automation.ItemNotFoundException] { 24 | 25 | $Path = [System.Environment]::ExpandEnvironmentVariables($_.TargetObject); 26 | $Error.Remove($Error[-1]); 27 | } 28 | 29 | return $Path; 30 | 31 | } #end process 32 | } #end function 33 | -------------------------------------------------------------------------------- /Src/Private/Resolve-ProgramFilesFolder.ps1: -------------------------------------------------------------------------------- 1 | function Resolve-ProgramFilesFolder { 2 | <# 3 | .SYNOPSIS 4 | Resolves known localized %ProgramFiles% directories. 5 | .LINK 6 | https://en.wikipedia.org/wiki/Program_Files 7 | #> 8 | [CmdletBinding(DefaultParameterSetName = 'Path')] 9 | [OutputType([System.IO.DirectoryInfo])] 10 | param ( 11 | ## Root path to check 12 | [Parameter(Mandatory, ParameterSetName = 'Path')] 13 | [ValidateNotNullOrEmpty()] 14 | [System.String] $Path, 15 | 16 | ## Drive letter 17 | [Parameter(Mandatory, ParameterSetName = 'Drive')] 18 | [ValidateLength(1,1)] 19 | [System.String] $Drive 20 | ) 21 | begin { 22 | 23 | if ($PSCmdlet.ParameterSetName -eq 'Drive') { 24 | 25 | $Path = '{0}:\' -f $Drive; 26 | } 27 | 28 | } 29 | process { 30 | 31 | $knownFolderNames = @( 32 | "Program Files", 33 | "Programmes", 34 | "Archivos de programa", 35 | "Programme", 36 | "Programfájlok", 37 | "Programmi", 38 | "Programmer", 39 | "Program", 40 | "Programfiler", 41 | "Arquivos de Programas", 42 | "Programas" 43 | "Αρχεία Εφαρμογών" 44 | ) 45 | 46 | Get-ChildItem -Path $Path -Directory | 47 | Where-Object Name -in $knownFolderNames | 48 | Select-Object -First 1; 49 | 50 | } #end process 51 | } #end function 52 | -------------------------------------------------------------------------------- /Src/Private/Set-ConfigurationData.ps1: -------------------------------------------------------------------------------- 1 | function Set-ConfigurationData { 2 | <# 3 | .SYNOPSIS 4 | Saves lab configuration data. 5 | #> 6 | [CmdletBinding(SupportsShouldProcess)] 7 | [OutputType([System.Management.Automation.PSCustomObject])] 8 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSShouldProcess','')] 9 | param ( 10 | [Parameter(Mandatory)] 11 | [ValidateSet('Host','VM','Media','CustomMedia')] 12 | [System.String] $Configuration, 13 | 14 | [Parameter(Mandatory, ValueFromPipeline)] 15 | [System.Object] $InputObject 16 | ) 17 | process { 18 | 19 | $configurationPath = Resolve-ConfigurationDataPath -Configuration $Configuration; 20 | [ref] $null = New-Directory -Path (Split-Path -Path $configurationPath -Parent) -Verbose:$false; 21 | Set-Content -Path $configurationPath -Value (ConvertTo-Json -InputObject $InputObject -Depth 5) -Force -Confirm:$false; 22 | 23 | } #end process 24 | } #end function Set-ConfigurationData 25 | -------------------------------------------------------------------------------- /Src/Private/Set-DiskImageBootVolume.ps1: -------------------------------------------------------------------------------- 1 | function Set-DiskImageBootVolume { 2 | <# 3 | .SYNOPSIS 4 | Sets the boot volume of a mounted disk image. 5 | #> 6 | [CmdletBinding()] 7 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions','')] 8 | param ( 9 | ## Mounted VHD(X) Operating System disk image 10 | [Parameter(Mandatory)] 11 | [System.Object] $Vhd, # Microsoft.Vhd.PowerShell.VirtualHardDisk 12 | 13 | ## Disk image partition scheme 14 | [Parameter(Mandatory)] 15 | [ValidateSet('MBR','GPT')] 16 | [System.String] $PartitionStyle 17 | ) 18 | process { 19 | 20 | switch ($PartitionStyle) { 21 | 22 | 'MBR' { 23 | 24 | Set-DiskImageBootVolumeMbr -Vhd $Vhd; 25 | break; 26 | } 27 | 'GPT' { 28 | 29 | Set-DiskImageBootVolumeGpt -Vhd $Vhd; 30 | break; 31 | } 32 | } #end switch 33 | 34 | } #end process 35 | } #end function 36 | -------------------------------------------------------------------------------- /Src/Private/Set-LabDscResource.ps1: -------------------------------------------------------------------------------- 1 | function Set-LabDscResource { 2 | <# 3 | .SYNOPSIS 4 | Runs the ResourceName DSC resource ensuring it's in the desired state. 5 | .DESCRIPTION 6 | The Set-LabDscResource cmdlet invokes the target $ResourceName\Set-TargetResource function using the supplied 7 | $Parameters hastable. 8 | #> 9 | [CmdletBinding()] 10 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions','')] 11 | param ( 12 | ## Name of the DSC resource to invoke 13 | [Parameter(Mandatory, ValueFromPipeline)] 14 | [System.String] $ResourceName, 15 | 16 | ## The DSC resource's Set-TargetResource parameter hashtable 17 | [Parameter(Mandatory)] 18 | [System.Collections.Hashtable] $Parameters 19 | ) 20 | process { 21 | 22 | $setTargetResourceCommand = 'Set-{0}TargetResource' -f $ResourceName; 23 | Write-Debug ($localized.InvokingCommand -f $setTargetResourceCommand); 24 | $Parameters.Keys | ForEach-Object { 25 | 26 | Write-Debug -Message ($localized.CommandParameter -f $_, $Parameters.$_); 27 | } 28 | 29 | try { 30 | 31 | $setDscResourceResult = & $setTargetResourceCommand @Parameters; 32 | } 33 | catch { 34 | 35 | Write-Warning -Message ($localized.DscResourceFailedError -f $setTargetResourceCommand, $_); 36 | } 37 | 38 | return $setDscResourceResult; 39 | 40 | } #end process 41 | } #end function 42 | -------------------------------------------------------------------------------- /Src/Private/Set-LabSwitch.ps1: -------------------------------------------------------------------------------- 1 | function Set-LabSwitch { 2 | <# 3 | .SYNOPSIS 4 | Sets/invokes a virtual network switch configuration. 5 | .DESCRIPTION 6 | Sets/invokes a virtual network switch configuration using the xVMSwitch DSC resource. 7 | #> 8 | [CmdletBinding()] 9 | [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions','')] 10 | param ( 11 | ## Switch Id/Name 12 | [Parameter(Mandatory, ValueFromPipeline)] 13 | [System.String] $Name, 14 | 15 | ## PowerShell DSC configuration document (.psd1) containing lab metadata. 16 | [Parameter(Mandatory, ValueFromPipeline)] 17 | [System.Collections.Hashtable] 18 | [Microsoft.PowerShell.DesiredStateConfiguration.ArgumentToConfigurationDataTransformationAttribute()] 19 | $ConfigurationData 20 | ) 21 | process { 22 | 23 | $networkSwitch = Resolve-LabSwitch @PSBoundParameters; 24 | if (($null -eq $networkSwitch.IsExisting) -or ($networkSwitch.IsExisting -eq $false)) { 25 | 26 | Import-LabDscResource -ModuleName xHyper-V -ResourceName MSFT_xVMSwitch -Prefix VMSwitch; 27 | [ref] $null = Invoke-LabDscResource -ResourceName VMSwitch -Parameters $networkSwitch; 28 | } 29 | 30 | } #end process 31 | } #end function 32 | -------------------------------------------------------------------------------- /Src/Private/Set-ResourceChecksum.ps1: -------------------------------------------------------------------------------- 1 | function Set-ResourceChecksum { 2 | <# 3 | .SYNOPSIS 4 | Creates a resource's checksum file. 5 | #> 6 | [CmdletBinding()] 7 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions','')] 8 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingBrokenHashAlgorithms','')] 9 | param ( 10 | ## Path of file to create the checksum of 11 | [Parameter(Mandatory, ValueFromPipeline)] 12 | [System.String] $Path 13 | ) 14 | process { 15 | 16 | $checksumPath = '{0}.checksum' -f $Path; 17 | ## As it can take a long time to calculate the checksum, write it out to disk for future reference 18 | Write-Verbose -Message ($localized.CalculatingResourceChecksum -f $checksumPath); 19 | $fileHash = Get-FileHash -Path $Path -Algorithm MD5 -ErrorAction Stop | Select-Object -ExpandProperty Hash; 20 | Write-Verbose -Message ($localized.WritingResourceChecksum -f $fileHash, $checksumPath); 21 | $fileHash | Set-Content -Path $checksumPath -Force; 22 | 23 | } #end process 24 | } #end function 25 | -------------------------------------------------------------------------------- /Src/Private/Start-ShellHWDetectionService.ps1: -------------------------------------------------------------------------------- 1 | function Start-ShellHWDetectionService { 2 | <# 3 | .SYNOPSIS 4 | Starts the ShellHWDetectionService - if present! 5 | #> 6 | [CmdletBinding()] 7 | [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions','')] 8 | param ( ) 9 | process { 10 | 11 | if (Get-Service -Name 'ShellHWDetection' -ErrorAction SilentlyContinue) { 12 | 13 | Start-Service -Name 'ShellHWDetection' -ErrorAction Ignore -Confirm:$false; 14 | } 15 | 16 | } #end process 17 | } #end function Start-ShellHWDetectionService 18 | -------------------------------------------------------------------------------- /Src/Private/Stop-ShellHWDetectionService.ps1: -------------------------------------------------------------------------------- 1 | function Stop-ShellHWDetectionService { 2 | <# 3 | .SYNOPSIS 4 | Stops the ShellHWDetectionService - if present! 5 | #> 6 | [CmdletBinding()] 7 | [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions','')] 8 | param ( ) 9 | process { 10 | 11 | if (Get-Service -Name 'ShellHWDetection' -ErrorAction SilentlyContinue) { 12 | 13 | Stop-Service -Name 'ShellHWDetection' -Force -ErrorAction Ignore -Confirm:$false; 14 | } 15 | 16 | } #end process 17 | } #end function Stop-ShellHWDetectionService 18 | -------------------------------------------------------------------------------- /Src/Private/Test-ComputerName.ps1: -------------------------------------------------------------------------------- 1 | function Test-ComputerName { 2 | <# 3 | .SYNOPSIS 4 | Validates a computer name is valid. 5 | #> 6 | [CmdletBinding()] 7 | [OutputType([System.Boolean])] 8 | param ( 9 | [Parameter(Mandatory, ValueFromPipeline)] 10 | [ValidateLength(1, 15)] 11 | [System.String] $ComputerName 12 | ) 13 | process { 14 | 15 | $invalidMatch = '[~!@#\$%\^&\*\(\)=\+_\[\]{}\\\|;:.''",<>\/\?\s]'; 16 | return ($ComputerName -inotmatch $invalidMatch); 17 | 18 | } 19 | } #end function 20 | -------------------------------------------------------------------------------- /Src/Private/Test-ConfigurationPath.ps1: -------------------------------------------------------------------------------- 1 | function Test-ConfigurationPath { 2 | <# 3 | .SYNOPSIS 4 | Tests the specified path for a computer's .mof file. 5 | #> 6 | [CmdletBinding()] 7 | [OutputType([System.Boolean])] 8 | param ( 9 | ## Lab vm/node name 10 | [Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] 11 | [ValidateNotNullOrEmpty()] 12 | [System.String] $Name, 13 | 14 | ## Defined .mof path 15 | [Parameter(Mandatory, ValueFromPipelineByPropertyName)] 16 | [AllowEmptyString()] 17 | [System.String] $Path 18 | ) 19 | process { 20 | 21 | $searchString = '{0}.*mof' -f $Name; 22 | $searchPath = Join-Path -Path $Path -ChildPath $searchString; 23 | Write-Debug -Message ("Searching configuration path '{0}'." -f $searchPath); 24 | 25 | if (Get-ChildItem -Path $searchPath -ErrorAction SilentlyContinue) { 26 | 27 | return $true; 28 | } 29 | 30 | return $false; 31 | 32 | } #end process 33 | } #end function Test-ConfigurationPath 34 | -------------------------------------------------------------------------------- /Src/Private/Test-LabDscModule.ps1: -------------------------------------------------------------------------------- 1 | function Test-LabDscModule { 2 | <# 3 | .SYNOPSIS 4 | Tests whether the ResourceName of the specified ModuleName can be located on the system. 5 | #> 6 | [CmdletBinding()] 7 | [OutputType([System.Boolean])] 8 | param ( 9 | [Parameter(Mandatory)] 10 | [System.String] $ModuleName, 11 | 12 | [Parameter()] 13 | [System.String] $ResourceName, 14 | 15 | [Parameter()] 16 | [ValidateNotNullOrEmpty()] 17 | [System.String] $MinimumVersion 18 | ) 19 | process { 20 | 21 | if (Get-LabDscModule @PSBoundParameters -ErrorAction SilentlyContinue) { 22 | 23 | return $true; 24 | } 25 | else { 26 | 27 | return $false; 28 | } 29 | 30 | } #end process 31 | } #end function 32 | -------------------------------------------------------------------------------- /Src/Private/Test-LabNode.ps1: -------------------------------------------------------------------------------- 1 | function Test-LabNode { 2 | <# 3 | .SYNOPSIS 4 | Tests whether the node name is defined in a configuration document. 5 | #> 6 | [CmdletBinding()] 7 | [OutputType([System.Boolean])] 8 | param ( 9 | ## PowerShell module hashtable 10 | [Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] 11 | [System.String] $Name, 12 | 13 | ## Specifies a PowerShell DSC configuration document (.psd1) containing the lab configuration. 14 | [Parameter(Mandatory, ValueFromPipelineByPropertyName)] 15 | [System.Collections.Hashtable] 16 | [Microsoft.PowerShell.DesiredStateConfiguration.ArgumentToConfigurationDataTransformationAttribute()] 17 | $ConfigurationData 18 | ) 19 | process { 20 | 21 | $node = Resolve-NodePropertyValue -NodeName $Name -ConfigurationData $ConfigurationData -NoEnumerateWildcardNode; 22 | return ($null -ne $node.NodeName); 23 | 24 | } #end process 25 | } #end function 26 | -------------------------------------------------------------------------------- /Src/Private/Test-LabSwitch.ps1: -------------------------------------------------------------------------------- 1 | function Test-LabSwitch { 2 | <# 3 | .SYNOPSIS 4 | Tests the current configuration a virtual network switch. 5 | .DESCRIPTION 6 | Tests a virtual network switch configuration using the xVMSwitch DSC resource. 7 | #> 8 | [CmdletBinding()] 9 | [OutputType([System.Boolean])] 10 | param ( 11 | ## Switch Id/Name 12 | [Parameter(Mandatory, ValueFromPipeline)] 13 | [System.String] $Name, 14 | 15 | ## PowerShell DSC configuration document (.psd1) containing lab metadata. 16 | [Parameter(Mandatory, ValueFromPipeline)] 17 | [System.Collections.Hashtable] 18 | [Microsoft.PowerShell.DesiredStateConfiguration.ArgumentToConfigurationDataTransformationAttribute()] 19 | $ConfigurationData 20 | ) 21 | process { 22 | 23 | $networkSwitch = Resolve-LabSwitch @PSBoundParameters; 24 | if (($null -ne $networkSwitch.IsExisting) -and ($networkSwitch.IsExisting -eq $true)) { 25 | 26 | ## The existing virtual switch may be of a type not supported by the DSC resource. 27 | return $true; 28 | } 29 | Import-LabDscResource -ModuleName xHyper-V -ResourceName MSFT_xVMSwitch -Prefix VMSwitch; 30 | return Test-LabDscResource -ResourceName VMSwitch -Parameters $networkSwitch; 31 | 32 | } #end process 33 | } #end function 34 | -------------------------------------------------------------------------------- /Src/Private/Test-WindowsBuildNumber.ps1: -------------------------------------------------------------------------------- 1 | function Test-WindowsBuildNumber { 2 | <# 3 | .SYNOPSIS 4 | Validates the host build meets the specified requirements. 5 | #> 6 | [CmdletBinding()] 7 | [OutputType([System.Boolean])] 8 | param ( 9 | ## Minimum Windows build number required 10 | [Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] 11 | [System.Int32] $MinimumVersion 12 | ) 13 | begin { 14 | 15 | if (($null -ne $PSVersion.PSEdition) -and ($PSVersion.PSEdition -eq 'Core')) { 16 | 17 | # New-NotSupportedException 18 | } 19 | } 20 | process { 21 | 22 | $buildNumber = $PSVersionTable.BuildVersion.Build; 23 | return $buildNumber -ge $MinimumVersion; 24 | 25 | } #end process 26 | } #end function 27 | -------------------------------------------------------------------------------- /Src/Private/Write-Verbose.ps1: -------------------------------------------------------------------------------- 1 | function Write-Verbose { 2 | <# 3 | .SYNOPSIS 4 | Proxy function for Write-Verbose that adds a timestamp and/or call stack information to the output. 5 | #> 6 | [CmdletBinding()] 7 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidOverwritingBuiltInCmdlets','')] 8 | param 9 | ( 10 | [Parameter(ValueFromPipeline, ValueFromPipelineByPropertyName)] 11 | [AllowNull()] 12 | [System.String] $Message 13 | ) 14 | process 15 | { 16 | if (-not [System.String]::IsNullOrEmpty($Message)) 17 | { 18 | $verboseMessage = Get-FormattedMessage -Message $Message 19 | Microsoft.PowerShell.Utility\Write-Verbose -Message $verboseMessage 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Src/Private/Write-Warning.ps1: -------------------------------------------------------------------------------- 1 | function Write-Warning { 2 | <# 3 | .SYNOPSIS 4 | Proxy function for Write-Warning that adds a timestamp and/or call stack information to the output. 5 | #> 6 | [CmdletBinding()] 7 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidOverwritingBuiltInCmdlets','')] 8 | param 9 | ( 10 | [Parameter(ValueFromPipeline, ValueFromPipelineByPropertyName)] 11 | [AllowNull()] 12 | [System.String] $Message 13 | ) 14 | process 15 | { 16 | if (-not [System.String]::IsNullOrEmpty($Message)) 17 | { 18 | $warningMessage = Get-FormattedMessage -Message $Message 19 | Microsoft.PowerShell.Utility\Write-Warning -Message $warningMessage 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Src/Public/Get-LabHostConfiguration.ps1: -------------------------------------------------------------------------------- 1 | function Get-LabHostConfiguration { 2 | <# 3 | .SYNOPSIS 4 | Retrieves the current lab host's configuration default values. 5 | .LINK 6 | Test-LabHostConfiguration 7 | Start-LabHostConfiguration 8 | #> 9 | [CmdletBinding()] 10 | [OutputType([System.Management.Automation.PSObject])] 11 | param ( ) 12 | process { 13 | 14 | $labHostSetupConfiguation = Get-LabHostSetupConfiguration; 15 | foreach ($configuration in $labHostSetupConfiguation) { 16 | 17 | $importDscResourceParams = @{ 18 | ModuleName = $configuration.ModuleName; 19 | ResourceName = $configuration.ResourceName; 20 | Prefix = $configuration.Prefix; 21 | UseDefault = $configuration.UseDefault; 22 | } 23 | Import-LabDscResource @importDscResourceParams; 24 | $resource = Get-LabDscResource -ResourceName $configuration.Prefix -Parameters $configuration.Parameters; 25 | $resource['Resource'] = $configuration.ResourceName; 26 | Write-Output -InputObject ([PSCustomObject] $resource); 27 | 28 | } 29 | 30 | } #end process 31 | } #end function 32 | -------------------------------------------------------------------------------- /Src/Public/Get-LabHostDefault.ps1: -------------------------------------------------------------------------------- 1 | function Get-LabHostDefault { 2 | <# 3 | .SYNOPSIS 4 | Gets the lab host's default settings. 5 | .DESCRIPTION 6 | The Get-LabHostDefault cmdlet returns the lab host's current settings. 7 | .LINK 8 | Set-LabHostDefault 9 | Reset-LabHostDefault 10 | #> 11 | [CmdletBinding()] 12 | [OutputType([System.Management.Automation.PSCustomObject])] 13 | param ( ) 14 | process { 15 | 16 | $hostDefaults = Get-ConfigurationData -Configuration Host; 17 | 18 | ## Create/update Lability environment variables 19 | $env:LabilityConfigurationPath = $hostDefaults.ConfigurationPath; 20 | $env:LabilityDifferencingVhdPath = $hostDefaults.DifferencingVhdPath; 21 | $env:LabilityHotfixPath = $hostDefaults.HotfixPath; 22 | $env:LabilityIsoPath = $hostDefaults.IsoPath; 23 | $env:LabilityModuleCachePath = $hostDefaults.ModuleCachePath; 24 | $env:LabilityResourcePath = $hostDefaults.ResourcePath; 25 | $env:LabilityDismPath = $hostDefaults.DismPath; 26 | $env:LabilityRepositoryUri = $hostDefaults.RepositoryUri; 27 | $env:LabilityParentVhdPath = $hostDefaults.ParentVhdPath; 28 | 29 | return $hostDefaults; 30 | 31 | } #end process 32 | } #end function 33 | -------------------------------------------------------------------------------- /Src/Public/Get-LabVMDefault.ps1: -------------------------------------------------------------------------------- 1 | function Get-LabVMDefault { 2 | <# 3 | .SYNOPSIS 4 | Gets the current lab virtual machine default settings. 5 | #> 6 | [CmdletBinding()] 7 | [OutputType([System.Management.Automation.PSCustomObject])] 8 | param ( ) 9 | process { 10 | 11 | $vmDefaults = Get-ConfigurationData -Configuration VM; 12 | 13 | ## BootOrder property should not be exposed via the Get-LabVMDefault/Set-LabVMDefault 14 | $vmDefaults.PSObject.Properties.Remove('BootOrder'); 15 | return $vmDefaults; 16 | 17 | } 18 | } #end function 19 | -------------------------------------------------------------------------------- /Src/Public/Reset-LabHostDefault.ps1: -------------------------------------------------------------------------------- 1 | function Reset-LabHostDefault { 2 | <# 3 | .SYNOPSIS 4 | Resets lab host default settings to default. 5 | .DESCRIPTION 6 | The Reset-LabHostDefault cmdlet resets the lab host's settings to default values. 7 | .LINK 8 | Get-LabHostDefault 9 | Set-LabHostDefault 10 | #> 11 | [CmdletBinding(SupportsShouldProcess)] 12 | [OutputType([System.Management.Automation.PSCustomObject])] 13 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSShouldProcess','')] 14 | param ( ) 15 | process { 16 | 17 | Remove-ConfigurationData -Configuration Host; 18 | Get-LabHostDefault; 19 | 20 | } #end process 21 | } #end function Reset-LabHostDefault 22 | -------------------------------------------------------------------------------- /Src/Public/Reset-LabMedia.ps1: -------------------------------------------------------------------------------- 1 | function Reset-LabMedia { 2 | <# 3 | .SYNOPSIS 4 | Reset the lab media entries to default settings. 5 | .DESCRIPTION 6 | The Reset-LabMedia removes all custom media entries, reverting them to default values. 7 | #> 8 | [CmdletBinding(SupportsShouldProcess)] 9 | [OutputType([System.Management.Automation.PSCustomObject])] 10 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseSingularNouns','')] 11 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSShouldProcess','')] 12 | param ( ) 13 | process 14 | { 15 | Remove-ConfigurationData -Configuration CustomMedia 16 | Get-Labmedia 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Src/Public/Reset-LabVMDefault.ps1: -------------------------------------------------------------------------------- 1 | function Reset-LabVMDefault { 2 | <# 3 | .SYNOPSIS 4 | Reset the current lab virtual machine default settings back to defaults. 5 | #> 6 | [CmdletBinding(SupportsShouldProcess)] 7 | [OutputType([System.Management.Automation.PSCustomObject])] 8 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSShouldProcess','')] 9 | param ( ) 10 | process { 11 | 12 | Remove-ConfigurationData -Configuration VM; 13 | Get-LabVMDefault; 14 | 15 | } 16 | } #end function 17 | -------------------------------------------------------------------------------- /Src/Public/Test-LabImage.ps1: -------------------------------------------------------------------------------- 1 | function Test-LabImage { 2 | <# 3 | .SYNOPSIS 4 | Tests whether a master/parent lab image is present. 5 | .DESCRIPTION 6 | The Test-LabImage cmdlet returns whether a specified disk image is present. 7 | .PARAMETER Id 8 | Specifies the media Id of the image to test. 9 | .PARAMETER ConfigurationData 10 | Specifies a PowerShell DSC configuration data hashtable or a path to an existing PowerShell DSC .psd1 11 | configuration document that contains the required media definition. 12 | .EXAMPLE 13 | Test-LabImage -Id 2016_x64_Datacenter_EN_Eval 14 | 15 | Tests whether the '-Id 2016_x64_Datacenter_EN_Eval' lab image is present. 16 | .LINK 17 | Get-LabImage 18 | #> 19 | [CmdletBinding()] 20 | [OutputType([System.Boolean])] 21 | param ( 22 | [Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] 23 | [ValidateNotNullOrEmpty()] 24 | [System.String] $Id, 25 | 26 | ## Lab DSC configuration data 27 | [Parameter(ValueFromPipelineByPropertyName)] 28 | [System.Collections.Hashtable] 29 | [Microsoft.PowerShell.DesiredStateConfiguration.ArgumentToConfigurationDataTransformationAttribute()] 30 | $ConfigurationData 31 | ) 32 | process { 33 | 34 | if (Get-LabImage @PSBoundParameters) { 35 | 36 | return $true; 37 | } 38 | else { 39 | 40 | return $false; 41 | } 42 | 43 | } #end process 44 | } #end function Test-LabImage 45 | -------------------------------------------------------------------------------- /Src/Public/Test-LabMedia.ps1: -------------------------------------------------------------------------------- 1 | function Test-LabMedia { 2 | <# 3 | .SYNOPSIS 4 | Tests whether lab media has already been successfully downloaded. 5 | .DESCRIPTION 6 | The Test-LabMedia cmdlet will check whether the specified media Id has been downloaded and its checksum is correct. 7 | .PARAMETER Id 8 | Specifies the media Id (or alias) to test. 9 | #> 10 | [CmdletBinding()] 11 | [OutputType([System.Boolean])] 12 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseSingularNouns','')] 13 | param 14 | ( 15 | [Parameter(Mandatory, ValueFromPipeline)] 16 | [System.String] $Id 17 | ) 18 | process 19 | { 20 | $hostDefaults = Get-ConfigurationData -Configuration Host 21 | $media = Get-LabMedia -Id $Id 22 | if ($media) 23 | { 24 | if (-not $hostDefaults.DisableLocalFileCaching) 25 | { 26 | $testResourceDownloadParams = @{ 27 | DestinationPath = Join-Path -Path $hostDefaults.IsoPath -ChildPath $media.Filename 28 | Uri = $media.Uri 29 | Checksum = $media.Checksum 30 | } 31 | return Test-ResourceDownload @testResourceDownloadParams 32 | } 33 | else 34 | { 35 | ## Local file resource caching is disabled 36 | return $true 37 | } 38 | } 39 | else 40 | { 41 | return $false 42 | } 43 | 44 | } #end process 45 | } #end function 46 | -------------------------------------------------------------------------------- /Tests/Linting/PSScriptAnalyzer.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -Version 4 2 | #requires -Modules PSScriptAnalyzer 3 | 4 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..").Path; 5 | Describe 'Linting\PSScriptAnalyzer' { 6 | 7 | Get-ChildItem -Path "$repoRoot\Src" -Recurse -File | ForEach-Object { 8 | It "File '$($_.Name)' passes PSScriptAnalyzer rules" { 9 | $result = Invoke-ScriptAnalyzer -Path $_.FullName -Severity Warning -ExcludeRule PSReviewUnusedParameter | Select-Object -ExpandProperty Message 10 | $result | Should BeNullOrEmpty 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Private/Assert-BitLockerFDV.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Src\Private\Assert-BitLockerFDV' { 9 | 10 | InModuleScope $moduleName { 11 | 12 | Mock Set-ItemProperty { } 13 | 14 | It "Calls 'Set-ItemProperty' when BitLocker is enabled on the system" { 15 | $fdvDenyWriteAccess = $true; 16 | Assert-BitLockerFDV; 17 | 18 | Assert-MockCalled Set-ItemProperty -Scope It -Times 1 19 | } 20 | 21 | It "It does not call 'Set-ItemProperty' when BitLocker is not enabled on the system" { 22 | $fdvDenyWriteAccess = $false; 23 | Assert-BitLockerFDV; 24 | 25 | Assert-MockCalled Set-ItemProperty -Scope It -Times 0 26 | } 27 | 28 | } #end InModuleScope 29 | } #end Describe 30 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Private/Disable-BitLockerFDV.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Src\Private\Disable-BitLockerFDV' { 9 | 10 | InModuleScope $moduleName { 11 | 12 | Mock Set-ItemProperty { } 13 | 14 | It "Calls 'Set-ItemProperty' when BitLocker is enabled on the system" { 15 | $fdvDenyWriteAccess = $true; 16 | Disable-BitLockerFDV; 17 | 18 | Assert-MockCalled Set-ItemProperty -Scope It -Times 1 19 | } 20 | 21 | It "It does not call 'Set-ItemProperty' when BitLocker is not enabled on the system" { 22 | $fdvDenyWriteAccess = $false; 23 | Disable-BitLockerFDV; 24 | 25 | Assert-MockCalled Set-ItemProperty -Scope It -Times 0 26 | } 27 | 28 | } #end InModuleScope 29 | } #end Describe 30 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Private/Get-DiskImageDriveLetter.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Src\Private\Get-DiskImageDriveLetter' { 9 | 10 | InModuleScope $moduleName { 11 | 12 | It 'Throws when no disk letter is found' { 13 | Mock Get-Partition -MockWith { return [PSCustomObject] @{ DriveLetter = $null; Type = 'Basic'; DiskNumber = 1; } } 14 | $diskImage = [PSCustomObject] @{ DiskNumber = 1 }; 15 | 16 | { Get-DiskImageDriveLetter -DiskImage $diskImage -PartitionType Basic } | Should Throw; 17 | } 18 | 19 | It 'Throws when no disk letter is found for specified partition type' { 20 | Mock Get-Partition -MockWith { return [PSCustomObject] @{ DriveLetter = 'Z'; Type = 'IFS'; DiskNumber = 1; } } 21 | $diskImage = [PSCustomObject] @{ DiskNumber = 1 }; 22 | 23 | { Get-DiskImageDriveLetter -DiskImage $diskImage -PartitionType Basic } | Should Throw; 24 | } 25 | 26 | It 'Returns a single character' { 27 | Mock Get-Partition -MockWith { return [PSCustomObject] @{ DriveLetter = 'Z'; Type = 'IFS'; DiskNumber = 1; } } 28 | $diskImage = [PSCustomObject] @{ DiskNumber = 1 }; 29 | 30 | (Get-DiskImageDriveLetter -DiskImage $diskImage -PartitionType IFS).Length | Should Be 1; 31 | } 32 | 33 | } #end InModuleScope 34 | } #end Describe 35 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Private/Get-FormattedMessage.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Src\Private\Get-FormattedMessage' { 9 | 10 | InModuleScope $moduleName { 11 | 12 | It 'Does not return call stack information when "$labDefaults.CallStackLogging" = "$null"' { 13 | $labDefaults = @{ } 14 | $testMessage = 'This is a test message'; 15 | 16 | $message = Get-FormattedMessage -Message $testMessage; 17 | 18 | $message -match '\] \[' | Should Be $false; 19 | } 20 | 21 | It 'Does not return call stack information when "$labDefaults.CallStackLogging" = "$false"' { 22 | $labDefaults = @{ CallStackLogging = $false; } 23 | $testMessage = 'This is a test message'; 24 | 25 | $message = Get-FormattedMessage -Message $testMessage; 26 | 27 | $message -match '\] \[' | Should Be $false; 28 | } 29 | 30 | It 'Returns call stack information when "$labDefaults.CallStackLogging" = "$true"' { 31 | $labDefaults = @{ CallStackLogging = $true; } 32 | $testMessage = 'This is a test message'; 33 | 34 | $message = Get-FormattedMessage -Message $testMessage; 35 | 36 | $message -match '\] \[' | Should Be $true; 37 | } 38 | 39 | } #end InModuleScope 40 | } #end Describe 41 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Private/Get-LabDscResource.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Src\Private\Get-LabDscResource' { 9 | 10 | InModuleScope $moduleName { 11 | 12 | It 'Calls "Get-TargetResource" method' { 13 | $testResourceName = 'TestLabResource'; 14 | ## Cannot dynamically generate function names :| 15 | $getPrefixedCommandName = "Get-TestLabResourceTargetResource"; 16 | function Get-TestLabResourceTargetResource { } 17 | Mock $getPrefixedCommandName -MockWith { } 18 | 19 | Get-LabDscResource -ResourceName $testResourceName -Parameters @{}; 20 | 21 | Assert-MockCalled $getPrefixedCommandName -Scope It; 22 | } 23 | 24 | } #end InModuleScope 25 | } #end Describe 26 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Private/Get-LabHostDscConfigurationPath.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Unit\Src\Private\Get-LabHostDefault' { 9 | 10 | InModuleScope $moduleName { 11 | 12 | It 'Returns host configuration path' { 13 | $testConfigurationPath = 'TestDrive:\'; 14 | Mock Get-ConfigurationData -MockWith { return [PSCustomObject] @{ ConfigurationPath = $testConfigurationPath; } } 15 | 16 | Get-LabHostDscConfigurationPath | Should Be $testConfigurationPath; 17 | } 18 | 19 | } #end InModuleScope 20 | 21 | } #end Describe 22 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Private/Get-LabVMSnapshot.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Unit\Src\Private\Get-LabVMSnapshot' { 9 | 10 | InModuleScope -ModuleName $moduleName { 11 | 12 | It 'Calls "Get-VMSnapshot" for each virtual machine specified' { 13 | $testVMNames = 'TestVM1','TestVM2'; 14 | $testSnapshotName = 'Test snapshot'; 15 | Mock Get-VMSnapshot -ParameterFilter { $Name -eq $testSnapshotName } -MockWith { return @{ Name = $Name; } } 16 | 17 | Get-LabVMSnapshot -Name $testVMNames -SnapshotName $testSnapshotName 3>&1; 18 | 19 | Assert-MockCalled Get-VMSnapshot -ParameterFilter { $Name -eq $testSnapshotName } -Exactly $testVMNames.Count -Scope It; 20 | } 21 | 22 | It 'Warns when snapshot name cannot be found' { 23 | $testVMName = 'TestVM1'; 24 | $testSnapshotName = 'Test snapshot'; 25 | Mock Get-VMSnapshot -ParameterFilter { $Name -eq $testSnapshotName } -MockWith { } 26 | 27 | { Get-LabVMSnapshot -Name $testVMName -SnapshotName $testSnapshotName -WarningAction Stop 3>&1 } | Should Throw; 28 | } 29 | 30 | } #end InModuleScope 31 | 32 | } #end describe 33 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Private/New-LabBootStrap.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Src\Private\New-LabBootStrap' { 9 | 10 | InModuleScope $moduleName { 11 | 12 | It 'Returns a "System.String" type' { 13 | $bootstrap = New-LabBootStrap; 14 | 15 | $bootstrap -is [System.String] | Should Be $true; 16 | } 17 | 18 | It 'Includes custom BootStrap injection point' { 19 | $bootstrap = New-LabBootStrap; 20 | 21 | $bootstrap -match "<#CustomBootStrapInjectionPoint#>`r?`n" | Should Be $true; 22 | } 23 | 24 | It 'Defaults "MaxEnvelopeSizeKb" size to 1024' { 25 | $bootstrap = New-LabBootStrap; 26 | 27 | $bootstrap -match '-Name maxEnvelopeSize -Value 1024 -Force' | Should Be $true; 28 | } 29 | 30 | It 'Sets "MaxEnvelopeSizeKb" size to "2048" when specified' { 31 | $bootstrap = New-LabBootStrap -MaxEnvelopeSizeKb 2048; 32 | 33 | $bootstrap -match '-Name maxEnvelopeSize -Value 2048 -Force' | Should Be $true; 34 | } 35 | 36 | } #end InModuleScope 37 | } #end Describe 38 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Private/New-LabVMSnapshot.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Unit\Src\Private\New-LabVMSnapshot' { 9 | 10 | InModuleScope -ModuleName $moduleName { 11 | 12 | It 'Calls "Checkpoint-VM" for each virtual machine specified' { 13 | $testVMNames = 'TestVM1','TestVM2'; 14 | $testSnapshotName = 'Test snapshot'; 15 | Mock Checkpoint-VM -ParameterFilter { $SnapshotName -eq $testSnapshotName } -MockWith { } 16 | 17 | New-LabVMSnapshot -Name $testVMNames -SnapshotName $testSnapshotName; 18 | 19 | Assert-MockCalled Checkpoint-VM -Exactly $testVMNames.Count -Scope It; 20 | } 21 | 22 | } #end InModuleScope 23 | 24 | } #end describe 25 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Private/Remove-ConfigurationData.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Unit\Src\Private\Remove-ConfigurationData' { 9 | 10 | InModuleScope $moduleName { 11 | 12 | It 'Removes configuration file' { 13 | $testConfigurationFilename = 'TestVMConfiguration.json'; 14 | $testConfigurationPath = "$env:SystemRoot\$testConfigurationFilename"; 15 | $fakeConfiguration = '{ "ConfigurationPath": "%SYSTEMDRIVE%\\TestLab\\Configurations" }'; 16 | [ref] $null = New-Item -Path $testConfigurationPath -ItemType File -Force; 17 | Mock Resolve-ConfigurationDataPath -MockWith { return ('%SYSTEMROOT%\{0}' -f $testConfigurationFilename); } 18 | Mock Test-Path -MockWith { return $true; } 19 | Mock Remove-Item -MockWith { } 20 | 21 | Remove-ConfigurationData -Configuration VM; 22 | 23 | Assert-MockCalled Remove-Item -ParameterFilter { $Path.EndsWith($testConfigurationFilename) } -Scope It; 24 | } 25 | 26 | } #end InModuleScope 27 | 28 | } #end Describe 29 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Private/Resolve-AzDevOpsModuleUri.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Unit\Src\Private\Resolve-AzDoModuleUri' { 9 | 10 | InModuleScope $moduleName { 11 | 12 | Mock Invoke-RestMethod -MockWith { return @( 13 | [pscustomobject]@{properties=@{NormalizedVersion='1.0.0'}} 14 | [pscustomobject]@{properties=@{NormalizedVersion='1.2.3'}} 15 | ) } 16 | 17 | $testPackageName = 'TestPackage'; 18 | $testUri = 'https://pkgs.dev.azure.com/myorg/_packaging/myfeed/nuget/v2'; 19 | 20 | It 'Returns specified Uri' { 21 | $expected = '{0}?id={1}&version=1.2.3' -f $testUri, $testPackagename; 22 | 23 | $result = Resolve-AzDoModuleUri -Name $testPackageName -Uri $testUri; 24 | 25 | $result | Should Be $expected; 26 | } 27 | 28 | 29 | It 'Returns Uri with specific version number when "RequiredVersion" is specified' { 30 | 31 | $testPackageVersion = '1.2.3' -as [System.Version]; 32 | $expected = '{0}?id={1}&version={2}' -f $testUri, $testPackageName, $testPackageVersion; 33 | 34 | $result = Resolve-AzDoModuleUri -Name $testPackageName -RequiredVersion $testPackageVersion -Uri $testUri; 35 | 36 | $result | Should Be $expected; 37 | } 38 | 39 | } #end InModuleScope 40 | 41 | } #end Describe 42 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Private/Resolve-LabImage.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Unit\Src\Private\Resolve-LabImage' { 9 | 10 | InModuleScope $moduleName { 11 | 12 | It 'resolves VHD/X path to the associated Lability image.' { 13 | 14 | $labVMSnapshotPath = 'C:\Child\Snapshot.avhd'; 15 | $labVMBasePath = 'C:\Child\VMImage.vhdx'; 16 | $labImageId = 'TestLabImage' 17 | $labImagePath = 'C:\Parent\Image.vhdx'; 18 | Mock Resolve-VhdHierarchy { return @($labVMSnapshotPath, $labVMBasePath, $labImagePath); } 19 | Mock Get-LabImage { return [PSCustomObject] @{ Id = $labImageId; ImagePath = $labImagePath; } } 20 | 21 | $labImage = Resolve-LabImage -Path $labVMSnapshotPath; 22 | 23 | $labImage.Id | Should Be $labImageId; 24 | } 25 | 26 | } #end InModuleScope 27 | 28 | } #end describe 29 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Private/Resolve-LabResource.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Unit\Src\Private\Resolve-LabResource' { 9 | 10 | InModuleScope $moduleName { 11 | 12 | It 'Returns resource record if "ResourceId" is found' { 13 | $configurationData = @{ 14 | NonNodeData = @{ 15 | $labDefaults.ModuleName = @{ 16 | Resource = @( 17 | @{ Id = 'Resource1.exe'; Uri = 'http://test-resource.com/resource1.exe'; } 18 | ) } } } 19 | $resource = Resolve-LabResource -ConfigurationData $configurationData -ResourceId 'Resource1.exe'; 20 | $resource | Should Not BeNullOrEmpty; 21 | } 22 | 23 | It 'Throws if "ResourceId" is not found' { 24 | $configurationData = @{ 25 | NonNodeData = @{ 26 | $labDefaults.ModuleName = @{ 27 | Resource = @( 28 | @{ Id = 'Resource1.exe'; Uri = 'http://test-resource.com/resource1.exe'; } 29 | ) } } } 30 | { Resolve-LabResource -ConfigurationData $configurationData -ResourceId 'Resource2.iso' } | Should Throw; 31 | } 32 | 33 | } #end InModuleScope 34 | 35 | } #end describe 36 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Private/Resolve-LabVMDisk.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Unit\Src\Private\Resolve-LabVMDiskPath' { 9 | 10 | InModuleScope $moduleName { 11 | 12 | It 'Appends the VM''s name to the host "DifferencingVhdPath"' { 13 | $testVMName = 'TestVM'; 14 | $testDifferencingVhdPath = 'TestDrive:'; 15 | Mock Get-ConfigurationData -MockWith { return @{ DifferencingVhdPath = $testDifferencingVhdPath; } } 16 | 17 | $vhdPath = Resolve-LabVMDiskPath -Name $testVMName; 18 | 19 | $vhdPath | Should Be "$testDifferencingVhdPath\$testVMName.vhdx"; 20 | } 21 | 22 | } #end InModuleScope 23 | 24 | } #end describe 25 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Private/Resolve-PathEx.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Unit\Src\Private\Resolve-PathEx' { 9 | 10 | InModuleScope $moduleName { 11 | 12 | It 'Resolves existing home path' { 13 | (Get-PSProvider -PSProvider 'FileSystem').Home = (Get-PSDrive -Name TestDrive).Root; 14 | $fileSystemPath = (Get-PSProvider -PSProvider 'FileSystem').Home; 15 | $psPath = '~'; 16 | 17 | Resolve-PathEx -Path $psPath | Should Be $fileSystemPath; 18 | } 19 | 20 | It 'Resolves non-existent home path' { 21 | (Get-PSProvider -PSProvider 'FileSystem').Home = (Get-PSDrive -Name TestDrive).Root; 22 | $fileSystemPath = '{0}\HopefullyThisPathDoesNotExist' -f (Get-PSProvider -PSProvider 'FileSystem').Home; 23 | $psPath = '~\HopefullyThisPathDoesNotExist'; 24 | 25 | Resolve-PathEx -Path $psPath | Should Be $fileSystemPath; 26 | } 27 | 28 | } #end InModuleScope 29 | 30 | } #end describe 31 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Private/Set-ConfigurationData.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Unit\Src\Private\Set-ConfigurationData' { 9 | 10 | # InModuleScope $moduleName { 11 | # 12 | # It 'Resolves environment variables in path' { 13 | # $testConfigurationFilename = 'TestConfiguration.json'; 14 | # $fakeConfiguration = '{ "ConfigurationPath": "%SYSTEMDRIVE%\\TestLab\\Configurations" }' | ConvertFrom-Json; 15 | # Mock Resolve-ConfigurationDataPath -MockWith { return ('%SYSTEMROOT%\{0}' -f $testConfigurationFilename); } 16 | # Mock New-Directory -MockWith { } 17 | # Mock Set-Content -ParameterFilter { $Path -eq "$env:SystemRoot\$testConfigurationFilename" } -MockWith { return $fakeConfiguration; } 18 | # 19 | # Set-ConfigurationData -Configuration Host -InputObject $fakeConfiguration; 20 | # 21 | # Assert-MockCalled Set-Content -ParameterFilter { $Path -eq "$env:SystemRoot\$testConfigurationFilename" } -Scope It; 22 | # } 23 | # 24 | # } #end InModuleScope 25 | 26 | } #end Describe 27 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Private/Set-DiskImageBootVolume.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Src\Private\Set-DiskImageBootVolume' { 9 | 10 | InModuleScope $moduleName { 11 | 12 | It 'Calls "Set-DiskImageBootVolumeGpt" when partition style is GPT' { 13 | $vhdImage = [PSCustomObject] @{ DiskNumber = 10 }; 14 | Mock Set-DiskImageBootVolumeGpt -MockWith { }; 15 | 16 | Set-DiskImageBootVolume -Vhd $vhdImage -PartitionStyle GPT; 17 | 18 | Assert-MockCalled Set-DiskImageBootVolumeGpt -Scope It; 19 | } 20 | 21 | It 'Calls "Set-DiskImageBootVolumeMbr" when partition style is MBR' { 22 | $vhdImage = [PSCustomObject] @{ DiskNumber = 10 }; 23 | Mock Set-DiskImageBootVolumeMbr -MockWith { }; 24 | 25 | Set-DiskImageBootVolume -Vhd $vhdImage -PartitionStyle MBR; 26 | 27 | Assert-MockCalled Set-DiskImageBootVolumeMbr -Scope It; 28 | } 29 | 30 | } #end InModuleScope 31 | } #end Describe 32 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Private/Set-DiskImageBootVolumeGpt.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Src\Private\Set-DiskImageBootVolumeGpt' { 9 | 10 | InModuleScope $moduleName { 11 | 12 | It 'Calls "BCDBOOT.EXE" with "/f UEFI"' { 13 | $testVhdPath = (New-Item -Path 'TestDrive:\TestImage.vhdx' -Force -ItemType File).FullName; 14 | $testVhdImage = @{ Path = $testVhdPath }; 15 | Mock Get-DiskImageDriveLetter -MockWith { return 'Z'; } 16 | Mock Invoke-Executable -MockWith { } 17 | Mock Invoke-Executable -ParameterFilter { $Path -eq 'BCDBOOT.EXE' -and $Arguments -contains '/f UEFI' } -MockWith { } 18 | 19 | Set-DiskImageBootVolumeGpt -Vhd $testVhdImage; 20 | 21 | Assert-MockCalled Invoke-Executable -ParameterFilter { $Path -eq 'BCDBOOT.EXE' -and $Arguments -contains '/f UEFI' } -Scope It -Exactly 1; 22 | } 23 | 24 | } #end InModuleScope 25 | } #end Describe 26 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Private/Set-LabBootStrap.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Src\Private\Set-LabBootStrap' { 9 | 10 | InModuleScope $moduleName { 11 | 12 | It 'Creates target file "BootStrap.ps1"' { 13 | Set-LabBootStrap -Path TestDrive:\; 14 | 15 | Test-Path -Path "TestDrive:\BootStrap.ps1" | Should Be $true; 16 | } 17 | 18 | It 'Replaces custom BootStrap injection point with custom BootStrap' { 19 | $customBootStrap = 'This is a test custom bootstrap example'; 20 | 21 | Set-LabBootStrap -Path TestDrive:\ -CustomBootStrap $customBootStrap; 22 | $bootStrap = Get-Content -Path "TestDrive:\BootStrap.ps1"; 23 | 24 | $bootStrap -match $customBootStrap | Should Be $true; 25 | $bootStrap -match "<#CustomBootStrapInjectionPoint#>" | Should BeNullOrEmpty; 26 | } 27 | 28 | It 'Uses UTF8 encoding' { 29 | Mock Set-Content -ParameterFilter { $Encoding -eq 'UTF8' } -MockWith { } 30 | 31 | Set-LabBootStrap -Path TestDrive:\; 32 | 33 | Assert-MockCalled Set-Content -ParameterFilter { $Encoding -eq 'UTF8' } -Scope It 34 | } 35 | 36 | } #end InModuleScope 37 | } #end Describe 38 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Private/Set-LabDscResource.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Src\Private\Set-LabDscResource' { 9 | 10 | InModuleScope $moduleName { 11 | 12 | It 'Calls "Set-TargetResource" method' { 13 | $testResourceName = 'TestLabResource'; 14 | ## Cannot dynamically generate function names :| 15 | $setPrefixedCommandName = 'Set-TestLabResourceTargetResource'; 16 | function Set-TestLabResourceTargetResource { } 17 | Mock $setPrefixedCommandName -MockWith { } 18 | 19 | Set-LabDscResource -ResourceName $testResourceName -Parameters @{ TestParam = 1 }; 20 | 21 | Assert-MockCalled $setPrefixedCommandName -Scope It; 22 | } 23 | 24 | } #end InModuleScope 25 | } #end Describe 26 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Private/Set-LabVMDiskFileResource.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Unit\Src\Private\Set-LabVMDiskFileResource' { 9 | 10 | InModuleScope $moduleName { 11 | 12 | It 'Calls "Expand-LabResource" using "ResourceShare" path' { 13 | $testNode = 'TestNode'; 14 | $testConfigurationData = @{} 15 | $testDriveLetter = 'Z'; 16 | $testResourceShare = 'TestResourceShare'; 17 | $testHostConfiguration = [PSCustomObject] @{ 18 | ResourceShareName = $testResourceShare; 19 | } 20 | Mock Get-ConfigurationData -MockWith { return $testHostConfiguration; } 21 | Mock Expand-LabResource -MockWith { } 22 | 23 | $testParams = @{ 24 | ConfigurationData = $testConfigurationData; 25 | NodeName = $testNode; 26 | VhdDriveLetter = $testDriveLetter; 27 | } 28 | Set-LabVMDiskFileResource @testParams; 29 | 30 | $expectedDestinationPath = '{0}:\{1}' -f $testDriveLetter, $testResourceShare; 31 | Assert-MockCalled Expand-LabResource -ParameterFilter { $DestinationPath -eq $expectedDestinationPath } -Scope It 32 | } 33 | 34 | } #end InModuleScope 35 | 36 | } #end describe 37 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Private/Set-LabVMDiskModule.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Unit\Src\Private\Set-LabVMDiskModule' { 9 | 10 | InModuleScope $moduleName { 11 | 12 | $testModules = @( 13 | @{ Name = 'PowerShellModule'; } 14 | @{ Name = 'DscResourceModule'; } 15 | ) 16 | 17 | It 'Calls "Invoke-LabModuleCacheDownload" with "Force" when specified' { 18 | Mock Invoke-LabModuleCacheDownload -MockWith { } 19 | Mock Expand-LabModuleCache -MockWith { } 20 | 21 | Set-LabVMDiskModule -Module $testModules -DestinationPath ".\" -Force 22 | 23 | Assert-MockCalled Invoke-LabModuleCacheDownload -ParameterFilter { $Force -eq $true } -Scope It; 24 | 25 | } 26 | 27 | It 'Calls "Expand-LabModuleCache" with "Clean" when specified' { 28 | Mock Invoke-LabModuleCacheDownload -MockWith { } 29 | Mock Expand-LabModuleCache -MockWith { } 30 | 31 | Set-LabVMDiskModule -Module $testModules -DestinationPath ".\" -Clean 32 | 33 | Assert-MockCalled Expand-LabModuleCache -ParameterFilter { $Clean -eq $true } -Scope It; 34 | 35 | } 36 | 37 | } #end InModuleScope 38 | 39 | } #end describe 40 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Private/Set-UnattendXml.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Src\Private\Set-UnattendXml' { 9 | 10 | InModuleScope $moduleName { 11 | 12 | It 'Saves Xml file to disk' { 13 | $testPassword = New-Object System.Management.Automation.PSCredential 'DummyUser', (ConvertTo-SecureString 'DummyPassword' -AsPlainText -Force); 14 | $testTimezone = 'GMT Standard Time'; 15 | $testPath = "$((Get-PSDrive -Name TestDrive).Root)\test.xml"; 16 | 17 | Set-UnattendXml -Path $testPath -Credential $testPassword -Timezone $testTimezone; 18 | 19 | Test-Path -Path $testPath | Should Be $true; 20 | } 21 | 22 | } #end InModuleScope 23 | } #end Describe 24 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Private/Test-ComputerName.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Src\Private\Test-ComputerName' { 9 | 10 | InModuleScope $moduleName { 11 | 12 | $baseComputerName = 'TestComputer-1'; 13 | 14 | It "Passes when computer name does not contain invalid characters" { 15 | Test-ComputerName -ComputerName $baseComputerName | Should Be $true; 16 | } 17 | 18 | $invalidChars = @('~','!','@','#','$','%','^','&','*','(',')','=','+','_','[',']', 19 | '{','}','\','|',';',':','.',"'",'"',',','<','>','/','?',' '); 20 | 21 | foreach ($invalidChar in $invalidChars) { 22 | 23 | It "Fails when computer name contains invalid '$invalidChar' character" { 24 | $testComputerName = '{0}{1}' -f $baseComputerName, $invalidChar; 25 | Test-ComputerName -ComputerName $testComputerName | Should Be $false; 26 | } 27 | 28 | } #end foreach invalid character 29 | 30 | } #end InModuleScope 31 | } #end Describe 32 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Private/Test-DscResource.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Src\Private\Test-LabDscResource' { 9 | 10 | InModuleScope $moduleName { 11 | 12 | ## Cannot dynamically generate function names :| 13 | $testPrefixedCommandName = 'Test-TestLabResourceTargetResource'; 14 | function Test-TestLabResourceTargetResource { } 15 | 16 | It 'Calls "Test-TargetResource" method' { 17 | $testResourceName = 'TestLabResource'; 18 | Mock $testPrefixedCommandName -MockWith { } 19 | 20 | Test-LabDscResource -ResourceName $testResourceName -Parameters @{ TestParam = 1 }; 21 | 22 | Assert-MockCalled $testPrefixedCommandName -Scope It; 23 | } 24 | 25 | It 'Return $false when "Test-TargetResource" throws (#104)' { 26 | $testResourceName = 'TestLabResource'; 27 | Mock $testPrefixedCommandName -MockWith { throw 'HideMe'; } 28 | 29 | $testResult = Test-LabDscResource -ResourceName $testResourceName -Parameters @{ TestParam = 1 } -WarningAction SilentlyContinue; 30 | 31 | $testResult | Should Be $false; 32 | } 33 | 34 | } #end InModuleScope 35 | } #end Describe 36 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Private/Test-LabDscModule.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Src\Private\Test-LabDscModule' { 9 | 10 | InModuleScope $moduleName { 11 | 12 | It 'Returns true if "Get-LabDscModule" returns a path' { 13 | $testModuleName = 'TestLabModule'; 14 | $testModulePath = (New-Item -Path (Join-Path -Path 'TestDrive:\' -ChildPath "$testModuleName\$testModuleName.psm1") -ItemType Directory -Force).FullName; 15 | Mock Get-LabDscModule -MockWith { return $testModulePath; } 16 | 17 | Test-LabDscModule -ModuleName $testModuleName | Should Be $true; 18 | } 19 | 20 | It 'Returns false if "Get-LabDscModule" fails' { 21 | $testModuleName = 'TestLabModule'; 22 | $testModulePath = (New-Item -Path (Join-Path -Path 'TestDrive:\' -ChildPath "$testModuleName\$testModuleName.psm1") -ItemType Directory -Force).FullName; 23 | Mock Get-LabDscModule -MockWith { Write-Error "DSC module\resource '$testModuleName' not found."; } 24 | 25 | Test-LabDscModule -ModuleName $testModuleName | Should Be $false; 26 | } 27 | 28 | } #end InModuleScope 29 | } #end Describe 30 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Private/Test-LabModuleCache.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Unit\Src\Private\Test-LabModuleCache' { 9 | 10 | InModuleScope -ModuleName $moduleName { 11 | 12 | $testModuleName = 'TestModule'; 13 | $testPSGalleryModule = @{ 14 | Name = $testModuleName; Version = '1.2.3.4'; 15 | } 16 | 17 | It 'Passes when module is found' { 18 | Mock Get-LabModuleCache -MockWith { return $testPSGalleryModule; } 19 | $testLabModuleCacheParams = @{ 20 | Name = $testModuleName; 21 | } 22 | 23 | $result = Test-LabModuleCache @testLabModuleCacheParams; 24 | 25 | $result | Should Be $true; 26 | } 27 | 28 | It 'Fails when module is not found' { 29 | Mock Get-LabModuleCache -MockWith { } 30 | $testLabModuleCacheParams = @{ 31 | Name = $testModuleName; 32 | } 33 | 34 | $result = Test-LabModuleCache @testLabModuleCacheParams; 35 | 36 | $result | Should Be $false; 37 | } 38 | 39 | } #end InModuleScope 40 | 41 | } #end describe 42 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Private/Test-WindowsBuildNumber.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Unit\Src\Private\Test-WindowsBuildNumber' { 9 | 10 | InModuleScope $moduleName { 11 | 12 | It 'Returns true when build number matches the required minimum' { 13 | 14 | $PSVersionTable = @{ BuildVersion = @{ Build = 16299 } } 15 | $result = Test-WindowsBuildNumber -MinimumVersion 16299; 16 | 17 | $result | Should Be $true; 18 | } 19 | 20 | It 'Returns true when build number mais greater than the required minimum' { 21 | 22 | $PSVersionTable = @{ BuildVersion = @{ Build = 17134 } } 23 | $result = Test-WindowsBuildNumber -MinimumVersion 16299; 24 | 25 | $result | Should Be $true; 26 | } 27 | 28 | It 'Returns false when build number is less than the required minimum (#294)' { 29 | 30 | $PSVersionTable = @{ BuildVersion = @{ Build = 15063 } } 31 | $result = Test-WindowsBuildNumber -MinimumVersion 16299; 32 | 33 | $result | Should Be $false; 34 | } 35 | 36 | } #end InModuleScope 37 | } #end Describe 38 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Private/Write-Verbose.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Src\Private\Write-Verbose' { 9 | 10 | InModuleScope $moduleName { 11 | 12 | It 'Calls "Get-FormattedMessage" method' { 13 | $testMessage = 'This is a test message'; 14 | Mock Get-FormattedMessage -ParameterFilter { $Message -match $testMessage } -MockWith { return $testMessage; } 15 | 16 | Write-Verbose -Message $testMessage; 17 | 18 | Assert-MockCalled Get-FormattedMessage -ParameterFilter { $Message -match $testMessage } -Scope It; 19 | } 20 | 21 | It 'Calls "Write-Verbose" method with test message' { 22 | $testMessage = 'This is a test message'; 23 | Mock 'Microsoft.PowerShell.Utility\Write-Verbose' -ParameterFilter { $Message -match "$testMessage`$" } -MockWith { } 24 | 25 | Write-Verbose -Message $testMessage; 26 | 27 | Assert-MockCalled 'Microsoft.PowerShell.Utility\Write-Verbose' -ParameterFilter { $Message -match $testMessage } -Scope It; 28 | } 29 | 30 | } #end InModuleScope 31 | } #end Describe 32 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Private/Write-Warning.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Src\Private\Write-Warning' { 9 | 10 | InModuleScope $moduleName { 11 | 12 | It 'Calls "Get-FormattedMessage" method' { 13 | $testMessage = 'This is a test message'; 14 | Mock Get-FormattedMessage -ParameterFilter { $Message -match $testMessage } -MockWith { return $testMessage; } 15 | 16 | Write-Warning -Message $testMessage -WarningAction SilentlyContinue; 17 | 18 | Assert-MockCalled Get-FormattedMessage -ParameterFilter { $Message -match $testMessage } -Scope It; 19 | } 20 | 21 | It 'Calls "Write-Warning" method with test message' { 22 | $testMessage = 'This is a test message'; 23 | Mock 'Microsoft.PowerShell.Utility\Write-Warning' -ParameterFilter { $Message -match "$testMessage`$" } -MockWith { } 24 | 25 | Write-Warning -Message $testMessage; 26 | 27 | Assert-MockCalled 'Microsoft.PowerShell.Utility\Write-Warning' -ParameterFilter { $Message -match $testMessage } -Scope It; 28 | } 29 | 30 | } #end InModuleScope 31 | } #end Describe 32 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Public/Get-LabHostDefault.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Unit\Src\Public\Get-LabHostDefault' { 9 | 10 | InModuleScope $moduleName { 11 | 12 | It 'Calls "Get-ConfigurationData"' { 13 | Mock Get-ConfigurationData -ParameterFilter { $Configuration -eq 'Host' } -MockWith { } 14 | 15 | Get-LabHostDefault; 16 | 17 | Assert-MockCalled Get-ConfigurationData -ParameterFilter { $Configuration -eq 'Host' } 18 | } 19 | 20 | } #end InModuleScope 21 | 22 | } #end Describe 23 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Public/Get-LabMedia.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Unit\Src\Public\Get-LabMedia' { 9 | 10 | InModuleScope -ModuleName $moduleName { 11 | 12 | It 'Returns all built-in media when no "Id" is specified' { 13 | $labMedia = Get-LabMedia; 14 | 15 | $labMedia.Count -gt 1 | Should Be $true; 16 | } 17 | 18 | It 'Returns a single matching built-in media when "Id" is specified' { 19 | $testMediaId = '2016_x64_Datacenter_EN_Eval'; 20 | $labMedia = Get-LabMedia -Id $testMediaId; 21 | 22 | $labMedia | Should Not BeNullOrEmpty; 23 | $labMedia.Count | Should BeNullOrEmpty; 24 | } 25 | 26 | It 'Returns null if no built-in media is found when "Id" is specified' { 27 | $labMedia = Get-LabMedia -Id 'NonExistentMediaId'; 28 | 29 | $labMedia | Should BeNullOrEmpty; 30 | } 31 | 32 | } #end InModuleScope 33 | 34 | } #end describe 35 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Public/Get-LabVMDefault.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Unit\Src\Public\Get-LabVMDefault' { 9 | 10 | InModuleScope -ModuleName $moduleName { 11 | 12 | It 'Returns a "System.Management.Automation.PSCustomObject" object type' { 13 | $defaults = Get-LabVMDefault; 14 | 15 | $defaults -is [System.Management.Automation.PSCustomObject] | Should Be $true; 16 | } 17 | 18 | It 'Does not return "BootOrder" property' { 19 | $defaults = Get-LabVMDefault; 20 | 21 | $defaults.BootOrder | Should BeNullOrEmpty; 22 | } 23 | 24 | } #end InModuleScope 25 | 26 | } #end describe 27 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Public/New-LabVM.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Unit\Src\Public\New-LabVM' { 9 | 10 | InModuleScope -ModuleName $moduleName { 11 | 12 | $MediaId = 'DummyMediaId' 13 | $testPassword = New-Object System.Management.Automation.PSCredential 'DummyUser', (ConvertTo-SecureString 'DummyPassword' -AsPlainText -Force); 14 | 15 | ## Guard mocks 16 | Mock New-LabVirtualMachine -MockWith { } 17 | Mock Get-LabMedia -MockWith { New-Object -TypeName PSObject -Property @{ 'Id' = $MediaId } } 18 | 19 | It 'Creates a new virtual machine with a snapshot by default' { 20 | $testVMName = 'TestVM'; 21 | 22 | New-LabVM -Name $testVMName -MediaId $MediaId -Credential $testPassword; 23 | 24 | Assert-MockCalled New-LabVirtualMachine -ParameterFilter { $NoSnapShot -eq $false } -Scope It; 25 | } 26 | 27 | It 'Creates a new virtual machine without a snapshot when "NoSnapshot" is specified' { 28 | $testVMName = 'TestVM'; 29 | 30 | New-LabVM -Name $testVMName -MediaId $MediaId -Credential $testPassword -NoSnapshot; 31 | 32 | Assert-MockCalled New-LabVirtualMachine -ParameterFilter { $NoSnapShot -eq $true } -Scope It; 33 | } 34 | 35 | } #end InModuleScope 36 | 37 | } #end describe 38 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Public/Remove-LabConfiguration.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Unit\Src\Public\Remove-LabConfiguration' { 9 | 10 | InModuleScope -ModuleName $moduleName { 11 | 12 | ## Guard mocks 13 | Mock Remove-LabVirtualMachine -MockWith { } 14 | 15 | It 'Calls "Remove-LabVirtualMachine" for each node' { 16 | $configurationData = @{ AllNodes = @( @{ NodeName = 'VM1'; }, @{ NodeName = 'VM2'; } ) } 17 | 18 | Remove-LabConfiguration -ConfigurationData $configurationData -Confirm:$false; 19 | 20 | Assert-MockCalled Remove-LabVirtualMachine -Exactly $configurationData.AllNodes.Count -Scope It; 21 | } 22 | 23 | } #end InModuleScope 24 | 25 | } #end describe 26 | 27 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Public/Remove-LabVM.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Unit\Src\Public\Remove-LabVM' { 9 | 10 | InModuleScope -ModuleName $moduleName { 11 | 12 | ## Guard mocks 13 | Mock Restore-Lab -MockWith { } 14 | Mock Remove-LabVirtualMachine -MockWith { } 15 | 16 | It 'Removes existing virtual machine' { 17 | $testVMName = 'TestVM'; 18 | Mock Resolve-LabVMImage -MockWith { 'TestVMImageId'; } 19 | 20 | Remove-LabVM -Name $testVMName -Confirm:$false; 21 | 22 | Assert-MockCalled Remove-LabVirtualMachine -ParameterFilter { $Name -eq $testVMName } -Scope It; 23 | } 24 | 25 | } #end InModuleScope 26 | 27 | } #end describe 28 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Public/Reset-Lab.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Unit\Src\Public\Reset-Lab' { 9 | 10 | InModuleScope -ModuleName $moduleName { 11 | 12 | ## Guard mocks 13 | Mock Restore-Lab -MockWith { } 14 | 15 | It 'Calls "Restore-Lab" with -Force switch' { 16 | $configurationData = @{ 17 | AllNodes = @( 18 | @{ NodeName = 'VM1'; }, @{ NodeName = 'VM2'; }, @{ NodeName = 'VM3'; } 19 | ) 20 | } 21 | 22 | Reset-Lab -ConfigurationData $configurationData; 23 | 24 | Assert-MockCalled Restore-Lab -ParameterFilter { $Force -eq $true } -Scope It; 25 | } 26 | 27 | } #end InModuleScope 28 | 29 | } #end describe 30 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Public/Reset-LabVMDefault.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Unit\Src\Public\Reset-LabVMDefault' { 9 | 10 | InModuleScope -ModuleName $moduleName { 11 | 12 | It 'Calls "Remove-ConfigurationData" method' { 13 | Mock Remove-ConfigurationData -ParameterFilter { $Configuration -eq 'VM' } -MockWith { } 14 | 15 | $null = Reset-LabVMDefault; 16 | 17 | Assert-MockCalled Remove-ConfigurationData -ParameterFilter { $Configuration -eq 'VM' } -Scope It; 18 | } 19 | 20 | } #end InModuleScope 21 | 22 | } #end describe 23 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Public/Test-LabConfiguration.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Unit\Src\Public\Test-LabConfiguration' { 9 | 10 | InModuleScope -ModuleName $moduleName { 11 | 12 | ## Guard mocks 13 | 14 | It 'Calls "Test-LabVM" for each node' { 15 | $configurationData = @{ 16 | AllNodes = @( 17 | @{ NodeName = 'VM1'; }, @{ NodeName = 'VM2'; }, @{ NodeName = 'VM3'; } 18 | ) 19 | } 20 | Mock Test-LabVM -MockWith { } 21 | 22 | Test-LabConfiguration -ConfigurationData $configurationData; 23 | 24 | Assert-MockCalled Test-LabVM -Exactly $configurationData.AllNodes.Count -Scope It; 25 | } 26 | 27 | } #end InModuleScope 28 | 29 | } #end describe 30 | -------------------------------------------------------------------------------- /Tests/Unit/Src/Public/Test-LabImage.Tests.ps1: -------------------------------------------------------------------------------- 1 | #requires -RunAsAdministrator 2 | #requires -Version 4 3 | 4 | $moduleName = 'Lability'; 5 | $repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path; 6 | Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force; 7 | 8 | Describe 'Unit\Src\Public\Test-LabImage' { 9 | 10 | InModuleScope -ModuleName $moduleName { 11 | 12 | It 'Passes when parent image is found' { 13 | $testImageId = '42'; 14 | Mock Get-LabImage -ParameterFilter { $Id -eq $testImageId } -MockWith { return $true; } 15 | 16 | Test-LabImage -Id $testImageId | Should Be $true; 17 | } 18 | 19 | It 'Fails when parent image is not found' { 20 | $testImageId = '42'; 21 | Mock Get-LabImage -ParameterFilter { $Id -eq $testImageId } -MockWith { return $false; } 22 | 23 | Test-LabImage -Id $testImageId | Should Be $false; 24 | } 25 | 26 | It 'Calls "Get-LabImage" with "ConfigurationData" when specified (#97)' { 27 | $testImageId = '42'; 28 | Mock Get-LabImage -ParameterFilter { $null -ne $ConfigurationData } -MockWith { } 29 | 30 | Test-LabImage -Id $testImageId -ConfigurationData @{}; 31 | 32 | Assert-MockCalled Get-LabImage -ParameterFilter { $null -ne $ConfigurationData } -Scope It; 33 | } 34 | 35 | } #end InModuleScope 36 | 37 | } #end describe 38 | --------------------------------------------------------------------------------