I am trying to add a line to the $env:psmodulepath for every technicians workstation in my workplace so they have access to the custom modules. I have a script with one line that I have tested on my local workstation and works without issue. All technicians have access to this S: drive:
$env:PSModulePath = $env:PSModulePath + “;S:\TechPro\TPModules\TPUserMod”
I created the GPO “Set-TPPSModulePath” within User Configuration -> Scripts -> Login -> PowershellScripts Tab -> Browsed to my script on the domain controller -> Selected “Run Windows PowerShell scripts last”
I pushed policy on the Domain Controller and my local workstation.
When I run GPresults /R, I see that the policy was applied to my workstation, however running $env:psmodulepath, I do not see the new path.
<p style=“text-align: left;”>PS C:\Users\bclanton\Google Drive\Code> $env:PSModulePath.split(’;’)
C:\Program Files (x86)\Windows Kits\10\Microsoft Application Virtualization\Sequencer\AppvPkgConverter
C:\Program Files (x86)\Windows Kits\10\Microsoft Application Virtualization\Sequencer\AppvSequencer
C:\Program Files (x86)\Windows Kits\10\Microsoft Application Virtualization</em>
C:\Program Files\Microsoft DaRT\v10\Modules</em>
C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\PowerShell</p>
Even when I UNC to this location and run it, it will not add the path when I launch it from the share on the domain controller.
I do not want to wipe what is already existing on this system variable, but just append it with a path to our server.
Is it possible to do this with this method?