New-ItemProperty $clefAModifier -Name "(default)" -Value $TexteCommande -PropertyType "ExpandString" | Out-Null New-ItemProperty $clefAModifier -Name "slxOldValue" -Value $oldCmdValue -PropertyType "String" | Out-Null $slxOldValue = Get-ItemProperty $clefAModifier -Name "slxOldValue" -ErrorAction Silentl圜ontinue
$oldCmdKey = Get-Item $clefAModifier -ErrorAction Silentl圜ontinue $clefAModifier = "HKLM:\SOFTWARE\Classes\Microsoft.PowerShellScript.1\Shell\Open\Command" $TexteCommande = "%systemroot%\system32\WindowsPowerShell\v1.0\powershell.exe -Command ""&'%1'""" I wrote this a few years ago (run it with administrator rights): Set-PowAsDefault -On