Permalink
Branch: master
Find file Copy path
4ac9ea2 Jan 10, 2019
1 contributor

Users who have contributed to this file

14 lines (8 sloc) 629 Bytes
$azDriveMAppingScriptUrl= "https://ntintune.blob.core.windows.net/intune-scripts/DriveMappingScript.ps1"
$regKeyLocation="HKCU:\Software\Microsoft\Windows\CurrentVersion\Run"
$psCommand= "PowerShell.exe -ExecutionPolicy Bypass -windowstyle hidden -command $([char]34)& {(Invoke-RestMethod '$azDriveMAppingScriptUrl').Replace('ï','').Replace('»','').Replace('¿','') | Invoke-Expression}$([char]34)"
if (-not(Test-Path -Path $regKeyLocation)){
New-ItemProperty -Path $regKeyLocation -Force
}
Set-ItemProperty -Path $regKeyLocation -Name "PowerShellDriveMapping" -Value $psCommand -Force
Invoke-Expression $psCommand