ps_cmdlet = r'Get-Acl -Path "HKLM:\SOFTWARE\{ab}" | Format-List'
p = subprocess.call(['powershell', '-Command', '& {'+ps_cmdlet+'}'],shell=True)
I am getting the following error
Get-Acl : Cannot find path 'HKLM:\SOFTWARE\{ab}' because it does not exist.
At line:1 char:4
+ & {Get-Acl -Path "HKLM:\SOFTWARE\{ab}" | Format-List}
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (:) [Get-Acl], ItemNotFoundException
+ FullyQualifiedErrorId : GetAcl_PathNotFound_Exception,Microsoft.PowerShell.Commands.GetAclCommand
Escape the brackets with backticks: