This file contains hidden or 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 hidden or 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 hidden or 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' | |
| } |
This file contains hidden or 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
| enum Ensure { | |
| Absent | |
| Present | |
| } | |
| [DscResource()] | |
| Class Env_Refresh { | |
| [DSCProperty(Mandatory)] | |
| [Ensure] $Ensure |
This file contains hidden or 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
| $pshost = get-host | |
| $pswindow = $pshost.ui.rawui | |
| $newsize = $pswindow.windowsize | |
| $newsize.height = 8 | |
| $newsize.width = 80 | |
| $pswindow.windowsize = $newsize | |
| $pswindow.buffersize = $newsize | |
| cls;while ($true){ | |
| $temp = gwmi MSAcpi_ThermalZoneTemperature -Namespace "root/wmi" | |
| $ProgressParams = @{ |
This file contains hidden or 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
| Function Export-StructuralUnitTestFromCommand { | |
| param( | |
| [parameter(Mandatory=$true,ValueFromPipelineByPropertyName = $true,ValueFromPipeline = $true)] | |
| [System.Management.Automation.CommandInfo[]] | |
| $command | |
| ) | |
| begin { | |
| $stringBuilder = New-object -TypeName System.Text.StringBuilder | |
| $BuiltInParameters = ([Management.Automation.PSCmdlet]::CommonParameters + [Management.Automation.PSCmdlet]::OptionalCommonParameters) | |
| } |
This file contains hidden or 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
| $deserialized = [psobject][ordered]@{ | |
| 'string' = 'this is a string' | |
| 'double' = [double]::MaxValue | |
| 'fileInfo' = 'C:\' | |
| '__castme' = { | |
| param($myself) | |
| switch (($myself|Get-Member -MemberType NoteProperty).Name) | |
| { | |
| 'string' {$myself.string = $myself.string } | |
| 'double' {$myself.double = [double]($myself.double) } |
This file contains hidden or 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
| $containerPrefix = '10.111.110.0/24' | |
| $sharedPrefix = '10.111.0.0/16' | |
| $vmprefix = '10.111.111.0/24' | |
| $vmPrefixLength = 24 | |
| $SharedGw = '10.111.111.1' | |
| $vmNatSwitchName = 'NAT' | |
| $null = Get-ContainerNetwork | Remove-ContainerNetwork -Force -ErrorAction SilentlyContinue | |
| $null = Get-NetNat | Remove-NetNat -Confirm:$false -ErrorAction SilentlyContinue | |
| $null = Get-VMSwitch -Name $vmNatSwitchName -ErrorAction SilentlyContinue | Remove-VMSwitch -Force -Confirm:$false -ErrorAction Stop |
This file contains hidden or 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
| function Get-DscSplattedResource { | |
| [CmdletBinding()] | |
| Param( | |
| [String] | |
| $ResourceName, | |
| [String] | |
| $ExecutionName, | |
| [hashtable] |
This file contains hidden or 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 MyDscConfig { | |
| $Allnodes.nodename { | |
| ChocolateyPackage Putty { | |
| Ensure = 'Present' | |
| Name = 'Putty' | |
| Version = 'Latest' | |
| ChocolateyOptions = @{ source = 'https://chocolatey.org/api/v2/' } | |
| } | |
| } | |
| } |