powershell, pwsh, windows/*: fix PowerShell conventions (#11465)
This commit is contained in:

committed by
GitHub

parent
1027451fe5
commit
159626c127
@@ -1,20 +1,20 @@
|
||||
# add-appxpackage
|
||||
# Add-AppxPackage
|
||||
|
||||
> A PowerShell utility to add a signed app package (`.appx`, `.msix`, `.appxbundle` and `.msixbundle`) to a user account.
|
||||
> More information: <https://learn.microsoft.com/powershell/module/appx/add-appxpackage>.
|
||||
> More information: <https://learn.microsoft.com/powershell/module/appx/Add-AppxPackage>.
|
||||
|
||||
- Add an app package:
|
||||
|
||||
`add-appxpackage -Path {{path\to\package.msix}}`
|
||||
`Add-AppxPackage -Path {{path\to\package.msix}}`
|
||||
|
||||
- Add an app package with dependencies:
|
||||
|
||||
`add-appxpackage -Path {{path\to\package.msix}} -DependencyPath {{path\to\dependencies.msix}}`
|
||||
`Add-AppxPackage -Path {{path\to\package.msix}} -DependencyPath {{path\to\dependencies.msix}}`
|
||||
|
||||
- Install an app using the app installer file:
|
||||
|
||||
`add-appxpackage -AppInstallerFile {{path\to\app.appinstaller}}`
|
||||
`Add-AppxPackage -AppInstallerFile {{path\to\app.appinstaller}}`
|
||||
|
||||
- Add an unsigned package:
|
||||
|
||||
`add-appxpackage -Path {{path\to\package.msix}} -DependencyPath {{path\to\dependencies.msix}} -AllowUnsigned`
|
||||
`Add-AppxPackage -Path {{path\to\package.msix}} -DependencyPath {{path\to\dependencies.msix}} -AllowUnsigned`
|
||||
|
37
pages/windows/powershell.md
Normal file
37
pages/windows/powershell.md
Normal file
@@ -0,0 +1,37 @@
|
||||
# powershell
|
||||
|
||||
> Command-line shell and scripting language designed especially for system administration.
|
||||
> This command refers to PowerShell version 5.1 and below (also known as the legacy Windows PowerShell). To use the newer, cross-platform version of PowerShell (also known as PowerShell Core), use `pwsh` instead of `powershell`.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/powershell>.
|
||||
|
||||
- Start an interactive shell session:
|
||||
|
||||
`powershell`
|
||||
|
||||
- Start an interactive shell session without loading startup configs:
|
||||
|
||||
`powershell -NoProfile`
|
||||
|
||||
- Execute specific commands:
|
||||
|
||||
`powershell -Command "{{echo 'powershell is executed'}}"`
|
||||
|
||||
- Execute a specific script:
|
||||
|
||||
`powershell -File {{path/to/script.ps1}}`
|
||||
|
||||
- Start a session with a specific version of PowerShell:
|
||||
|
||||
`powershell -Version {{version}}`
|
||||
|
||||
- Prevent a shell from exit after running startup commands:
|
||||
|
||||
`powershell -NoExit`
|
||||
|
||||
- Describe the format of data sent to PowerShell:
|
||||
|
||||
`powershell -InputFormat {{Text|XML}}`
|
||||
|
||||
- Determine how an output from PowerShell is formatted:
|
||||
|
||||
`powershell -OutputFormat {{Text|XML}}`
|
@@ -1,20 +1,20 @@
|
||||
# remove-appxpackage
|
||||
# Remove-AppxPackage
|
||||
|
||||
> A PowerShell utility to remove an app package from one or more user accounts.
|
||||
> More information: <https://learn.microsoft.com/powershell/module/appx/remove-appxpackage>.
|
||||
> More information: <https://learn.microsoft.com/powershell/module/appx/Remove-AppxPackage>.
|
||||
|
||||
- Remove an app package:
|
||||
|
||||
`remove-appxpackage {{package}}`
|
||||
`Remove-AppxPackage {{package}}`
|
||||
|
||||
- Remove an app package for a specific user:
|
||||
|
||||
`remove-appxpackage {{package}} -User {{username}}`
|
||||
`Remove-AppxPackage {{package}} -User {{username}}`
|
||||
|
||||
- Remove an app package for all users:
|
||||
|
||||
`remove-appxpackage {{package}} -AllUsers`
|
||||
`Remove-AppxPackage {{package}} -AllUsers`
|
||||
|
||||
- Remove an app package but preserve it's app data:
|
||||
|
||||
`remove-appxpackage {{package}} -PreserveApplicationData`
|
||||
`Remove-AppxPackage {{package}} -PreserveApplicationData`
|
||||
|
@@ -6,24 +6,24 @@
|
||||
|
||||
- Remove specific files or registry keys (without subkeys):
|
||||
|
||||
`Remove-Item {{path\to\file_or_key1 path\to\file_or_key2 ...}}`
|
||||
`Remove-Item {{path\to\file_or_key1 , path\to\file_or_key2 ...}}`
|
||||
|
||||
- Remove hidden or read-only files:
|
||||
|
||||
`Remove-Item -Force {{path\to\file1 path\to\file2 ...}}`
|
||||
`Remove-Item -Force {{path\to\file1 , path\to\file2 ...}}`
|
||||
|
||||
- Remove specific files or registry keys interactively prompting before each removal:
|
||||
|
||||
`Remove-Item -Confirm {{path\to\file_or_key1 path\to\file_or_key2 ...}}`
|
||||
`Remove-Item -Confirm {{path\to\file_or_key1 , path\to\file_or_key2 ...}}`
|
||||
|
||||
- Remove specific files and directories recursively (Windows 10 version 1909 or later):
|
||||
|
||||
`Remove-Item -Recurse {{path\to\file_or_directory1 path\to\file_or_directory2 ...}}`
|
||||
`Remove-Item -Recurse {{path\to\file_or_directory1 , path\to\file_or_directory2 ...}}`
|
||||
|
||||
- Remove specific Windows registry keys and all its subkeys:
|
||||
|
||||
`Remove-Item -Recurse {{path\to\key1 path\to\key2 ...}}`
|
||||
`Remove-Item -Recurse {{path\to\key1 , path\to\key2 ...}}`
|
||||
|
||||
- Perform a dry run of the deletion process:
|
||||
|
||||
`Remove-Item -WhatIf {{path\to\file1 path\to\file2 ...}}`
|
||||
`Remove-Item -WhatIf {{path\to\file1 , path\to\file2 ...}}`
|
||||
|
@@ -5,4 +5,4 @@
|
||||
|
||||
- View documentation for the original command:
|
||||
|
||||
`tldr where-object`
|
||||
`tldr select-string`
|
||||
|
Reference in New Issue
Block a user