This is with respect to this question which I had asked earlier - Powershell: Installing Modules on Target System
- What is the default module load path ?
Now after so many days, it has started giving this error (from my C# code)
Cannot find path 'C:\Users\angshuman\Documents\WindowsPowerShell\Modules\MyPSModules\MyPsModules.psd1' because it does not exist.
All the while it was nicely loading from the SysWow64 folder path - Why it is suddenly searching in user folder rather than Windows folder?
I am executing the same code via C# on a Windows 7 64-bit OS
_ps = PowerShell.Create();
_ps.AddScript("Import-Module MyPSModules -PassThru");
Collection<PSObject> psObjects = _ps.Invoke();