mirror of
https://github.com/PowerShell/PowerShell.git
synced 2024-11-23 01:34:19 +08:00
Change docs.microsoft.com
to learn.microsoft.com
(#19994)
This commit is contained in:
parent
92833aee64
commit
5595072568
@ -1,6 +1,6 @@
|
||||
# EditorConfig is awesome: https://EditorConfig.org
|
||||
# .NET coding convention settings for EditorConfig
|
||||
# https://docs.microsoft.com/visualstudio/ide/editorconfig-code-style-settings-reference
|
||||
# https://learn.microsoft.com/visualstudio/ide/editorconfig-code-style-settings-reference
|
||||
#
|
||||
# This file comes from dotnet repositories:
|
||||
# https://github.com/dotnet/runtime/blob/master/.editorconfig
|
||||
|
2
.github/CONTRIBUTING.md
vendored
2
.github/CONTRIBUTING.md
vendored
@ -402,7 +402,7 @@ Repeat offenses may result in a permanent ban from the PowerShell org.
|
||||
[up-for-grabs]: https://github.com/powershell/powershell/issues?q=is%3Aopen+is%3Aissue+label%3AUp-for-Grabs
|
||||
[semantic linefeeds]: https://rhodesmill.org/brandon/2012/one-sentence-per-line/
|
||||
[PowerShell-Docs]: https://github.com/powershell/powershell-docs/
|
||||
[use-vscode-editor]: https://docs.microsoft.com/dotnet/core/tutorials/with-visual-studio-code
|
||||
[use-vscode-editor]: https://learn.microsoft.com/dotnet/core/tutorials/with-visual-studio-code
|
||||
[repository-maintainer]: ../docs/community/governance.md#repository-maintainers
|
||||
[area-expert]: ../docs/community/governance.md#area-experts
|
||||
[first-time-issue]: https://github.com/powershell/powershell/issues?q=is%3Aopen+is%3Aissue+label%3AFirst-Time-Issue
|
||||
|
2
.github/ISSUE_TEMPLATE/Bug_Report.yaml
vendored
2
.github/ISSUE_TEMPLATE/Bug_Report.yaml
vendored
@ -21,7 +21,7 @@ body:
|
||||
required: true
|
||||
- label: Refer to the [FAQ](https://github.com/PowerShell/PowerShell/blob/master/docs/FAQ.md).
|
||||
required: true
|
||||
- label: Refer to [Differences between Windows PowerShell 5.1 and PowerShell](https://docs.microsoft.com/powershell/scripting/whats-new/differences-from-windows-powershell).
|
||||
- label: Refer to [Differences between Windows PowerShell 5.1 and PowerShell](https://learn.microsoft.com/powershell/scripting/whats-new/differences-from-windows-powershell).
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
|
@ -23,7 +23,7 @@ body:
|
||||
required: true
|
||||
- label: Refer to the [FAQ](https://github.com/PowerShell/PowerShell/blob/master/docs/FAQ.md).
|
||||
required: true
|
||||
- label: Refer to [Differences between Windows PowerShell 5.1 and PowerShell](https://docs.microsoft.com/powershell/scripting/whats-new/differences-from-windows-powershell).
|
||||
- label: Refer to [Differences between Windows PowerShell 5.1 and PowerShell](https://learn.microsoft.com/powershell/scripting/whats-new/differences-from-windows-powershell).
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
|
4
.github/SUPPORT.md
vendored
4
.github/SUPPORT.md
vendored
@ -5,9 +5,9 @@ If you do not see your problem captured, please file a [new issue][] and follow
|
||||
Also make sure to see the [Official Support Policy][].
|
||||
If you know how to fix the issue, feel free to send a pull request our way. (The [Contribution Guides][] apply to that pull request, you may want to give it a read!)
|
||||
|
||||
[Official Support Policy]: https://docs.microsoft.com/powershell/scripting/powershell-support-lifecycle
|
||||
[Official Support Policy]: https://learn.microsoft.com/powershell/scripting/powershell-support-lifecycle
|
||||
[FAQ]: https://github.com/PowerShell/PowerShell/tree/master/docs/FAQ.md
|
||||
[Contribution Guides]: https://github.com/PowerShell/PowerShell/tree/master/.github/CONTRIBUTING.md
|
||||
[known issues]: https://docs.microsoft.com/powershell/scripting/whats-new/differences-from-windows-powershell
|
||||
[known issues]: https://learn.microsoft.com/powershell/scripting/whats-new/differences-from-windows-powershell
|
||||
[GitHub issues]: https://github.com/PowerShell/PowerShell/issues
|
||||
[new issue]: https://github.com/PowerShell/PowerShell/issues/new/choose
|
||||
|
712
.globalconfig
712
.globalconfig
File diff suppressed because it is too large
Load Diff
@ -261,7 +261,7 @@ dlwyatt
|
||||
dockerbasedbuild
|
||||
dockerfile
|
||||
dockerfiles
|
||||
docs.microsoft.com
|
||||
learn.microsoft.com
|
||||
doctordns
|
||||
don'ts
|
||||
dongbo
|
||||
|
24
ADOPTERS.md
24
ADOPTERS.md
@ -14,26 +14,26 @@ This is a list of adopters of using PowerShell in production or in their product
|
||||
|
||||
* [Azure Cloud Shell](https://shell.azure.com/) provides a batteries-included browser-based PowerShell environment used by Azure administrators to manage their environment.
|
||||
It includes up-to-date PowerShell modules for `Azure`, `AzureAD`, `Exchange`, `Teams`, and many more.
|
||||
More information about Azure Cloud Shell is available at [Azure Cloud Shell Overview.](https://docs.microsoft.com/azure/cloud-shell/overview)
|
||||
More information about Azure Cloud Shell is available at [Azure Cloud Shell Overview.](https://learn.microsoft.com/azure/cloud-shell/overview)
|
||||
* [Azure Functions - PowerShell](https://github.com/Azure/azure-functions-powershell-worker) is a serverless compute service to execute PowerShell scripts in the cloud without worrying about managing resources.
|
||||
In addition, Azure Functions provides client tools such as [`Az.Functions`](https://www.powershellgallery.com/packages/Az.Functions), a cross-platform PowerShell module to manage function apps and service plans in the cloud.
|
||||
For more information about Functions, please visit [functions overview](https://docs.microsoft.com/azure/azure-functions/functions-overview).
|
||||
* [PowerShell Universal](https://ironmansoftware.com/powershell-universal) is a cross-platform web framework for PowerShell.
|
||||
It provides the ability to create robust, interactive websites, REST APIs, and Electron-based desktop apps with PowerShell script.
|
||||
For more information about Functions, please visit [functions overview](https://learn.microsoft.com/azure/azure-functions/functions-overview).
|
||||
* [PowerShell Universal](https://ironmansoftware.com/powershell-universal) is a cross-platform web framework for PowerShell.
|
||||
It provides the ability to create robust, interactive websites, REST APIs, and Electron-based desktop apps with PowerShell script.
|
||||
More information about PowerShell Universal Dashboard is available at the [PowerShell Universal Dashboard Docs](https://docs.universaldashboard.io).
|
||||
* [System Frontier](https://systemfrontier.com/solutions/powershell/) provides dynamically generated web GUIs and REST APIs for PowerShell and other scripting languages.
|
||||
Enable non-admins like help desk and tier 1 support teams to execute secure web based tools on any platform `without admin rights`.
|
||||
Configure flexible RBAC permissions from an intuitive interface, without a complex learning curve.
|
||||
* [System Frontier](https://systemfrontier.com/solutions/powershell/) provides dynamically generated web GUIs and REST APIs for PowerShell and other scripting languages.
|
||||
Enable non-admins like help desk and tier 1 support teams to execute secure web based tools on any platform `without admin rights`.
|
||||
Configure flexible RBAC permissions from an intuitive interface, without a complex learning curve.
|
||||
Script output along with all actions are audited. Manage up to 5,000 nodes for free with the [Community Edition](https://systemfrontier.com/solutions/community-edition/).
|
||||
* [Amazon AWS](https://aws.com) supports PowerShell in a wide variety of its products including [AWS tools for PowerShell](https://github.com/aws/aws-tools-for-powershell),
|
||||
[AWS Lambda Support For PowerShell](https://github.com/aws/aws-lambda-dotnet/tree/master/PowerShell) and [AWS PowerShell Tools for `CodeBuild`](https://docs.aws.amazon.com/powershell/latest/reference/items/CodeBuild_cmdlets.html)
|
||||
as well as supporting PowerShell Core in both Windows and Linux EC2 Images.
|
||||
* [Azure Resource Manager Deployment Scripts](https://docs.microsoft.com/azure/azure-resource-manager/templates/deployment-script-template) Complete the "last mile" of your Azure Resource Manager (ARM) template deployments with a Deployment Script, which enables you to run an arbitrary PowerShell script in the context of a deployment.
|
||||
Designed to let you complete tasks that should be part of a deployment, but are not possible in an ARM template today — for example, creating a Key Vault certificate or querying an external API for a new CIDR block.
|
||||
* [Azure Pipelines Hosted Agents](https://docs.microsoft.com/azure/devops/pipelines/agents/hosted?view=azure-devops) Windows, Ubuntu, and MacOS Agents used by Azure Pipelines customers have PowerShell pre-installed so that customers can make use of it for all their CI/CD needs.
|
||||
* [Azure Resource Manager Deployment Scripts](https://learn.microsoft.com/azure/azure-resource-manager/templates/deployment-script-template) Complete the "last mile" of your Azure Resource Manager (ARM) template deployments with a Deployment Script, which enables you to run an arbitrary PowerShell script in the context of a deployment.
|
||||
Designed to let you complete tasks that should be part of a deployment, but are not possible in an ARM template today — for example, creating a Key Vault certificate or querying an external API for a new CIDR block.
|
||||
* [Azure Pipelines Hosted Agents](https://learn.microsoft.com/azure/devops/pipelines/agents/hosted?view=azure-devops) Windows, Ubuntu, and MacOS Agents used by Azure Pipelines customers have PowerShell pre-installed so that customers can make use of it for all their CI/CD needs.
|
||||
* [GitHub Actions Virtual Environments for Hosted Runners](https://help.github.com/actions/reference/virtual-environments-for-github-hosted-runners) Windows, Ubuntu, and macOS virtual environments used by customers of GitHub Actions include PowerShell out of the box.
|
||||
* [GitHub Actions Python builds](https://github.com/actions/python-versions) GitHub Actions uses PowerShell to automate building Python from source for its runners.
|
||||
* [Microsoft HoloLens](https://www.microsoft.com/hololens) makes extensive use of PowerShell 7+ throughout the development cycle to automate tasks such as firmware assembly and automated testing.
|
||||
* [Power BI](https://powerbi.microsoft.com/) provides PowerShell users a set of cmdlets in [MicrosoftPowerBIMgmt](https://docs.microsoft.com/powershell/power-bi) module to manage and automate the Power BI service.
|
||||
* [Power BI](https://powerbi.microsoft.com/) provides PowerShell users a set of cmdlets in [MicrosoftPowerBIMgmt](https://learn.microsoft.com/powershell/power-bi) module to manage and automate the Power BI service.
|
||||
This is in addition to Power BI leveraging PowerShell internally for various engineering systems and infrastructure for its service.
|
||||
* [Windows 10 IoT Core](https://docs.microsoft.com/windows/iot-core/windows-iot-core) is a small form factor Windows edition for IoT devices and now you can easily include the [PowerShell package](https://github.com/ms-iot/iot-adk-addonkit/blob/master/Tools/IoTCoreImaging/Docs/Import-PSCoreRelease.md#Import-PSCoreRelease) in your imaging process.
|
||||
* [Windows 10 IoT Core](https://learn.microsoft.com/windows/iot-core/windows-iot-core) is a small form factor Windows edition for IoT devices and now you can easily include the [PowerShell package](https://github.com/ms-iot/iot-adk-addonkit/blob/master/Tools/IoTCoreImaging/Docs/Import-PSCoreRelease.md#Import-PSCoreRelease) in your imaging process.
|
||||
|
36
README.md
36
README.md
@ -109,25 +109,25 @@ You can also download the PowerShell binary archives for Windows, macOS and Linu
|
||||
[pv-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.4/powershell-7.4.0-preview.4-linux-arm64.tar.gz
|
||||
[pv-snap]: https://snapcraft.io/powershell-preview
|
||||
|
||||
[in-windows]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-windows
|
||||
[in-ubuntu16]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#ubuntu-1604
|
||||
[in-ubuntu18]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#ubuntu-1804
|
||||
[in-ubuntu20]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#ubuntu-2004
|
||||
[in-windows]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-windows
|
||||
[in-ubuntu16]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#ubuntu-1604
|
||||
[in-ubuntu18]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#ubuntu-1804
|
||||
[in-ubuntu20]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#ubuntu-2004
|
||||
[in-ubuntu22]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-on-linux?view=powershell-7.3#ubuntu
|
||||
[in-deb10]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#debian-10
|
||||
[in-centos]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#centos-7
|
||||
[in-rhel7]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#red-hat-enterprise-linux-rhel-7
|
||||
[in-opensuse]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#opensuse
|
||||
[in-fedora]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#fedora
|
||||
[in-archlinux]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#arch-linux
|
||||
[in-macos]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-macos
|
||||
[in-deb10]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#debian-10
|
||||
[in-centos]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#centos-7
|
||||
[in-rhel7]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#red-hat-enterprise-linux-rhel-7
|
||||
[in-opensuse]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#opensuse
|
||||
[in-fedora]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#fedora
|
||||
[in-archlinux]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#arch-linux
|
||||
[in-macos]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-macos
|
||||
[in-docker]: https://github.com/PowerShell/PowerShell-Docker
|
||||
[in-kali]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#kali
|
||||
[in-windows-zip]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-windows#zip
|
||||
[in-tar-linux]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#binary-archives
|
||||
[in-tar-macos]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-macos#binary-archives
|
||||
[in-raspbian]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#raspbian
|
||||
[in-arm]: https://docs.microsoft.com/powershell/scripting/install/powershell-core-on-arm
|
||||
[in-kali]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#kali
|
||||
[in-windows-zip]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-windows#zip
|
||||
[in-tar-linux]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#binary-archives
|
||||
[in-tar-macos]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-macos#binary-archives
|
||||
[in-raspbian]: https://learn.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#raspbian
|
||||
[in-arm]: https://learn.microsoft.com/powershell/scripting/install/powershell-core-on-arm
|
||||
[corefx-win]:https://github.com/dotnet/core/blob/main/release-notes/6.0/supported-os.md#windows
|
||||
[corefx-linux]:https://github.com/dotnet/core/blob/main/release-notes/6.0/supported-os.md#linux
|
||||
[corefx-macos]:https://github.com/dotnet/core/blob/main/release-notes/6.0/supported-os.md#macos
|
||||
@ -237,7 +237,7 @@ License: By requesting and using the Container OS Image for Windows containers,
|
||||
|
||||
### Telemetry
|
||||
|
||||
Please visit our [about_Telemetry](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_telemetry)
|
||||
Please visit our [about_Telemetry](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_telemetry)
|
||||
topic to read details about telemetry gathered by PowerShell.
|
||||
|
||||
## Governance
|
||||
|
@ -18,7 +18,7 @@ switch ($TestHook) {
|
||||
default {
|
||||
$jobScript = {
|
||||
# This registers Microsoft Update via a predifened GUID with the Windows Update Agent.
|
||||
# https://docs.microsoft.com/en-us/windows/win32/wua_sdk/opt-in-to-microsoft-update
|
||||
# https://learn.microsoft.com/windows/win32/wua_sdk/opt-in-to-microsoft-update
|
||||
|
||||
$serviceManager = (New-Object -ComObject Microsoft.Update.ServiceManager)
|
||||
$isRegistered = $serviceManager.QueryServiceRegistration('7971f918-a847-4430-9279-4a52d1efe18d').Service.IsRegisteredWithAu
|
||||
|
@ -1622,7 +1622,7 @@ function Publish-TestResults
|
||||
# NUnit allowed values are: Passed, Failed, Inconclusive or Ignored (the spec says Skipped but it doesn' work with Azure DevOps)
|
||||
# https://github.com/nunit/docs/wiki/Test-Result-XML-Format
|
||||
# Azure DevOps Reporting is so messed up for NUnit V2 and doesn't follow their own spec
|
||||
# https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/test/publish-test-results?view=azure-devops&tabs=yaml
|
||||
# https://learn.microsoft.com/azure/devops/pipelines/tasks/test/publish-test-results?view=azure-devops&tabs=yaml
|
||||
# So, we will map skipped to the actual value in the NUnit spec and they will ignore all results for tests which were not executed
|
||||
Get-Content $Path | ForEach-Object {
|
||||
$_ -replace 'result="Ignored"', 'result="Skipped"'
|
||||
|
@ -1,6 +1,6 @@
|
||||
# DSC MOF Compilation Demo
|
||||
|
||||
[PowerShell Desired State Configuration](https://docs.microsoft.com/powershell/scripting/dsc/overview) is a declarative configuration platform for Windows and Linux.
|
||||
[PowerShell Desired State Configuration](https://learn.microsoft.com/powershell/dsc/overview) is a declarative configuration platform for Windows and Linux.
|
||||
DSC configurations can be authored in PowerShell and compiled into the resultant MOF document.
|
||||
|
||||
This demo shows use of PowerShell to author a DSC configuration to set the configuration of an Apache web server. PowerShell scripting is used to assess distribution and version-specific properties,
|
||||
|
@ -23,7 +23,7 @@ We use the [.NET Command-Line Interface][dotnet-cli] (`dotnet`) to build the man
|
||||
Installing the toolchain is as easy as running `Start-PSBootstrap` in PowerShell.
|
||||
Of course, this requires a self-hosted copy of PowerShell on Linux.
|
||||
|
||||
Fortunately, this is as easy as [downloading and installing the package](https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#binary-archives).
|
||||
Fortunately, this is as easy as [downloading and installing the package](https://learn.microsoft.com/en-us/powershell/scripting/install/install-other-linux#binary-archives).
|
||||
The `./tools/install-powershell.sh` script will also install the PowerShell package.
|
||||
|
||||
In Bash:
|
||||
@ -53,7 +53,7 @@ The `Start-PSBootstrap` function does the following:
|
||||
|
||||
If you want to use `dotnet` outside of `Start-PSBuild`, add `~/.dotnet` to your `PATH` environment variable.
|
||||
|
||||
[dotnet-cli]: https://docs.microsoft.com/dotnet/core/tools/
|
||||
[dotnet-cli]: https://learn.microsoft.com/dotnet/core/tools/
|
||||
|
||||
## Build using our module
|
||||
|
||||
|
@ -47,7 +47,7 @@ Install-Dotnet
|
||||
It removes the previously installed version of .NET CLI and installs the version that PowerShell Core depends on.
|
||||
If you have any problems installing `dotnet`, please see their [documentation][cli-docs].
|
||||
|
||||
[dotnet-cli]: https://docs.microsoft.com/dotnet/core/tools/
|
||||
[dotnet-cli]: https://learn.microsoft.com/dotnet/core/tools/
|
||||
[cli-docs]: https://www.microsoft.com/net/core#windowscmd
|
||||
|
||||
## Build using our module
|
||||
|
@ -220,9 +220,9 @@ and macOS as well as Windows using the .NET Core 2.x SDK command-line tools.
|
||||
For more information on .NET Standard, check out the [documentation][net-std-docs]
|
||||
and the [.NET Standard YouTube channel][net-std-chan].
|
||||
|
||||
[dotnet-cli]: https://docs.microsoft.com/dotnet/core/tools/
|
||||
[dotnet-cli]: https://learn.microsoft.com/dotnet/core/tools/
|
||||
[net-core-sdk]: https://www.microsoft.com/net/download/core
|
||||
[net-std-docs]: https://docs.microsoft.com/dotnet/standard/net-standard
|
||||
[net-std-docs]: https://learn.microsoft.com/dotnet/standard/net-standard
|
||||
[net-std-chan]: https://www.youtube.com/playlist?list=PLRAdsfhKI4OWx321A_pr-7HhRNk7wOLLY
|
||||
[pscore-os]: https://github.com/powershell/powershell#get-powershell
|
||||
[readme]: ../../README.md
|
||||
|
@ -41,7 +41,7 @@ process named `powershell`, and will attach to it. If you need more fine-grained
|
||||
control, replace `processName` with `processId` and provide a PID. (Please be
|
||||
careful not to commit such a change.)
|
||||
|
||||
[core-debug]: https://docs.microsoft.com/dotnet/core/tutorials/with-visual-studio-code#debug
|
||||
[core-debug]: https://learn.microsoft.com/dotnet/core/tutorials/with-visual-studio-code#debug
|
||||
[vscode]: https://code.visualstudio.com/
|
||||
[OmniSharp]: https://github.com/OmniSharp/omnisharp-vscode
|
||||
|
||||
|
@ -88,7 +88,7 @@ We also run the [.NET code formatter tool](https://github.com/dotnet/codeformatt
|
||||
|
||||
### Documentation comments
|
||||
|
||||
* Create documentation using [XML documentation comments](https://docs.microsoft.com/dotnet/csharp/language-reference/xmldoc/) so that Visual Studio and other IDEs can use IntelliSense to show quick information about types or members.
|
||||
* Create documentation using [XML documentation comments](https://learn.microsoft.com/dotnet/csharp/language-reference/xmldoc/) so that Visual Studio and other IDEs can use IntelliSense to show quick information about types or members.
|
||||
|
||||
* Publicly visible types and their members must be documented.
|
||||
Internal and private members may use doc comments but it is not required.
|
||||
@ -189,16 +189,16 @@ See [CODEOWNERS](../../.github/CODEOWNERS) for more information about the area e
|
||||
* Consider using the `Interlocked` class instead of the `lock` statement to atomically change simple states. The `Interlocked` class provides better performance for updates that must be atomic.
|
||||
|
||||
* Here are some useful links for your reference:
|
||||
* [Framework Design Guidelines](https://docs.microsoft.com/dotnet/standard/design-guidelines/index) - Naming, Design and Usage guidelines including:
|
||||
* [Arrays](https://docs.microsoft.com/dotnet/standard/design-guidelines/arrays)
|
||||
* [Collections](https://docs.microsoft.com/dotnet/standard/design-guidelines/guidelines-for-collections)
|
||||
* [Exceptions](https://docs.microsoft.com/dotnet/standard/design-guidelines/exceptions)
|
||||
* [Best Practices for Developing World-Ready Applications](https://docs.microsoft.com/dotnet/core/extensions/best-practices-for-developing-world-ready-apps) - Unicode, Culture, Encoding and Localization.
|
||||
* [Best Practices for Exceptions](https://docs.microsoft.com/dotnet/standard/exceptions/best-practices-for-exceptions)
|
||||
* [Best Practices for Using Strings in .NET](https://docs.microsoft.com/dotnet/standard/base-types/best-practices-strings)
|
||||
* [Best Practices for Regular Expressions in .NET](https://docs.microsoft.com/dotnet/standard/base-types/best-practices)
|
||||
* [Serialization Guidelines](https://docs.microsoft.com/dotnet/standard/serialization/serialization-guidelines)
|
||||
* [Managed Threading Best Practices](https://docs.microsoft.com/dotnet/standard/threading/managed-threading-best-practices)
|
||||
* [Framework Design Guidelines](https://learn.microsoft.com/dotnet/standard/design-guidelines/index) - Naming, Design and Usage guidelines including:
|
||||
* [Arrays](https://learn.microsoft.com/dotnet/standard/design-guidelines/arrays)
|
||||
* [Collections](https://learn.microsoft.com/dotnet/standard/design-guidelines/guidelines-for-collections)
|
||||
* [Exceptions](https://learn.microsoft.com/dotnet/standard/design-guidelines/exceptions)
|
||||
* [Best Practices for Developing World-Ready Applications](https://learn.microsoft.com/dotnet/core/extensions/best-practices-for-developing-world-ready-apps) - Unicode, Culture, Encoding and Localization.
|
||||
* [Best Practices for Exceptions](https://learn.microsoft.com/dotnet/standard/exceptions/best-practices-for-exceptions)
|
||||
* [Best Practices for Using Strings in .NET](https://learn.microsoft.com/dotnet/standard/base-types/best-practices-strings)
|
||||
* [Best Practices for Regular Expressions in .NET](https://learn.microsoft.com/dotnet/standard/base-types/best-practices)
|
||||
* [Serialization Guidelines](https://learn.microsoft.com/dotnet/standard/serialization/serialization-guidelines)
|
||||
* [Managed Threading Best Practices](https://learn.microsoft.com/dotnet/standard/threading/managed-threading-best-practices)
|
||||
|
||||
## Portable Code
|
||||
|
||||
|
@ -41,7 +41,7 @@ There is a special hosting scenario for native hosts,
|
||||
where Trusted Platform Assemblies (TPA) do not include PowerShell assemblies,
|
||||
such as the in-box `powershell.exe` in Nano Server and the Azure DSC host.
|
||||
|
||||
For such hosting scenarios, the native host needs to bootstrap by calling [`PowerShellAssemblyLoadContextInitializer.SetPowerShellAssemblyLoadContext`](https://docs.microsoft.com/dotnet/api/system.management.automation.powershellassemblyloadcontextinitializer.setpowershellassemblyloadcontext).
|
||||
For such hosting scenarios, the native host needs to bootstrap by calling [`PowerShellAssemblyLoadContextInitializer.SetPowerShellAssemblyLoadContext`](https://learn.microsoft.com/dotnet/api/system.management.automation.powershellassemblyloadcontextinitializer.setpowershellassemblyloadcontext).
|
||||
When using this API, the native host can pass in the path to the directory that contains PowerShell assemblies.
|
||||
A handler will then be registered to the [`Resolving`](https://github.com/dotnet/corefx/blob/d6678e9653defe3cdfff26b2ff62135b6b22c77f/src/System.Runtime.Loader/ref/System.Runtime.Loader.cs#L38)
|
||||
event of the default load context to deal with the loading of assemblies from that directory.
|
||||
|
@ -180,7 +180,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
}
|
||||
catch (Exception e) when (
|
||||
// Handle exceptions related to file access to provide more specific error message
|
||||
// https://docs.microsoft.com/en-us/dotnet/standard/io/handling-io-errors
|
||||
// https://learn.microsoft.com/dotnet/standard/io/handling-io-errors
|
||||
e is IOException ||
|
||||
e is UnauthorizedAccessException ||
|
||||
e is NotSupportedException ||
|
||||
|
@ -1634,7 +1634,7 @@ namespace Microsoft.PowerShell
|
||||
if (Platform.IsWindowsDesktop)
|
||||
{
|
||||
// Note: this API can detect if a third-party screen reader is active, such as NVDA, but not the in-box Windows Narrator.
|
||||
// Quoted from https://docs.microsoft.com/windows/win32/api/winuser/nf-winuser-systemparametersinfoa about the
|
||||
// Quoted from https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-systemparametersinfoa about the
|
||||
// accessibility parameter 'SPI_GETSCREENREADER':
|
||||
// "Narrator, the screen reader that is included with Windows, does not set the SPI_SETSCREENREADER or SPI_GETSCREENREADER flags."
|
||||
bool enabled = false;
|
||||
|
@ -9,10 +9,10 @@ Licensed under the MIT License.
|
||||
<!ENTITY csharpIdentifierOtherCharacterRegex "&csharpIdentifierLetterCharacterRegex;\p{Nd}_">
|
||||
<!ENTITY csharpIdentifierRegex "[&csharpIdentifierFirstCharacterRegex;][&csharpIdentifierOtherCharacterRegex;]{0,100}">
|
||||
<!ENTITY csharpNamespaceRegex "(&csharpIdentifierRegex;)(\.&csharpIdentifierRegex;){0,10}">
|
||||
|
||||
|
||||
<!ENTITY clrTypeSpecialCharacterRegex "\,\=\ \+\&\*\[\]\.\\\-\"">
|
||||
<!ENTITY clrTypeRegex "[&csharpIdentifierOtherCharacterRegex;&clrTypeSpecialCharacterRegex;]{1,1000}">
|
||||
|
||||
|
||||
<!ENTITY powerShellVerbCharacterRegex "\p{Ll}\p{Lu}\p{Lt}\p{Lo}\p{Lm}">
|
||||
<!ENTITY powerShellNounCharacterRegex "&powerShellVerbCharacterRegex;\p{Nd}">
|
||||
<!ENTITY powerShellAliasCharacterRegex "&powerShellNounCharacterRegex;_-">
|
||||
@ -25,16 +25,16 @@ Licensed under the MIT License.
|
||||
]>
|
||||
<!--
|
||||
csharpIdentifierRegex based on C# Language Specification 3.0, section 2.4.2 Idenfifiers
|
||||
- the C# spec allows \p{Pc}\p{Cf}\p{Mn}\{Mc} in csharpIdentifierOtherCharacterRegex,
|
||||
- the C# spec allows \p{Pc}\p{Cf}\p{Mn}\{Mc} in csharpIdentifierOtherCharacterRegex,
|
||||
but those characters classes seem risky wrt code injection attacks, so they were
|
||||
removed above.
|
||||
removed above.
|
||||
- '_' (ASCII 95) is the only character in \p{Pc} class out of the first 0..255 characters
|
||||
- No characters in the first 0..255 characters belong to \p{Cf}, \p{Mn}, \p{Mc}
|
||||
|
||||
clrTypeRegex and clrTypeSpecialCharacterRegex are based on https://docs.microsoft.com/dotnet/framework/reflection-and-codedom/specifying-fully-qualified-type-names
|
||||
|
||||
|
||||
clrTypeRegex and clrTypeSpecialCharacterRegex are based on https://learn.microsoft.com/dotnet/framework/reflection-and-codedom/specifying-fully-qualified-type-names
|
||||
|
||||
clrTypeSpecialCharacterRegex includes the following characters;
|
||||
|
||||
|
||||
- ',' - part of ReflectionDimension and TypeName productions in BNF
|
||||
- '=' - part of AssemblyProperty production in BNF
|
||||
- ' ' - unspecified in the docs, but apparently allowed (i.e. between NamespaceTypeName and AssemblyNameSpec in the TypeName production
|
||||
@ -44,17 +44,17 @@ Licensed under the MIT License.
|
||||
- '[' and ']' - part of ArrayTypeSpec production in BNF
|
||||
- '.' - part of ReflectionDimension and NamespaceTypeName productions in BNF
|
||||
- '\' - an escape character
|
||||
- '-' - required for Culture property of an Assembly.
|
||||
- '-' - required for Culture property of an Assembly.
|
||||
RFC-1766 defines the format of a culture identifier as:
|
||||
Language-Tag = Primary-tag *( "-" Subtag )
|
||||
Primary-tag = 1*8ALPHA
|
||||
Subtag = 1*8ALPHA
|
||||
- '"' - unspecified in the docs, but used in the examples (i.e. Culture="")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-->
|
||||
<xsd:schema
|
||||
<xsd:schema
|
||||
elementFormDefault="qualified"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:cps="http://schemas.microsoft.com/cmdlets-over-objects/2009/11"
|
||||
@ -63,8 +63,8 @@ Licensed under the MIT License.
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en-us">
|
||||
This schema defines the format of PowerShell CIM Modules.
|
||||
A PowerShell CIM Module defines a set of cmdlets that interact with a CIM class.
|
||||
|
||||
A PowerShell CIM Module defines a set of cmdlets that interact with a CIM class.
|
||||
|
||||
A PowerShell CIM Module needs to be saved in a file with ".cdxml" extension.
|
||||
A ".cdxml" file can be imported into a PowerShell session directly by Import-Module cmdlet,
|
||||
or by referring to the ".cdxml" file from NestedModules or RootModule entry of
|
||||
@ -87,7 +87,7 @@ Licensed under the MIT License.
|
||||
<xsd:field xpath="@Aliases" />
|
||||
</xsd:unique>
|
||||
</xsd:element>
|
||||
|
||||
|
||||
<!-- ############################################################ -->
|
||||
<!-- # ENUM ##################################################### -->
|
||||
|
||||
@ -103,36 +103,36 @@ Licensed under the MIT License.
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
|
||||
|
||||
<xsd:attribute name="EnumName" type="cps:EnumTypeName" use="required">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en-us">
|
||||
EnumName attribute specifies the name of a .NET enum.
|
||||
This is the name to use in a PSType attribute.
|
||||
|
||||
The name should include a namespace to avoid naming conflicts
|
||||
|
||||
The name should include a namespace to avoid naming conflicts
|
||||
(i.e. the name should be "Networking.MyEnum" rather than "MyEnum").
|
||||
|
||||
|
||||
The system will prefix the name of the enum with the following namespace: "Microsoft.PowerShell.Cmdletization.GeneratedTypes"
|
||||
(i.e. "Networking.MyEnum" will become "Microsoft.PowerShell.Cmdletization.GeneratedTypes.Networking.MyEnum").
|
||||
When referring to the enum in types.ps1xml and format.ps1xml files, one has to use the full, prefixed name of the enum.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
|
||||
|
||||
<xsd:attribute name="UnderlyingType" type="cps:PowerShellTypeIdentifier" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en-us">
|
||||
Underlying type of the enum.
|
||||
|
||||
|
||||
C# Language Specification allows (in section 4.1.9 "Enumeration types") only the following
|
||||
underlying types:
|
||||
byte (System.Byte),
|
||||
sbyte (System.SByte),
|
||||
short (System.Int16),
|
||||
ushort (System.UInt16),
|
||||
int (System.Int32),
|
||||
uint (System.UInt32),
|
||||
underlying types:
|
||||
byte (System.Byte),
|
||||
sbyte (System.SByte),
|
||||
short (System.Int16),
|
||||
ushort (System.UInt16),
|
||||
int (System.Int32),
|
||||
uint (System.UInt32),
|
||||
long (System.Int64),
|
||||
ulong (System.UInt64).
|
||||
</xsd:documentation>
|
||||
@ -142,7 +142,7 @@ Licensed under the MIT License.
|
||||
<xsd:attribute name="BitwiseFlags" type="xsd:boolean" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en-us">
|
||||
BitwiseFlags attribute specifies if the .NET enum will be decorated with a System.FlagsAttribute.
|
||||
BitwiseFlags attribute specifies if the .NET enum will be decorated with a System.FlagsAttribute.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
@ -196,7 +196,7 @@ Licensed under the MIT License.
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
|
||||
|
||||
<xsd:element name="StaticCmdlets" minOccurs="0">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
@ -240,10 +240,10 @@ Licensed under the MIT License.
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en-us">
|
||||
CmdletAdapter attribute specifies which .NET class is responsible for translating
|
||||
cmdlet invocations into queries and method invocations.
|
||||
|
||||
If this attribute is ommited, then by default the cmdlets are translated into WMI queries and method invocations.
|
||||
|
||||
cmdlet invocations into queries and method invocations.
|
||||
|
||||
If this attribute is ommited, then by default the cmdlets are translated into WMI queries and method invocations.
|
||||
|
||||
The class specified here has to be derived from Microsoft.PowerShell.Cmdletization.CmdletAdapter class.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
@ -253,7 +253,7 @@ Licensed under the MIT License.
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
ClassName attribute specified the class that the cmdlets work against.
|
||||
|
||||
|
||||
Example: "root/cimv2/Win32_Process"
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
@ -282,8 +282,8 @@ Licensed under the MIT License.
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en-us">
|
||||
Cmdlet element under InstanceCmdlets element defines a cmdlet that wraps an instance method.
|
||||
|
||||
Cmdlet parameters of a cmdlet defined this way are a sum of
|
||||
|
||||
Cmdlet parameters of a cmdlet defined this way are a sum of
|
||||
1) cmdlet parameters defined through GetCmdletParameters elements
|
||||
2) cmdlet parameters mapped to input parameters of the method defined by Method element
|
||||
</xsd:documentation>
|
||||
@ -313,7 +313,7 @@ Licensed under the MIT License.
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en-us">
|
||||
Cmdlet element under StaticCmdlets element defines a cmdlet that wraps one or more static methods.
|
||||
|
||||
|
||||
Cmdlet parameters of a cmdlet defined this way are mapped to input parameters of methods defined by Method element
|
||||
Each wrapped method corresponds to a parameter set of the cmdlet.
|
||||
</xsd:documentation>
|
||||
@ -341,9 +341,9 @@ Licensed under the MIT License.
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en-us">
|
||||
GetCmdlet element defines cmdlet metadata for the cmdlet that queries for object instances.
|
||||
|
||||
|
||||
If GetCmdlet element is ommited, then the default verb ("Get") and noun (based on <DefaultNoun> element) are going to be used.
|
||||
|
||||
|
||||
GetCmdlet element is typically used for one of the following items:
|
||||
- To allow the Get cmdlet to have different GetCmdletParameters than other cmdlets (for example to make all parameters optional for Get cmdlet, but make some parameters mandatory for other cmdlets)
|
||||
- To change the verb of the cmdlet (for example to use "Find" where appropriate)
|
||||
@ -365,19 +365,19 @@ Licensed under the MIT License.
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
|
||||
<xsd:complexType name="CommonCmdletMetadata">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="Obsolete" type="cps:ObsoleteAttributeMetadata" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
|
||||
|
||||
<xsd:attribute name="Verb" type="cps:Verb" use="required">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en-us">
|
||||
Verb attribute specifies the verb of the cmdlet.
|
||||
|
||||
|
||||
Please refer to Cmdlet Design Guidelines for a list of approved verbs.
|
||||
|
||||
|
||||
Verb attribute is equivalent to the verbName parameter of System.Management.Automation.CmdletAttribute constructor.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
@ -387,9 +387,9 @@ Licensed under the MIT License.
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en-us">
|
||||
Noun attribute specifies the noun of the cmdlet.
|
||||
|
||||
|
||||
If the Noun attribute is ommited, then contents of the DefaultNoun element are used.
|
||||
|
||||
|
||||
Noun attribute is equivalent to the nounName parameter of System.Management.Automation.CmdletAttribute constructor.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
@ -407,9 +407,9 @@ Licensed under the MIT License.
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en-us">
|
||||
ConfirmImpact attribute specifies the impact of the cmdlet.
|
||||
|
||||
|
||||
ConfirmImpact attribute determines the default -Confirm and -WhatIf behavior.
|
||||
|
||||
|
||||
ConfirmImpact attribute is equivalent to the ConfirmImpact property of System.Management.Automation.CmdletAttribute.
|
||||
Presence of the ConfirmImpact attribute is equivalent to setting to true the SupportsShouldProcess property of System.Management.Automation.CmdletAttribute.
|
||||
</xsd:documentation>
|
||||
@ -420,11 +420,11 @@ Licensed under the MIT License.
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en-us">
|
||||
HelpUri attribute specifies the URI with the help content.
|
||||
|
||||
|
||||
HelpUri attribute is used for the following help experience: Get-Help -Online <cmdlet name>
|
||||
|
||||
|
||||
HelpUri attribute is equivalent to the HelpUri property of System.Management.Automation.CmdletAttribute
|
||||
|
||||
|
||||
Example: "http://go.microsoft.com/fwlink/?LinkID=113309"
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
@ -454,12 +454,12 @@ Licensed under the MIT License.
|
||||
</xsd:unique>
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
|
||||
|
||||
<xsd:attribute name="CmdletParameterSet" type="cps:ParameterSetName" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en-us">
|
||||
CmdletParameterSet attribute specifies the name of a cmdlet parameter set associated with the static method.
|
||||
|
||||
|
||||
If CmdletParameterSet is ommited, then the name of the cmdlet parameter set is auto-generated based on the name of the method.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
@ -467,7 +467,7 @@ Licensed under the MIT License.
|
||||
</xsd:extension>
|
||||
</xsd:complexContent>
|
||||
</xsd:complexType>
|
||||
|
||||
|
||||
<xsd:complexType name="InstanceMethodMetadata">
|
||||
<xsd:complexContent>
|
||||
<xsd:extension base="cps:CommonMethodMetadata">
|
||||
@ -508,8 +508,8 @@ Licensed under the MIT License.
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
MethodName attribute specified the name of the method that the cmdlet invocations are mapped to.
|
||||
|
||||
Some method names are recognized and handled in a special way.
|
||||
|
||||
Some method names are recognized and handled in a special way.
|
||||
"cim:CreateInstance" is mapped to the WMI's static, intrinsic CreateInstance method. Names of method parameters have to map to names of properties.
|
||||
"cim:ModifyInstance" is mapped to the WMI's instance, intrinsic ModifyInstance method. Names of method parameters have to map to names of properties.
|
||||
"cim:DeleteInstance" is mapped to the WMI's instance, intrinsic DeleteInstance method. All method parameters are ignored.
|
||||
@ -547,7 +547,7 @@ Licensed under the MIT License.
|
||||
<xsd:attribute name="ParameterName" type="cps:NonEmptyString" use="required" />
|
||||
<xsd:attribute name="DefaultValue" type="xsd:string" use="optional" />
|
||||
</xsd:complexType>
|
||||
|
||||
|
||||
<!-- ############################################################ -->
|
||||
<!-- # PROPERTIES METADATA ###################################### -->
|
||||
|
||||
@ -594,7 +594,7 @@ Licensed under the MIT License.
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="OptionName" type="cps:NonEmptyString" use="required" />
|
||||
</xsd:complexType>
|
||||
|
||||
|
||||
<xsd:complexType name="Association">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="AssociatedInstance">
|
||||
@ -606,12 +606,12 @@ Licensed under the MIT License.
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
|
||||
|
||||
<xsd:attribute name="Association" type="cps:NonEmptyString" use="required">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Association attribute specifies the name of the association between the cmdlet argument and the instances the cmdlet acts against.
|
||||
|
||||
|
||||
Association attribute is equivalent to the associationClassName parameter of EnumerateAssociatedInstances method of Microsoft.Management.Infrastructure.CimSession class.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
@ -627,7 +627,7 @@ Licensed under the MIT License.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
|
||||
|
||||
<xsd:attribute name="ResultRole" type="cps:NonEmptyString" use="required">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
@ -638,7 +638,7 @@ Licensed under the MIT License.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
|
||||
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="PropertyMetadata">
|
||||
@ -651,43 +651,43 @@ Licensed under the MIT License.
|
||||
<xsd:documentation xml:lang="en-us">
|
||||
RegularQuery element defines a cmdlet parameter that limits which objects will be processed by the cmdlet
|
||||
- only objects with a property value equal to the cmdlet parameter argument will be processed.
|
||||
|
||||
|
||||
Comparison of strings and characters is always case-insensitive.
|
||||
|
||||
|
||||
Example for <RegularQuery> element that is applied to an ObjectId property:
|
||||
The following cmdlet invocation:
|
||||
Get-MyObject -ObjectId 123,456
|
||||
will be translated into the following WQL query:
|
||||
SELECT * FROM MyObject WHERE ((ObjectId = 123) OR (ObjectId = 456))
|
||||
|
||||
SELECT * FROM MyObject WHERE ((ObjectId = 123) OR (ObjectId = 456))
|
||||
|
||||
Example for <RegularQuery AllowGlobbing="false" > element that is applied to a Name property:
|
||||
The following cmdlet invocation:
|
||||
Get-MyObject -LiteralName p*,q*
|
||||
Get-MyObject -LiteralName p*,q*
|
||||
will be translated into the following WQL query:
|
||||
SELECT * FROM MyObject WHERE ((Name = "p*") OR (Name = "q*"))
|
||||
|
||||
SELECT * FROM MyObject WHERE ((Name = "p*") OR (Name = "q*"))
|
||||
|
||||
Example for <RegularQuery AllowGlobbing="true" > element that is applied to a Name property:
|
||||
The following cmdlet invocation:
|
||||
Get-MyObject -Name p*,q*
|
||||
Get-MyObject -Name p*,q*
|
||||
will be translated into the following WQL query:
|
||||
SELECT * FROM MyObject WHERE ((Name like "p%") OR (Name like "q%"))
|
||||
SELECT * FROM MyObject WHERE ((Name like "p%") OR (Name like "q%"))
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
|
||||
|
||||
<xsd:element name="ExcludeQuery" type="cps:WildcardablePropertyQuery">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en-us">
|
||||
ExcludeQuery element defines a cmdlet parameter that limits which objects will be processed by the cmdlet
|
||||
- only objects with a property value *not* equal to the cmdlet parameter argument will be processed.
|
||||
|
||||
|
||||
Comparison of strings and characters is always case-insensitive.
|
||||
|
||||
|
||||
Example for <ExcludeQuery> element that is applied to an ObjectId property:
|
||||
The following cmdlet invocation:
|
||||
Get-MyObject -ExcludeObjectId 123,456
|
||||
will be translated into the following WQL query:
|
||||
SELECT * FROM MyObject WHERE ((NOT Name = 123) AND (NOT Name = 456))
|
||||
SELECT * FROM MyObject WHERE ((NOT Name = 123) AND (NOT Name = 456))
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
@ -697,7 +697,7 @@ Licensed under the MIT License.
|
||||
<xsd:documentation xml:lang="en-us">
|
||||
MinValueQuery element defines a cmdlet parameter that limits which objects will be processed by the cmdlet
|
||||
- only objects with a property value greater than or equal to the cmdlet parameter argument will be processed.
|
||||
|
||||
|
||||
Example for <MinValueQuery> element that is applied to an WorkingSet property:
|
||||
The following cmdlet invocation:
|
||||
Get-MyObject -MinWorkingSet 123
|
||||
@ -725,17 +725,17 @@ Licensed under the MIT License.
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="PropertyName" type="cps:NonEmptyString" use="required" />
|
||||
</xsd:complexType>
|
||||
|
||||
|
||||
<xsd:complexType name="WildcardablePropertyQuery">
|
||||
<xsd:complexContent>
|
||||
<xsd:extension base="cps:PropertyQuery">
|
||||
<xsd:attribute name="AllowGlobbing" type="xsd:boolean" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en-us">
|
||||
AllowGlobbing attribute specifies if strings with globbing characters (wildcards) are supported.
|
||||
|
||||
AllowGlobbing attribute specifies if strings with globbing characters (wildcards) are supported.
|
||||
|
||||
Example of a wildcard: "foo*" (matches all strings beginning with "foo")
|
||||
|
||||
|
||||
If AllowGlobbing attribute is ommited then its value is based on the type of the filtered property.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
@ -777,19 +777,19 @@ Licensed under the MIT License.
|
||||
</xsd:extension>
|
||||
</xsd:complexContent>
|
||||
</xsd:complexType>
|
||||
|
||||
|
||||
<xsd:complexType name="CmdletParameterMetadataForGetCmdletParameter">
|
||||
<xsd:complexContent>
|
||||
<xsd:extension base="cps:CmdletParameterMetadata">
|
||||
<xsd:attribute name="ValueFromPipeline" type="xsd:boolean" use="optional" />
|
||||
<xsd:attribute name="ValueFromPipelineByPropertyName" type="xsd:boolean" use="optional" />
|
||||
|
||||
|
||||
<xsd:attribute name="CmdletParameterSets" type="cps:NonEmptyListOfParameterSetNames" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en-us">
|
||||
CmdletParameterSets attribute is a whitespace-separated list of names of parameter sets,
|
||||
that the cmdlet parameter should belong to.
|
||||
|
||||
|
||||
If this parameter is ommited, then the cmdlet parameter belongs to all parameter sets.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
@ -797,7 +797,7 @@ Licensed under the MIT License.
|
||||
</xsd:extension>
|
||||
</xsd:complexContent>
|
||||
</xsd:complexType>
|
||||
|
||||
|
||||
<xsd:complexType name="CmdletParameterMetadata">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="AllowEmptyCollection" minOccurs="0" />
|
||||
@ -817,14 +817,14 @@ Licensed under the MIT License.
|
||||
<xsd:attribute name="Max" type="xsd:nonNegativeInteger" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<!-- ValidatePattern omitted - CDXML does not allow DOS attacks against PS client -->
|
||||
<!-- ValidatePattern omitted - CDXML does not allow DOS attacks against PS client -->
|
||||
<xsd:element name="ValidateRange" minOccurs="0">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="Min" type="xsd:integer" use="required" />
|
||||
<xsd:attribute name="Max" type="xsd:integer" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<!-- ValidateScript omitted - CDXML does not allow execution of arbitrary code in PS client -->
|
||||
<!-- ValidateScript omitted - CDXML does not allow execution of arbitrary code in PS client -->
|
||||
<xsd:element name="ValidateSet" minOccurs="0">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
@ -844,14 +844,14 @@ Licensed under the MIT License.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
|
||||
|
||||
<xsd:attribute name="PSName" type="cps:CmdletParameterName" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en-us">
|
||||
PSName attribute specifies the name of a cmdlet parameter.
|
||||
|
||||
|
||||
If PSName attribute is ommited then it is based on the contents of PropertyName or ParameterName or OptionName attribute (whichever one is applicable).
|
||||
|
||||
|
||||
Example:
|
||||
<Property PropertyName="Name">
|
||||
...
|
||||
@ -870,11 +870,11 @@ Licensed under the MIT License.
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en-us">
|
||||
Position attribute specifies position of the cmdlet parameter.
|
||||
|
||||
|
||||
If Position attribute is ommited, then the cmdlet parameter cannot be used positionally - the user always has to explicitly specify the name of the parameter.
|
||||
|
||||
|
||||
System may change relative parameter positions to guarantee that cmdlet parameters defined by GetCmdletParameters element are always
|
||||
before cmdlet parameters defined under Method element.
|
||||
before cmdlet parameters defined under Method element.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
@ -885,7 +885,7 @@ Licensed under the MIT License.
|
||||
<xsd:element name="ErrorCode" minOccurs="0">
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
|
||||
|
||||
<xsd:attribute name="PSName" type="cps:CmdletOutputName" use="optional" />
|
||||
</xsd:complexType>
|
||||
|
||||
@ -898,19 +898,19 @@ Licensed under the MIT License.
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en-us">
|
||||
PSType attribute specifies the name of the .NET type of the cmdlet parameter.
|
||||
|
||||
|
||||
Example: "System.String"
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
|
||||
|
||||
<xsd:attribute name="ETSType" type="cps:NonEmptyString" use="optional">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation xml:lang="en-us">
|
||||
ETSType attribute specifies the PowerShell type name of the type of the cmdlet parameter.
|
||||
|
||||
|
||||
ETSType attribute is equivalent to System.Management.Automation.PSTypeNameAttribute.
|
||||
|
||||
|
||||
Example: "Microsoft.Management.Infrastructure.CimInstance#Win32_Process"
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
@ -1011,7 +1011,7 @@ Licensed under the MIT License.
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:minLength value="1" />
|
||||
<xsd:maxLength value="100" />
|
||||
<xsd:pattern value="&powerShellParameterSetRegex;" />
|
||||
<xsd:pattern value="&powerShellParameterSetRegex;" />
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
|
||||
@ -1026,7 +1026,7 @@ Licensed under the MIT License.
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:minLength value="1" />
|
||||
<xsd:maxLength value="100" />
|
||||
<xsd:pattern value="&powerShellCmdletParameterRegex;" />
|
||||
<xsd:pattern value="&powerShellCmdletParameterRegex;" />
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
|
||||
@ -1034,7 +1034,7 @@ Licensed under the MIT License.
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:minLength value="1" />
|
||||
<xsd:maxLength value="100" />
|
||||
<xsd:pattern value="&powerShellCmdletParameterRegex;" />
|
||||
<xsd:pattern value="&powerShellCmdletParameterRegex;" />
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
|
||||
|
@ -7388,7 +7388,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
set
|
||||
{
|
||||
// Check for UTF-7 by checking for code page 65000
|
||||
// See: https://docs.microsoft.com/en-us/dotnet/core/compatibility/corefx#utf-7-code-paths-are-obsolete
|
||||
// See: https://learn.microsoft.com/dotnet/core/compatibility/corefx#utf-7-code-paths-are-obsolete
|
||||
if (value != null && value.CodePage == 65000)
|
||||
{
|
||||
_provider.WriteWarning(PathUtilsStrings.Utf7EncodingObsolete);
|
||||
@ -7880,7 +7880,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
return false;
|
||||
}
|
||||
|
||||
// The name surrogate bit 0x20000000 is defined in https://docs.microsoft.com/windows/win32/fileio/reparse-point-tags
|
||||
// The name surrogate bit 0x20000000 is defined in https://learn.microsoft.com/windows/win32/fileio/reparse-point-tags
|
||||
// Name surrogates (0x20000000) are reparse points that point to other named entities local to the filesystem
|
||||
// (like symlinks and mount points).
|
||||
// In the case of OneDrive, they are not name surrogates and would be safe to recurse into.
|
||||
@ -8113,7 +8113,7 @@ namespace System.Management.Automation.Internal
|
||||
|
||||
// Directories don't normally have alternate streams, so this is not an exceptional state.
|
||||
// If a directory has no alternate data streams, FindFirstStreamW returns ERROR_HANDLE_EOF.
|
||||
// If the file system (such as FAT32) does not support alternate streams, then
|
||||
// If the file system (such as FAT32) does not support alternate streams, then
|
||||
// ERROR_INVALID_PARAMETER is returned by FindFirstStreamW. See documentation:
|
||||
// https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-findfirststreamw
|
||||
if (error == NativeMethods.ERROR_HANDLE_EOF || error == NativeMethods.ERROR_INVALID_PARAMETER)
|
||||
|
@ -47,7 +47,7 @@ namespace System.Management.Automation
|
||||
{ Utf8, Encoding.Default },
|
||||
{ Utf8Bom, Encoding.UTF8 },
|
||||
{ Utf8NoBom, Encoding.Default },
|
||||
{ Utf32, Encoding.UTF32 },
|
||||
{ Utf32, Encoding.UTF32 },
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
@ -98,7 +98,7 @@ namespace System.Management.Automation
|
||||
internal static void WarnIfObsolete(Cmdlet cmdlet, Encoding encoding)
|
||||
{
|
||||
// Check for UTF-7 by checking for code page 65000
|
||||
// See: https://docs.microsoft.com/en-us/dotnet/core/compatibility/corefx#utf-7-code-paths-are-obsolete
|
||||
// See: https://learn.microsoft.com/dotnet/core/compatibility/corefx#utf-7-code-paths-are-obsolete
|
||||
if (encoding != null && encoding.CodePage == 65000)
|
||||
{
|
||||
cmdlet.WriteWarning(PathUtilsStrings.Utf7EncodingObsolete);
|
||||
|
@ -19,7 +19,7 @@ namespace System.Management.Automation.Internal
|
||||
/// <summary>
|
||||
/// Performing EventSource initialization in the Static Constructor since this is thread safe.
|
||||
/// Static constructors are guaranteed to be run only once per application domain, before any instances of a class are created or any static members are accessed.
|
||||
/// https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/static-constructors.
|
||||
/// https://learn.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/static-constructors.
|
||||
/// </summary>
|
||||
static TelemetryWrapper()
|
||||
{
|
||||
|
@ -369,7 +369,7 @@ function GetMultipartBody {
|
||||
<#
|
||||
Defines the list of redirect codes to test as well as the
|
||||
expected Method when the redirection is handled.
|
||||
See https://docs.microsoft.com/previous-versions/windows/apps/f92ssyy1(v=vs.105)
|
||||
See https://learn.microsoft.com/dotnet/api/system.net.httpstatuscode
|
||||
for additonal details.
|
||||
#>
|
||||
$redirectTests = @(
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Sample code from https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_script_internationalization
|
||||
# Sample code from https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_script_internationalization
|
||||
|
||||
$Day = DATA {
|
||||
# culture="en-US"
|
||||
|
@ -351,7 +351,7 @@ function New-ComplexPassword
|
||||
$password = [string]::Empty
|
||||
# Windows password complexity rule requires minimum 8 characters and using at least 3 of the
|
||||
# buckets above, so we just pick one from each bucket twice.
|
||||
# https://docs.microsoft.com/windows/security/threat-protection/security-policy-settings/password-must-meet-complexity-requirements
|
||||
# https://learn.microsoft.com/windows/security/threat-protection/security-policy-settings/password-must-meet-complexity-requirements
|
||||
1..2 | ForEach-Object {
|
||||
$Password += $numbers[(Get-Random $numbers.Length)] + $lowercase[(Get-Random $lowercase.Length)] +
|
||||
$uppercase[(Get-Random $uppercase.Length)] + $symbols[(Get-Random $symbols.Length)]
|
||||
|
@ -173,7 +173,7 @@ Function Start-HTTPListener {
|
||||
|
||||
Example: test=redirectex&type=Moved&multiredirect=true
|
||||
|
||||
See also https://docs.microsoft.com/dotnet/api/system.net.httpstatuscode
|
||||
See also https://learn.microsoft.com/dotnet/api/system.net.httpstatuscode
|
||||
#>
|
||||
"redirect"
|
||||
{
|
||||
|
@ -26,4 +26,4 @@ namespace PSTests.YourNameSpace
|
||||
}
|
||||
```
|
||||
|
||||
[xunit-filter]: https://docs.microsoft.com/dotnet/core/testing/selective-unit-tests
|
||||
[xunit-filter]: https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version='1.0' encoding='utf-8' standalone='yes'?>
|
||||
<!-- See definitions in C:\Windows\Microsoft.NET\Framework\v4.0.30319\CLR-ETW.man for .NET events -->
|
||||
<!-- See MSDN docs about 'region of interest': https://docs.microsoft.com/windows-hardware/test/wpt/regions-of-interest -->
|
||||
<!-- See MSDN docs about 'region of interest': https://learn.microsoft.com/windows-hardware/test/wpt/regions-of-interest -->
|
||||
<!--
|
||||
Unlike JIT, GC is largely single threaded and the times correlate very well with PerfView where we can drill down into each GC
|
||||
generation in the region graph in WPA.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version='1.0' encoding='utf-8' standalone='yes'?>
|
||||
<?Copyright (c) Microsoft Corporation.?>
|
||||
<!-- See MSDN docs about 'region of interest': https://docs.microsoft.com/windows-hardware/test/wpt/regions-of-interest -->
|
||||
<!-- See MSDN docs about 'region of interest': https://learn.microsoft.com/windows-hardware/test/wpt/regions-of-interest -->
|
||||
<InstrumentationManifest>
|
||||
<Instrumentation>
|
||||
<Regions>
|
||||
@ -316,4 +316,3 @@
|
||||
</Regions>
|
||||
</Instrumentation>
|
||||
</InstrumentationManifest>
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- To work with ngen'd images and non-ngen'd images, entries are duplicated,
|
||||
once with .dll, and again with .ni.dll -->
|
||||
<!-- See MSDN docs about 'region of interest': https://docs.microsoft.com/windows-hardware/test/wpt/stack-tags -->
|
||||
<!-- See MSDN docs about 'region of interest': https://learn.microsoft.com/windows-hardware/test/wpt/stack-tags -->
|
||||
<Tag Name="PowerShell">
|
||||
<Tag Name="Pipeline Execution">
|
||||
<Tag Name="Interpreter">
|
||||
@ -38,4 +38,3 @@
|
||||
<Entrypoint Module="System.Management.Automation.ni.dll" Method="System.Management.Automation.PipelineOps.*"/>
|
||||
</Tag>
|
||||
</Tag>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user