remove unnecessary prints to console

This commit is contained in:
2023-09-11 12:46:43 -04:00
parent 0360329312
commit 9816d15165
+4 -4
View File
@@ -11,7 +11,7 @@ $C_FILE = "${WORK_DIR}\InstalledSoftware_Current.csv"
Function Write-LineToFile { Function Write-LineToFile {
param([Parameter(Mandatory=$true)][string]$Path,[Parameter(Mandatory=$true)][string]$Line) param([Parameter(Mandatory=$true)][string]$Path,[Parameter(Mandatory=$true)][string]$Line)
If ( -not (Test-Path $Path) ) { If ( -not (Test-Path $Path) ) {
Write-Output "Creating file ""${Path}""" #Write-Output "Creating file ""${Path}"""
Try { New-Item -Path $Path -ItemType File -Force | Out-Null } Try { New-Item -Path $Path -ItemType File -Force | Out-Null }
Catch { Write-Error $_.Exception.Message } Catch { Write-Error $_.Exception.Message }
} }
@@ -81,7 +81,7 @@ Function Get-ItemPropertyInfo {
} }
# Create $WORK_DIR if it doesn't exist # Create $WORK_DIR if it doesn't exist
If ( -not (Test-Path $WORK_DIR) ) { New-Item -Path $WORK_DIR -ItemType Directory -Force } If ( -not (Test-Path $WORK_DIR) ) { New-Item -Path $WORK_DIR -ItemType Directory -Force | Out-Null }
# Create $C_FILE if it doesn't exist # Create $C_FILE if it doesn't exist
If ( -not (Test-Path $C_FILE) ) { If ( -not (Test-Path $C_FILE) ) {
@@ -135,13 +135,13 @@ If ( (Test-Path $C_FILE) -and (Test-Path $P_FILE) ) {
# Delete $P_FILE # Delete $P_FILE
If ( Test-Path $P_FILE ) { If ( Test-Path $P_FILE ) {
Write-Output "Deleting ""${P_FILE}""" #Write-Output "Deleting ""${P_FILE}"""
Remove-Item -Path $P_FILE -Force Remove-Item -Path $P_FILE -Force
} }
# Rename $C_FILE to $P_FILE # Rename $C_FILE to $P_FILE
If ( Test-Path $C_FILE ) { If ( Test-Path $C_FILE ) {
Write-Output "Renaming ""${C_FILE}"" to ""${P_FILE}""" #Write-Output "Renaming ""${C_FILE}"" to ""${P_FILE}"""
Move-Item -Path $C_FILE -Destination $P_FILE -Force Move-Item -Path $C_FILE -Destination $P_FILE -Force
} }