Skip to content

Instantly share code, notes, and snippets.

@BladeFireLight
Last active August 29, 2015 14:27
Show Gist options
  • Save BladeFireLight/cd96fa74204f5b2813d7 to your computer and use it in GitHub Desktop.
Save BladeFireLight/cd96fa74204f5b2813d7 to your computer and use it in GitHub Desktop.
verbose example
function test-function
{
[CmdletBinding()]
Param()
$key = 'template'
$IsoPath = 'c:\iso\win2012r2.iso'
$UnattendPath = 'g:\temp\unattent.xml'
$Configdata = @{Template = @{ IsoEdition = 4} }
$CwiParamaters = @{
SourcePath = $IsoPath
VHDPath = "$OutPath\$key.vhdx"
VHDFormat = 'VHDX'
VHDPartitionStyle = 'GPT'
VHDType = 'Dynamic'
UnattendPath = $UnattendPath
Edition = $ConfigData.$key.IsoEdition
}
#verbose output by line
'Hash table verbose'
'Individual line'
Write-Verbose "[$($MyInvocation.MyCommand)] [$key] CwiPramaters : SourcePath = $IsoPath"
Write-Verbose "[$($MyInvocation.MyCommand)] [$key] CwiPramaters : VHDPath = $OutPath\$key.vhdx"
Write-Verbose "[$($MyInvocation.MyCommand)] [$key] CwiPramaters : VHDFormat = VHDX"
Write-Verbose "[$($MyInvocation.MyCommand)] [$key] CwiPramaters : VHDPartitionStyle = GPT"
Write-Verbose "[$($MyInvocation.MyCommand)] [$key] CwiPramaters : VHDType = Dynamic"
Write-Verbose "[$($MyInvocation.MyCommand)] [$key] CwiPramaters : UnattendPath = $UnattendPath"
Write-Verbose "[$($MyInvocation.MyCommand)] [$key] CwiPramaters : Edition = $($ConfigData.$key.IsoEdition)"
'As block of text'
#verbose as a string
Write-Verbose "[$($MyInvocation.MyCommand)] [$key] CwiPramaters : "
Write-verbose ($CwiParamaters | out-string)
}
test-function -verbose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment