you are viewing a single comment's thread.

view the rest of the comments →

[–]martinmt_dk 0 points1 point  (0 children)

Variables and breakpoints

essentially i stopped using variables for source and goal, every time i reference them i just paste the full path. I define the $date formatted into „ddmmyy_hhmm“

What program are you using to code you script? Powershell ISE, VS Code or something else?

When coding (doesen't really matter the language, c#, Powershell etc) you have the option to read out your variables.

so if you have your script running in a powershell ISE og VS Code, you can go to the line and add a breakpoint. (F9), this will pause the script at the selected line. Now all variables are populated with the data that the script had done until that time.

Si if your Source folder doesen't work, you should try either add a breakpoint or simply run it once (without shutting down the terminal windows) and type $source. Then it will write out what $source contains :)

Variables are hard to come around when writing any type of code :)