From c5908c3cc085f6cd1a9a662694c398c732be3cbf Mon Sep 17 00:00:00 2001 From: Dhiren Vispute Date: Thu, 14 Mar 2024 00:06:07 -0700 Subject: [PATCH] WiP - replace Write-Log in remote script blocks --- scripts/config_test_vm.psm1 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/config_test_vm.psm1 b/scripts/config_test_vm.psm1 index 4137a92d01..38b6fe30f3 100644 --- a/scripts/config_test_vm.psm1 +++ b/scripts/config_test_vm.psm1 @@ -223,14 +223,14 @@ function ArchiveKernelModeDump # Create the compressed dump folder if doesn't exist. if (!(Test-Path $KernelModeDumpFileDestinationPath)) { - Write-Log "Creating $KernelModeDumpFileDestinationPath directory." + Write-Output "Creating $KernelModeDumpFileDestinationPath directory." New-Item -ItemType Directory -Path $KernelModeDumpFileDestinationPath # Make sure it was created if (!(Test-Path $KernelModeDumpFileDestinationPath)) { $ErrorMessage = ` "*** ERROR *** Create compressed dump file directory failed: $KernelModeDumpFileDestinationPath`n" - Write-Log $ErrorMessage + Write-Output $ErrorMessage Start-Sleep -seconds 3 Throw $ErrorMessage } @@ -240,11 +240,11 @@ function ArchiveKernelModeDump Write-Log "Found kernel mode dump(s) in $($KernelModeDumpFileSourcePath):" $DumpFiles = get-childitem -Path $KernelModeDumpFileSourcePath\*.dmp foreach ($DumpFile in $DumpFiles) { - Write-Log "`tName:$($DumpFile.Name), Size:$((($DumpFile.Length) / 1MB).ToString("F2")) MB" + Write-Output "`tName:$($DumpFile.Name), Size:$((($DumpFile.Length) / 1MB).ToString("F2")) MB" } - Write-Log "`n" + Write-Output "`n" - Write-Log ` + Write-Output ` "Compressing kernel dump files: $KernelModeDumpFileSourcePath -> $KernelModeDumpFileDestinationPath" Compress-Archive ` -Path $KernelModeDumpFileSourcePath\*.dmp ` @@ -254,12 +254,12 @@ function ArchiveKernelModeDump if (Test-Path $KernelModeDumpFileDestinationPath\km_dumps.zip -PathType Leaf) { $CompressedDumpFile = get-childitem -Path $KernelModeDumpFileDestinationPath\km_dumps.zip - Write-Log "Found compressed kernel mode dump file in $($KernelModeDumpFileDestinationPath):" - Write-Log ` + Write-Output "Found compressed kernel mode dump file in $($KernelModeDumpFileDestinationPath):" + Write-Output ` "`tName:$($CompressedDumpFile.Name), Size:$((($CompressedDumpFile.Length) / 1MB).ToString("F2")) MB" } else { $ErrorMessage = "*** ERROR *** kernel mode dump compressed file not found.`n`n" - Write-Log $ErrorMessage + Write-Output $ErrorMessage Start-Sleep -seconds 3 throw $ErrorMessage }