This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. .\lib.common\MethodHelpers.ps1 | |
. .\lib.common\PowerObject.ps1 | |
function Resolve-DNSHost { | |
[cmdletBinding()] | |
Param () | |
DynamicParam { | |
Get-DynamicParamForMethod -method ([System.Net.Dns]::Resolve) | |
} | |
process { | |
try |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. .\lib.common\MethodHelpers.ps1 | |
. .\lib.common\PowerObject.ps1 | |
function Get-Color{ | |
[cmdletBinding()] | |
Param () | |
DynamicParam { | |
[System.Drawing.Color]::FromName,[System.Drawing.Color]::FromKnownColor | Get-DynamicParamForMethod | |
} | |
process { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
New-VHD -Differencing -ParentPath .\BaseWMF5.vhd -Path .\BaseWMF5_diff.vhd | |
New-VM -Name TestBase -BootDevice IDE -VHDPath .\BaseWMF5_diff.vhd -SwitchName inet -Path .\hyperv\ | |
Start-VM TestBase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Install-PackageProvider -Name nuGet -Force -ForceBootstrap | |
Import-PackageProvider -Name nuGet -Force -ForceBootstrap | |
#Restart your PowerShell console / ISE. | |
Find-package Pester | install-package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Describe 'Testing Image' { | |
It 'Should have WMF5' { | |
$PSVersionTable.PSVersion.Major -ge 5 | should be $true | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
New-VHD -Differencing -ParentPath .\BaseWMF5.vhd -Path .\BaseWMF5_diff.vhd | |
New-VM -Name TestBase -BootDevice IDE -VHDPath .\BaseWMF5_diff.vhd -SwitchName inet -Path .\hyperv\ | |
set-VMDvdDrive -VMName TestBase -Path .\Unattendxml.iso | |
Start-VM TestBase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mount-WindowsImage -ImagePath .\baseNoWMF5.vhd -Path ./VHD -Index 1 | |
Add-WindowsPackage -PackagePath .\Win8.1AndW2K12R2-KB3134758-x64.msu -Path .\VHD | |
Use-WindowsUnattend -UnattendPath C:\src\winopsconf\TestKitchen\Unattend.xml -Path .\VHD | |
Dismount-WindowsImage -Path .\VHD -Save |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mount-WindowsImage -ImagePath .\baseNoWMF5.vhd -Path ./VHD -Index 1 | |
New-WindowsImage -ImagePath .\customImage.wim -CapturePath .\VHD\ -Name customImage | |
Dismount-WindowsImage -Path .\VHD -Discard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Describe 'checking File Exists' { | |
it 'Should resolve to C:\WinOps.txt' { | |
{ Resolve-Path C:\WinOps.txt -ErrorAction Stop } | should not Throw | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Configuration Default { | |
Import-DSCResource -ModuleName Env_Refresh | |
Node 'localhost' { | |
Env_Refresh TESTVAR | |
{ | |
Ensure = 'Present' | |
RunName = 'RMQ_BASE_VAR' | |
VariableNameList = 'RABBITMQ_BASE' | |
} |
OlderNewer