Last active
August 29, 2015 14:27
-
-
Save BladeFireLight/cd96fa74204f5b2813d7 to your computer and use it in GitHub Desktop.
verbose example
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
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