functionCopy-Log { "Doing prerequisites" "Testing whether target path exists" "If target path does not exist, bail out" throw"Target path does not exist" "Copy log files to target path" "Delete log files in original location" }
PS> Copy-Log Doing prerequisites Testing whether target path exists If target path does not exist, bail out Target path does not exist In Zeile:8 Zeichen:3 + throw"Target path does not exist" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : OperationStopped: (Target path does not exist:String) [], RuntimeExceptio n + FullyQualifiedErrorId : Target path does not exist
PS> $ErrorActionPreference = 'SilentlyContinue'
PS> Copy-Log Doing prerequisites Testing whether target path exists If target path does not exist, bail out Copy log files to target path Delete log files in original location