PWn3R
Member
- Local time
- 7:27 PM
- Posts
- 11
- OS
- Windows 11 Insider Developer Preview
Good day!
Our team has been working to find a way to force Windows 11 to RUN .ps1 files by default. There is a valid function being run on approximately 3000 machines in our environment that has to run as a .ps1. This process was working with a single registry change on Windows 10, but does not work with that change on Windows 11.
We've spent hundreds of hours so far trying many different registry entries, and eventually found a combination of changes (below) that work SOME of the time. We are seeing that in some cases the permissions are changed on these registry locations, and that some of the values randomly change on the machines after Windows updates occur. We have to find a way to make this work, or we are looking at other uglier processes like making a .bat wrapper that echos the powershell to a file and then executes it, then deletes the ps1, etc. These would all be stacked ontop of another software solution that is using a generic account in Windows but impersonates the user when someone logs into the computer (username and password get passed to scripts that create the impersonated environment and other scripts clean it up on logout).
Has anyone else run into this and found a reliably working solution we can deploy via registry settings, group policy, or add to the image for these machines?
HKEY_CURRENT_USER
Key path Software\Classes\Applications\powershell.exe\shell\open\command
(Default)
Value type REG_SZ
Value data "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" "%1"
HKEY_CURRENT_USER
Key path Software\Classes\Applications\powershell.exe\shell\open\command
Value name (Default)
Value type REG_SZ
Value data "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" "%1"
HKEY_CURRENT_USER
Key path Software\Classes\ps1_auto_file\shell\open\command
Value name (Default)
Value type REG_SZ
Value data "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" "%1"
HKEY_CURRENT_USER
Key path Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.ps1\OpenWithList
Value name a
Value type REG_SZ
Value data powershell.exe
HKEY_CURRENT_USER
Key path Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.ps1\OpenWithList
Value name MRUList
Value type REG_SZ
Value data a
Our team has been working to find a way to force Windows 11 to RUN .ps1 files by default. There is a valid function being run on approximately 3000 machines in our environment that has to run as a .ps1. This process was working with a single registry change on Windows 10, but does not work with that change on Windows 11.
We've spent hundreds of hours so far trying many different registry entries, and eventually found a combination of changes (below) that work SOME of the time. We are seeing that in some cases the permissions are changed on these registry locations, and that some of the values randomly change on the machines after Windows updates occur. We have to find a way to make this work, or we are looking at other uglier processes like making a .bat wrapper that echos the powershell to a file and then executes it, then deletes the ps1, etc. These would all be stacked ontop of another software solution that is using a generic account in Windows but impersonates the user when someone logs into the computer (username and password get passed to scripts that create the impersonated environment and other scripts clean it up on logout).
Has anyone else run into this and found a reliably working solution we can deploy via registry settings, group policy, or add to the image for these machines?
HKEY_CURRENT_USER
Key path Software\Classes\Applications\powershell.exe\shell\open\command
(Default)
Value type REG_SZ
Value data "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" "%1"
HKEY_CURRENT_USER
Key path Software\Classes\Applications\powershell.exe\shell\open\command
Value name (Default)
Value type REG_SZ
Value data "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" "%1"
HKEY_CURRENT_USER
Key path Software\Classes\ps1_auto_file\shell\open\command
Value name (Default)
Value type REG_SZ
Value data "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" "%1"
HKEY_CURRENT_USER
Key path Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.ps1\OpenWithList
Value name a
Value type REG_SZ
Value data powershell.exe
HKEY_CURRENT_USER
Key path Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.ps1\OpenWithList
Value name MRUList
Value type REG_SZ
Value data a
My Computer
System One
-
- OS
- Windows 11 Insider Developer Preview
- Computer type
- PC/Desktop
- Manufacturer/Model
- Custom
- CPU
- 7950x3D
- Motherboard
- ASRock x670e Taichi
- Memory
- 64GB G.skill 6000Mhz CL32 @ 6400Mhz CL30
- Graphics Card(s)
- Nvidia Founders Edition RTX 4090
- Sound Card
- Scarlett Solo 3rd Gen
- Screen Resolution
- 1x4k@160hz and 2x1440p@165Hz
- Hard Drives
- 8xDell SAS 800GB SSD, 1x4TB Samsung 990 Pro, 1x2TB Samsung 980 Pro, 2x2TB Samsung 980 Pro, 4x980GB Sandisk SATA SSD
- PSU
- Seasonic Prime Platinum 1200W
- Case
- Thermaltake Tower 900 White
- Cooling
- 2x480 and 1x560 Rad custom loop
- Keyboard
- Glorius GMMK Pro
- Mouse
- Razer Naga Pro V2
- Internet Speed
- Symmetrical 1Gbps Fiber Optic on Palo Alto PA440
- Browser
- Microsoft Edge Developer Preview