31-08-2021

This commit is contained in:
2021-08-31 09:29:05 +02:00
parent 7d89fb0224
commit bb890cba15
28 changed files with 1888 additions and 47 deletions

View File

@@ -1,5 +1,71 @@
# Trucs
Ouvrir Windows Terminal en 3 panneaux:
```powershell
wt -p "Debian" `; split-pane -p "PowerShell 7" `; split-pane -p "Invite de commandes"
```
Ouvrir en 3 onglets dans Windows Terminal:
```powershell
wt -p "Debian" `; new-tab -p "PowerShell 7" `; new-tab -p "Invite de commandes"
```
Palette de commande:
`Ctrl + Shift + P`
Thèmes:
https://docs.microsoft.com/en-us/windows/terminal/tutorials/powerline-setup
https://ohmyposh.dev/docs/
#### Ouvrir une nouvelle fenêtre Powershell en administrateur:
1.
```powershell
Start-Process powershell -Verb runAs
```
https://stackoverflow.com/questions/7690994/running-a-command-as-administrator-using-powershell
2.
`Win + Ctrl + Maj + 8`
Si Powershell est en 8e position dans la barre des taches (le 1er étant l'Explorateur).
3.
```powershell
# ouvre une nouvelle fenêtre de Windows Terminal en mode admin.
powershell "Start-Process -Verb RunAs cmd.exe '/c start wt.exe'"
```
4.
[gsudo](https://github.com/gerardog/gsudo)
Installation:
```powershell
choco install gsudo
winget install gsudo
```
```powershell
# Dans PowerShell ou l'invite de commande:
# donne les droits admin à la console courante
gsudo
```
```powershell
@@ -177,3 +243,28 @@ Bash <-> PowerShell:
| | | |
| | | |
#### Réinitialiser Windows Store
1ere solution:
```powershell
PS> PowerShell -ExecutionPolicy Unrestricted $manifest = (Get-AppxPackage Microsoft.WindowsStore).InstallLocation + \AppxManifest.xml ; Add-AppxPackage -DisableDevelopmentMode -Register $manifest
```
2eme solution:
```powershell
PS> sfc /scannow
```
puis reboot (fonctionne W11)
3eme solution:
```powershell
DISM /Online /Cleanup-Image /ScanHealth
```
puis reboot