Eine PS1-Datei ist ein Skript oder Cmdlet , das von Windows PowerShell verwendet wird .
In dieser Anleitung erfahren Sie, wie Sie für alle Benutzer in Windows 10 ein benutzerdefiniertes Menü „Bearbeiten“ oder „Ausführen mit“ zum Kontextmenü für PowerShell-.ps1-Dateien hinzufügen oder entfernen .
Das Kontextmenü Bearbeiten oder Ausführen mit enthält die folgenden Elemente für PS1-Dateien:
- Mit PowerShell ausführen
- Führen Sie PowerShell als Administrator aus
- Mit PowerShell 7 ausführen
- Mit PowerShell 7 als Administrator ausführen
- Bearbeiten mit PowerShell ISE
- Bearbeiten Sie mit PowerShell ISE als Administrator
- Bearbeiten mit PowerShell ISE (x86)
- Bearbeiten Sie mit PowerShell ISE (x86) als Administrator
- Mit Notepad bearbeiten
- Bearbeiten Sie mit Notepad als Administrator

Fügen Sie „Bearbeiten oder Ausführen mit“ zum Rechtsklick-Menü der PS1-Datei in Windows 10 hinzu
So fügen Sie „Bearbeiten oder Ausführen mit“ zum Rechtsklickmenü der PS1-Datei in Windows 10 hinzu
Hier ist wie:
1. Führen Sie Schritt 2 (Hinzufügen – Rechtsklick), Schritt 3 (Hinzufügen – Umschalt + Rechtsklick) oder Schritt 4 (Löschen) unten aus, je nachdem, was Sie tun möchten.
2. Um das Kontextmenü „Bearbeiten oder Ausführen mit“ der PS1-Datei hinzuzufügen (zum Anzeigen einfach mit der rechten Maustaste klicken), laden Sie die Datei Add_Edit_or_Run_with_to_PS1_context_menu.reg herunter .
Inhalt der REG-Datei) - Code:
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\.ps1]
[HKEY_CLASSES_ROOT\.ps1]
@="Microsoft.PowerShellScript.1"
[-HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1]
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1]
"EditFlags"=dword:00020000
"FriendlyTypeName"=hex(2):40,00,22,00,25,00,73,00,79,00,73,00,74,00,65,00,6d,\
00,72,00,6f,00,6f,00,74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,\
33,00,32,00,5c,00,77,00,69,00,6e,00,64,00,6f,00,77,00,73,00,70,00,6f,00,77,\
00,65,00,72,00,73,00,68,00,65,00,6c,00,6c,00,5c,00,76,00,31,00,2e,00,30,00,\
5c,00,70,00,6f,00,77,00,65,00,72,00,73,00,68,00,65,00,6c,00,6c,00,2e,00,65,\
00,78,00,65,00,22,00,2c,00,2d,00,31,00,30,00,33,00,00,00
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\DefaultIcon]
@="\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell_ise.exe\",1"
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell]
@="Open"
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Open\Command]
@="\"C:\\Windows\\System32\\notepad.exe\" \"%1\""
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with]
"MUIVerb"="Edit or Run with"
"Extended"=-
"SubCommands"=""
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\001flyout]
"MUIVerb"="Run with PowerShell"
"Icon"="powershell.exe"
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\001flyout\Command]
@="\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\" \"-Command\" \"if((Get-ExecutionPolicy ) -ne 'AllSigned') { Set-ExecutionPolicy -Scope Process Bypass }; & '%1'\""
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\002flyout]
"MUIVerb"="Run with PowerShell as administrator"
"HasLUAShield"=""
"Icon"="powershell.exe"
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\002flyout\Command]
@="\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\" \"-Command\" \"\"& {Start-Process PowerShell.exe -ArgumentList '-ExecutionPolicy RemoteSigned -File \\\"%1\\\"' -Verb RunAs}\""
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\003flyout]
"MUIVerb"="Run with PowerShell 7"
"Icon"="pwsh.exe"
"CommandFlags"=dword:00000020
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\003flyout\Command]
@="\"C:\\Program Files\\PowerShell\\7\\pwsh.exe\" \"-Command\" \"if((Get-ExecutionPolicy ) -ne 'AllSigned') { Set-ExecutionPolicy -Scope Process Bypass }; & '%1'\""
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\004flyout]
"MUIVerb"="Run with PowerShell 7 as administrator"
"HasLUAShield"=""
"Icon"="pwsh.exe"
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\004flyout\Command]
@="\"C:\\Program Files\\PowerShell\\7\\pwsh.exe\" \"-Command\" \"\"& {Start-Process pwsh.exe -ArgumentList '-ExecutionPolicy RemoteSigned -File \\\"%1\\\"' -Verb RunAs}\""
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\005flyout]
"MUIVerb"="Edit with PowerShell ISE"
"Icon"="powershell_ise.exe"
"CommandFlags"=dword:00000020
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\005flyout\Command]
@="\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell_ise.exe\" \"%1\""
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\006flyout]
"MUIVerb"="Edit with PowerShell ISE as administrator"
"HasLUAShield"=""
"Icon"="powershell_ise.exe"
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\006flyout\Command]
@="PowerShell -windowstyle hidden -Command \"Start-Process cmd -ArgumentList '/s,/c,start PowerShell_ISE.exe \"\"%1\"\"' -Verb RunAs\""
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\007flyout]
"MUIVerb"="Edit with PowerShell ISE (x86)"
"Icon"="powershell_ise.exe"
"CommandFlags"=dword:00000020
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\007flyout\Command]
@="\"C:\\WINDOWS\\syswow64\\WindowsPowerShell\\v1.0\\powershell_ise.exe\" \"%1\""
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\008flyout]
"MUIVerb"="Edit with PowerShell ISE (x86) as administrator"
"HasLUAShield"=""
"Icon"="powershell_ise.exe"
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\008flyout\Command]
@="PowerShell -windowstyle hidden -Command \"Start-Process cmd -ArgumentList '/s,/c,start C:\\WINDOWS\\syswow64\\WindowsPowerShell\\v1.0\\powershell_ise.exe \"\"%1\"\"' -Verb RunAs\""
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\009flyout]
"MUIVerb"="Edit with Notepad"
"Icon"="notepad.exe"
"CommandFlags"=dword:00000020
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\009flyout\Command]
@="\"C:\\Windows\\System32\\notepad.exe\" \"%1\""
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\010flyout]
"MUIVerb"="Edit with Notepad as administrator"
"HasLUAShield"=""
"Icon"="notepad.exe"
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\010flyout\Command]
@="PowerShell -windowstyle hidden -Command \"Start-Process cmd -ArgumentList '/s,/c,start C:\\Windows\\System32\\notepad.exe \"\"%1\"\"' -Verb RunAs\""
3. Um das PS1-Datei-Kontextmenü „Bearbeiten oder Ausführen mit“ hinzuzufügen (zum Anzeigen Umschalten + Rechtsklick drücken), laden Sie die Datei Add_Shift + Edit_or_Run_with_to_PS1_context_menu.reg herunter .
Inhalt der REG-Codedatei:
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\.ps1]
[HKEY_CLASSES_ROOT\.ps1]
@="Microsoft.PowerShellScript.1"
[-HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1]
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1]
"EditFlags"=dword:00020000
"FriendlyTypeName"=hex(2):40,00,22,00,25,00,73,00,79,00,73,00,74,00,65,00,6d,\
00,72,00,6f,00,6f,00,74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,\
33,00,32,00,5c,00,77,00,69,00,6e,00,64,00,6f,00,77,00,73,00,70,00,6f,00,77,\
00,65,00,72,00,73,00,68,00,65,00,6c,00,6c,00,5c,00,76,00,31,00,2e,00,30,00,\
5c,00,70,00,6f,00,77,00,65,00,72,00,73,00,68,00,65,00,6c,00,6c,00,2e,00,65,\
00,78,00,65,00,22,00,2c,00,2d,00,31,00,30,00,33,00,00,00
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\DefaultIcon]
@="\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell_ise.exe\",1"
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell]
@="Open"
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Open\Command]
@="\"C:\\Windows\\System32\\notepad.exe\" \"%1\""
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with]
"MUIVerb"="Edit or Run with"
"Extended"=""
"SubCommands"=""
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\001flyout]
"MUIVerb"="Run with PowerShell"
"Icon"="powershell.exe"
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\001flyout\Command]
@="\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\" \"-Command\" \"if((Get-ExecutionPolicy ) -ne 'AllSigned') { Set-ExecutionPolicy -Scope Process Bypass }; & '%1'\""
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\002flyout]
"MUIVerb"="Run with PowerShell as administrator"
"HasLUAShield"=""
"Icon"="powershell.exe"
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\002flyout\Command]
@="\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\" \"-Command\" \"\"& {Start-Process PowerShell.exe -ArgumentList '-ExecutionPolicy RemoteSigned -File \\\"%1\\\"' -Verb RunAs}\""
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\003flyout]
"MUIVerb"="Run with PowerShell 7"
"Icon"="pwsh.exe"
"CommandFlags"=dword:00000020
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\003flyout\Command]
@="\"C:\\Program Files\\PowerShell\\7\\pwsh.exe\" \"-Command\" \"if((Get-ExecutionPolicy ) -ne 'AllSigned') { Set-ExecutionPolicy -Scope Process Bypass }; & '%1'\""
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\004flyout]
"MUIVerb"="Run with PowerShell 7 as administrator"
"HasLUAShield"=""
"Icon"="pwsh.exe"
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\004flyout\Command]
@="\"C:\\Program Files\\PowerShell\\7\\pwsh.exe\" \"-Command\" \"\"& {Start-Process pwsh.exe -ArgumentList '-ExecutionPolicy RemoteSigned -File \\\"%1\\\"' -Verb RunAs}\""
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\005flyout]
"MUIVerb"="Edit with PowerShell ISE"
"Icon"="powershell_ise.exe"
"CommandFlags"=dword:00000020
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\005flyout\Command]
@="\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell_ise.exe\" \"%1\""
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\006flyout]
"MUIVerb"="Edit with PowerShell ISE as administrator"
"HasLUAShield"=""
"Icon"="powershell_ise.exe"
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\006flyout\Command]
@="PowerShell -windowstyle hidden -Command \"Start-Process cmd -ArgumentList '/s,/c,start PowerShell_ISE.exe \"\"%1\"\"' -Verb RunAs\""
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\007flyout]
"MUIVerb"="Edit with PowerShell ISE (x86)"
"Icon"="powershell_ise.exe"
"CommandFlags"=dword:00000020
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\007flyout\Command]
@="\"C:\\WINDOWS\\syswow64\\WindowsPowerShell\\v1.0\\powershell_ise.exe\" \"%1\""
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\008flyout]
"MUIVerb"="Edit with PowerShell ISE (x86) as administrator"
"HasLUAShield"=""
"Icon"="powershell_ise.exe"
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\008flyout\Command]
@="PowerShell -windowstyle hidden -Command \"Start-Process cmd -ArgumentList '/s,/c,start C:\\WINDOWS\\syswow64\\WindowsPowerShell\\v1.0\\powershell_ise.exe \"\"%1\"\"' -Verb RunAs\""
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\009flyout]
"MUIVerb"="Edit with Notepad"
"Icon"="notepad.exe"
"CommandFlags"=dword:00000020
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\009flyout\Command]
@="\"C:\\Windows\\System32\\notepad.exe\" \"%1\""
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\010flyout]
"MUIVerb"="Edit with Notepad as administrator"
"HasLUAShield"=""
"Icon"="notepad.exe"
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\010flyout\Command]
@="PowerShell -windowstyle hidden -Command \"Start-Process cmd -ArgumentList '/s,/c,start C:\\Windows\\System32\\notepad.exe \"\"%1\"\"' -Verb RunAs\""
4. Um das Kontextmenü der PS1-Datei „Bearbeiten oder ausführen mit“ zu entfernen, laden Sie die Datei Remove_Edit_or_Run_with_from_PS1_context_menu.reg herunter .
Inhalt der REG-Codedatei:
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with]
5. Speichern Sie die .reg-Datei auf dem Desktop.
6. Doppelklicken Sie auf die heruntergeladene .reg-Datei , um sie zusammenzuführen.
7. Wenn Sie dazu aufgefordert werden, klicken Sie auf Ausführen > Ja (UAC) > Ja > OK, um die Zusammenführung zu genehmigen.
8. Jetzt können Sie die heruntergeladene .reg-Datei löschen, wenn Sie möchten.
Ich hoffe, Sie haben Erfolg.