Messages - 4wd [ switch to compact view ]

Pages: prev1 ... 16 17 18 19 20 [21] 22 23 24 25 26 ... 1120next
101
Just FYI, PowerShell doesn't care if you use \ or / in paths so you could try:
Code: PowerShell [Select]
  1. $LogFile = "C:/Users/Me/Them/NPM Change Log.txt"

To get around possibly having to escape \

Also, is it just a typo but you seem to have only one " in:

Code: PowerShell [Select]
  1. Add-content "$LogFile -value $logline

To insert variables into a string you can try:

Code: PowerShell [Select]
  1. Add-content "$($LogFile)" -value $logline
That should expand the variable within the quotes.

I'm on a tablet atm so can't test these, in a couple of hours I can have a play.

Addendum: IIRC I had a similar thing with Add-Content that I was doing and the result was that Add-Content was one of the very few PowerShell commandlets that couldn't take a file in a variable.

I modified my script to use Out-File instead, eg.

Code: PowerShell [Select]
  1. "$(Get-Date), $ChangeType, $FullPath" | Out-File $Logfile -Append

Or similar, you may have to play around with enclosing the file variable in quotes as above.

102
Living Room / Re: Wordle: simple web word game
« on: January 05, 2022, 05:59 AM »
Brad Wyatt translated Wordle into a PowerShell module:
Play Wordle, the Puzzle Game Using PowerShell

2022-01-04-21.33.37-1024x862.jpg

103
You can also just double-click an ISO to have it mounted and opened in explorer, (providing the filetype hasn't been reassigned).

104
Living Room / Re: How to boot up an old PDP-11 computer from the 1970s
« on: December 16, 2021, 05:22 AM »
I remember using the PDP-11 back at uni, fun times programming on the old terminals.

105
Ignore me .... my brain hurts  :-\

Pages: prev1 ... 16 17 18 19 20 [21] 22 23 24 25 26 ... 1120next
Go to full version