From 4b1cf3a49dc89b6904fb3b24220ad90bd83131d4 Mon Sep 17 00:00:00 2001 From: Bartenbach Date: Thu, 16 Jun 2016 08:50:17 -0500 Subject: [PATCH] * Fixed logging to file messages --- Get-PC-Information.ps1 | 6 ++++-- RUN-ME.bat | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Get-PC-Information.ps1 b/Get-PC-Information.ps1 index 355546f..0ef243b 100644 --- a/Get-PC-Information.ps1 +++ b/Get-PC-Information.ps1 @@ -145,10 +145,11 @@ function Display-Result { } function Output-To-File { - $file = "$HOME\AppData\Local\Temp\PC-Information.log" + $file = "$HOME\Documents\PC-Information.log" if (!(Test-Path $file)) { - New-Item -Path $file -Type File -Force + New-Item -Path $file -Type File -Force >> $null + Write-Host "Log file created at $file `n" -ForegroundColor "Yellow" } "----------------------------------------------------------" >> $file "Computer" >> $file @@ -175,6 +176,7 @@ function Output-To-File { #" Mac " $macaddress >> $file "---------------------------------------------------------" >> $file "" >> $file + } Main \ No newline at end of file diff --git a/RUN-ME.bat b/RUN-ME.bat index ebcdeb1..481e757 100644 --- a/RUN-ME.bat +++ b/RUN-ME.bat @@ -1,4 +1,4 @@ @echo off -mode con:cols=79 lines=37 +mode con:cols=82 lines=37 powershell -ExecutionPolicy Bypass .\Get-PC-Information.ps1 \ No newline at end of file