Convert Deploy command step (regedit) into powershell help needed.
below cmd step adds Cisco installer path to target pc registry and app will be installed in Win7 compatibility mode in next step. %cd% will add full path to installer file, depends wher it will be (service-1 or service-2 etc):
reg.exe ADD "HKCU\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "%cd%\Cisco Unified CCX Historical Reports.msi" /t REG_SZ /d WIN7RTM /f
Anyway, works great but can this command be converted to powershell, meaning I dont know how to put %cd% to work correctly:
New-Item 'HKCU:\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers' -Force | New-ItemProperty -Name "$(Get-Location)\Cisco Unified CCX Historical Reports.msi" -Value WIN7RTM -Force | Out-Null
But $(Get-Location) working correctly only from local pc but not from Deploy.
Result of both commands from Deploy:
For this I recommend substituting $(Get-Location) with $pwd. $pwd = present working directory and should be the exact same as Get-Location.
Please sign in to leave a comment.