I'm happy to be proved wrong but I believe the only way round this is to use the 64-bit version of the AHK installer.
Also, you may need to run PowerShell code elevated if you get a "The requested operation requires elevation" error within PowerShell.
So, for example, to display a formatted list of Optional Features and avoid these two errors I had to use the following after installing the 64-bit version of the AHK installler:
Code: Select all
; Prompt to 'Run as Admin', i.e. show UAC dialog
If Not A_IsAdmin
{
Run *RunAs "%A_ScriptFullPath%" ; Requires v1.0.92.01+
ExitApp
}
psScript =
(
Get-WindowsOptionalFeature -Online |Sort -Property State |ft
)
; Use this call if you don't want to see PowerShell output
;RunWait PowerShell.exe -Command &{%psScript%} ,, hide
; Use this call if you want to see PowerShell output
Run powershell.exe -NoExit -Command %psScript%
Hope this helps...