Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

Convert Deploy command step (regedit) into powershell help needed.

Hi,

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:

result

0

Comments

1 comment
Date Votes
  • For this I recommend substituting $(Get-Location) with $pwd. $pwd = present working directory and should be the exact same as Get-Location.

    0