Can I add a module from a share drive? I got the following but keep getting access denied. I checked credential and are correct. Appreciate your help.
invoke-Command -ComputerName mypc-ScriptBlock {
Import-Module \\server\share\PSRemoteRegistry-PassThru
$a = Get-Date
$date = $a.ToShortDateString() + " " + $a.ToShortTimeString()
New-RegKey -Hive CurrentUser -Key "SOFTWARE\Microsoft\Office\14.0\Word\Security\Trusted Locations" -Name Location3 -PassThru
Set-RegDWord -Hive CurrentUser -Key "SOFTWARE\Microsoft\Office\14.0\Word\Security\Trusted Locations\Location3" -Value AllowSubfolders -Data -Force
Set-Regstring -Hive CurrentUser -Key "SOFTWARE\Microsoft\Office\14.0\Word\Security\Trusted Locations\Location3" -Value Path -Data "C:\Program Files (x86)\Microsoft Office\Office14\STARTUP\" -Force
Set-Regstring -Hive CurrentUser -Key "SOFTWARE\Microsoft\Office\14.0\Word\Security\Trusted Locations\Location3" -Value Description -Data "Use for Mathtype" -Force
Set-Regstring -Hive CurrentUser -Key "SOFTWARE\Microsoft\Office\14.0\Word\Security\Trusted Locations\Location3" -Value Date -Data $date -Force
} -Credential $cred