I’ve been trying to write this script that has a path to a .dll with a space in it. Every example I came upon either used single quotes, double quotes or nothing at all.

I tried

Import-Module -name 'c:\program files\EqualLogic\bin\EqlPSTools.dll'

and

Import-Module -name "c:\program files\EqualLogic\bin\EqlPSTools.dll"

There are 2 ways that worked:

Import-Module -name c:\program` files\EqualLogic\bin\EqlPSTools.dll

Using the back tick character, below the tilde on a Windows keyboard. Not to be confused with the opening single quote.

keyboard

and

Import-Module -name ("c:\program files\EqualLogic\bin\EqlPSTools.dll")

For more on commonly confused characters, check out this page.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.