diff --git a/Track-InstalledSoftware.ps1 b/Track-InstalledSoftware.ps1 index fc67a07..9b9363e 100644 --- a/Track-InstalledSoftware.ps1 +++ b/Track-InstalledSoftware.ps1 @@ -11,7 +11,7 @@ $C_FILE = "${WORK_DIR}\InstalledSoftware_Current.csv" Function Write-LineToFile { param([Parameter(Mandatory=$true)][string]$Path,[Parameter(Mandatory=$true)][string]$Line) 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 } Catch { Write-Error $_.Exception.Message } } @@ -81,7 +81,7 @@ Function Get-ItemPropertyInfo { } # 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 If ( -not (Test-Path $C_FILE) ) { @@ -135,13 +135,13 @@ If ( (Test-Path $C_FILE) -and (Test-Path $P_FILE) ) { # Delete $P_FILE If ( Test-Path $P_FILE ) { - Write-Output "Deleting ""${P_FILE}""" + #Write-Output "Deleting ""${P_FILE}""" Remove-Item -Path $P_FILE -Force } # Rename $C_FILE to $P_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 }