Skip to content

Instantly share code, notes, and snippets.

@PlagueHO
Created December 23, 2015 05:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PlagueHO/374958535d7308925ac4 to your computer and use it in GitHub Desktop.
Save PlagueHO/374958535d7308925ac4 to your computer and use it in GitHub Desktop.
Example DSC ciSCSI Get-VirtualDisk function
Function Get-VirtualDisk {
param
(
[parameter(Mandatory = $true)]
[System.String]
$Path
)
try
{
$VirtualDisk = Get-iSCSIVirtualDisk `
-Path $Path `
-ErrorAction Stop
}
catch [Microsoft.Iscsi.Target.Commands.IscsiCmdException]
{
$VirtualDisk = $null
}
catch
{
Throw $_
}
Return $VirtualDisk
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment