Skip to content

Commit

Permalink
* Fixed logging to file messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Bartenbach committed Jun 16, 2016
1 parent 2bfa529 commit 4b1cf3a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Get-PC-Information.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -175,6 +176,7 @@ function Output-To-File {
#" Mac " $macaddress >> $file
"---------------------------------------------------------" >> $file
"" >> $file

}

Main
2 changes: 1 addition & 1 deletion RUN-ME.bat
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 4b1cf3a

Please sign in to comment.