So from what I'm reading, this is supposed to be simple - I'm just screwing it up somehow.
Issue I'm having is that if I use the full [path][filename] in the code it works fine. But if I try to store the path in a string - so I don't have to edit it 5 times if there is a change - logging fails and the script locks up.
I've tried every variation I could either find, or think of … But have as of yet, not found the correct answer.
Snippet of problem code below:
Now ^that^ works fine, but what I need is something more like this:
But I can't get it to work; double quotes, single quotes, with/without the -path parameter identifier - everything fails and locks the script.
Any Ideas on what I might be missing?
TIA
Stoic Joker
Issue I'm having is that if I use the full [path][filename] in the code it works fine. But if I try to store the path in a string - so I don't have to edit it 5 times if there is a change - logging fails and the script locks up.
I've tried every variation I could either find, or think of … But have as of yet, not found the correct answer.
Snippet of problem code below:
Code: ( powershell)
$logline = "$(Get-Date), $ChangeType, $FullPath"
Add-content "C:\Users\Me\Them\NPM Change Log.txt" -value $loglineNow ^that^ works fine, but what I need is something more like this:
Code: ( powershell)
$LogFile = "C:\Users\Me\Them\NPM Change Log.txt"
$logline = "$(Get-Date), $ChangeType, $FullPath"
Add-content "$LogFile -value $loglineBut I can't get it to work; double quotes, single quotes, with/without the -path parameter identifier - everything fails and locks the script.
Any Ideas on what I might be missing?
TIA
Stoic Joker










