Skip to content

Instantly share code, notes, and snippets.

@PlagueHO
Last active December 20, 2015 23:02
Show Gist options
  • Save PlagueHO/a8c09c14ac3497b946cb to your computer and use it in GitHub Desktop.
Save PlagueHO/a8c09c14ac3497b946cb to your computer and use it in GitHub Desktop.
Create a Virtual Disk Object for using in DSC Unit Tests.
# Create the Mock Objects that will be used for running tests
$TestVirtualDisk = [PSObject]@{
Path = Join-Path -Path $ENV:Temp -ChildPath 'TestiSCSIVirtualDisk.vhdx'
Ensure = 'Present'
DiskType = 'Differencing'
SizeBytes = 100MB
Description = 'Unit Test iSCSI Virtual Disk'
BlockSizeBytes = 2MB
PhysicalSectorSizeBytes = 4096
LogicalSectorSizeBytes = 512
ParentPath = 'c:\Parent.vhdx'
}
$MockVirtualDisk = [PSObject]@{
Path = $TestVirtualDisk.Path
DiskType = $TestVirtualDisk.DiskType
Size = $TestVirtualDisk.SizeBytes
Description = $TestVirtualDisk.Description
ParentPath = $TestVirtualDisk.ParentPath
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment