Closed nagysifa closed 2 years ago
Hello, Issue is related to the use Set-StrictMode -Version Latest. It arises an error due to the object property is not found. You can solve it in any of these three ways:
1.- Remove Set-StrictMode If it's possible.
2.- Use a try catch in the code at line 333:
try {
$allApplicationAssociationToasts += Get-ChildItem -Path HKLM:SOFTWARE\Clients\StartMenuInternet\* , HKCU:SOFTWARE\Clients\StartMenuInternet\* -ErrorAction SilentlyContinue |
ForEach-Object {
(Get-ItemProperty ("$($_.PSPath)\Capabilities\" + (@("URLAssociations", "FileAssociations") | Select-Object -Index $Extension.Contains("."))) -ErrorAction SilentlyContinue).$Extension
}
}
catch {}
3.- Fix line 333 with Select-Object
(Get-ItemProperty ("$($_.PSPath)\Capabilities\" + (@("URLAssociations", "FileAssociations") | Select-Object -Index $Extension.Contains("."))) -ErrorAction SilentlyContinue) | Select-Object -ExpandProperty $Extension -ErrorAction SilentlyContinue
To set Notepad.exe as default You can use the ProgId:
Set-FTA 'txtfile' .ps1
Thanks for the quick reply, using the first solution listed (temporarily disabling StrictMode), since it does not require modifying the SFTA script.
Windows 11 build 22000 PSVersion 5.1.22000.65 PS-SFTA 1.2.0
A simple example to reproduce the error:
Register-FTA throws the following error: