PowerShell quotes for Start-Process ArgumentList

Question:

I’m trying to have the app tablacus explorer open a folder path. This works fine with the following formatting:

But I would really like to have the path in a variable ($dir = 'C:\Program Files'), and I can’t seem to get the quotes right so it gets interpreted properly.

Thank you for your help.

Answer:

I found two solutions for this on the MS Blog:


or

Source:

PowerShell quotes for Start-Process ArgumentList by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply