PowerShell – How to Import DscResource with Relative Paths?

Are you looking at importing DscResource with Relative Paths when working in PowerShell? If so, let’s have a look at some of the options that are available.

How to Import DscResource with Relative Paths?

There are times when you may want to import a module using the DscResource with relative paths in PowerShell. For example

Import-DscResource -Name ModuleName -Path “../TestModule”

 

This is not possible in PowerShell. If you need to import the module, just place them under the “Program Files\WindowsPowerShell\Modules” folder and then specify the module name along with the -Module parameter as shown below.

 

Import-DscResource -Module ModuleName


 

Share:

Leave A Reply

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

You May Also Like

If you are new to PowerShell and wondering how to add comments with-in your Powershell code , here’s how you...
If you want to find the version of the PowerShell that is installed on the PC , you can use...
There are many ways in which you can run your PowerShell Script. In this post , we will how to...