diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 8fc9fefb8..048d20ef0 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -2,4 +2,4 @@ blank_issues_enabled: false contact_links: - name: Report a User documentation issue url: https://github.com/MicrosoftDocs/PowerShell-Docs-Modules/issues/new/choose - about: Report issues about the user documentation available on docs.microsoft.com. + about: Report issues about the user documentation available on learn.microsoft.com. diff --git a/CHANGELOG.MD b/CHANGELOG.MD index bbe2e241b..6321cd289 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -76,7 +76,7 @@ ### Miscellaneous -- Set Assembly version attribute (#1549) (by @JamesWTruher) +- Set Assembly version attribute (#1549) (by @JamesWTruher) ### Documentation @@ -209,7 +209,7 @@ The PRs for those improvements are: ## [1.18.3](https://github.com/PowerShell/PSScriptAnalyzer/tree/1.18.3) - 2019-09-13 -This release adds one more important fix, which prevents a leak of runspaces when repeatedly invoking the PSScriptAnalyzer cmdlets. Furthermore it ups the minimum version of PowerShell Core to `6.2.0` due to `6.1` reaching its [end of life](https://docs.microsoft.com/en-us/powershell/scripting/powershell-support-lifecycle?view=powershell-6#powershell-releases-end-of-life) this month. +This release adds one more important fix, which prevents a leak of runspaces when repeatedly invoking the PSScriptAnalyzer cmdlets. Furthermore it ups the minimum version of PowerShell Core to `6.2.0` due to `6.1` reaching its [end of life](https://learn.microsoft.com/powershell/scripting/install/PowerShell-Support-Lifecycle#powershell-end-of-support-dates) this month. - Change CommandInfoCache to implement IDisposable and clean up the runspace pool (#1335) (by @JamesWTruher) - Update Newtonsoft json to 12.0.1 due to PowerShell 6.1 going out of support (#1336) (by @bergmeister) @@ -275,11 +275,11 @@ The benefit to the user will be some enhancements and fixes in the formatter, es - Convert compatibility module to binary module, fix compatibility with Azure environments (#1212) (by @rjmholt) - Prevent .NET members with names differing only by case from crashing the compatibility profiler (#1195) (by @rjmholt) - Fix compatibility profile query API so that aliases referring to other modules appear (#1194) (by @rjmholt) - + - DSC - Instead of using the first cimClass and then having no superClass, use the first cimClass that has a non-null superClass (#1200) (by @bergmeister, thanks to @ykuijs! for the great collaboration) - Make `-SaveDscDependency` work on Linux (#1246) (by @bergmeister) - + - Enable suppression of custom rules when used together with `-IncludeDefaultRules` to allow all possible scenarios from 1.17.1 and 1.18.0. This removes also the check if the rule name in the suppression attribute can be found because this check is technically not possible in all scenarios (#1245) (by @bergmeister) - Fix NullReferenceException for class type (#1182) (by @bergmeister) @@ -492,7 +492,7 @@ Multi-threading efficiency was highly improved leading to a speedup whilst keepi - Add simple GitHub Pull Request template based off the one for PowerShell Core (#866) (by @bergmeister) - Add a simple GitHub issue template based on the one of PowerShell Core. (#865, #884) (by @bergmeister) - Fix Example 7 in Invoke-ScriptAnalyzer.md (#862) (Thanks @sethvs!) -- Use the typewriter apostrophe instead the typographic apostrophe (#855) (Thanks @alexandear!) +- Use the typewriter apostrophe instead the typographic apostrophe (#855) (Thanks @alexandear!) - Add justification to ReadMe (#848) (Thanks @KevinMarquette!) - Fix typo in README (#845) (Thanks @misterGF!) @@ -768,7 +768,8 @@ A big **Thank You!** to the following folks for making PSScriptAnalyzer even bet ### Fixes: #### Engine: - Engine update to prevent script based injection attacks -- CustomizedRulePath is now called CustomRulePath – Fixes to handle folder paths +- CustomizedRulePath is now called CustomRulePath +- Fixes to handle folder paths - Fixes for RecurseCustomRulePath functionality - Fix to binplace cmdlet help file as part of build process - ScriptAnalyzer Profile is now called Settings @@ -786,7 +787,8 @@ A big **Thank You!** to the following folks for making PSScriptAnalyzer even bet - Update to Credential based rules to validate the presence of CredentialAttribute and PSCredential type ### Documentation: -- Rule & Cmdlet documentation updates – Cmdlet help file addition +- Rule & Cmdlet documentation updates +- Cmdlet help file addition ## [1.1.1](https://github.com/PowerShell/PSScriptAnalyzer/tree/1.1.1) - 2015-11-03 ### Features: @@ -827,7 +829,7 @@ A big **Thank You!** to the following folks for making PSScriptAnalyzer even bet ### Rules: - New rule to validate the presence of deprecated module manifest fields. -- Removed PSAvoidTrapStatement rule from the builtin set – since this is not deprecated and using trap is a better choice in certain scenarios. +- Removed PSAvoidTrapStatement rule from the builtin set since this is not deprecated and using trap is a better choice in certain scenarios. ### Fixes: - Verbose Message rule applies to only DSC cmdlet based resources. diff --git a/PSCompatibilityCollector/Microsoft.PowerShell.CrossCompatibility/Data/Platform/OperatingSystemData.cs b/PSCompatibilityCollector/Microsoft.PowerShell.CrossCompatibility/Data/Platform/OperatingSystemData.cs index 89fe9445a..cb0455a78 100644 --- a/PSCompatibilityCollector/Microsoft.PowerShell.CrossCompatibility/Data/Platform/OperatingSystemData.cs +++ b/PSCompatibilityCollector/Microsoft.PowerShell.CrossCompatibility/Data/Platform/OperatingSystemData.cs @@ -69,7 +69,7 @@ public class OperatingSystemData : ICloneable /// /// The Windows SKU identifier, corresponding to /// the GetProductInfo() sysinfo API: - /// https://docs.microsoft.com/en-us/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getproductinfo + /// https://learn.microsoft.com/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getproductinfo /// [DataMember(EmitDefaultValue = false)] public uint? SkuId { get; set; } diff --git a/README.md b/README.md index bd351ffc9..8c4063050 100644 --- a/README.md +++ b/README.md @@ -40,33 +40,33 @@ PowerShell code such as: ## DOCUMENTATION NOTICE Conceptual user documentation has been moved out of the source code repository and into the -documentation repository so that it can be published on docs.microsoft.com. +documentation repository so that it can be published on learn.microsoft.com. -The goal of this migration is to have the user documentation on docs.microsoft.com. The source code +The goal of this migration is to have the user documentation on learn.microsoft.com. The source code repository should only contain documentation for the code base, such as how to build the code or how to contribute to the code. User documentation that has been migrated: - Most of the contents of this README can be found in the - [PSScriptAnalyzer overview](https://docs.microsoft.com/powershell/utility-modules/psscriptanalyzer/overview) + [PSScriptAnalyzer overview](https://learn.microsoft.com/powershell/utility-modules/psscriptanalyzer/overview) - For cmdlet reference, see - [PSScriptAnalyzer](https://docs.microsoft.com/powershell/module/psscriptanalyzer) + [PSScriptAnalyzer](https://learn.microsoft.com/powershell/module/psscriptanalyzer) - For rules, see - [Rules overview](https://docs.microsoft.com/powershell/utility-modules/psscriptanalyzer/rules/readme) + [Rules overview](https://learn.microsoft.com/powershell/utility-modules/psscriptanalyzer/rules/readme) - The `PowerShellBestPractices.md` content has been moved to - [PSScriptAnalyzer rules and recommendations](https://docs.microsoft.com/powershell/utility-modules/psscriptanalyzer/rules-recommendations) + [PSScriptAnalyzer rules and recommendations](https://learn.microsoft.com/powershell/utility-modules/psscriptanalyzer/rules-recommendations) - The `ScriptRuleDocumentation.md` content has been moved to - [Creating custom rules](https://docs.microsoft.com/powershell/utility-modules/psscriptanalyzer/create-custom-rule) + [Creating custom rules](https://learn.microsoft.com/powershell/utility-modules/psscriptanalyzer/create-custom-rule) There is one exception - the documentation for the rules and cmdlets will remain in the [docs](docs) folder to facilitate build testing and to be archived as part of each release. Only the -documentation for the latest release is published on on docs.microsoft.com. +documentation for the latest release is published on on learn.microsoft.com. ## Installation To install **PSScriptAnalyzer** from the PowerShell Gallery, see -[Installing PSScriptAnalyzer](https://docs.microsoft.com/powershell/utility-modules/psscriptanalyzer/overview#installing-psscriptanalyzer). +[Installing PSScriptAnalyzer](https://learn.microsoft.com/powershell/utility-modules/psscriptanalyzer/overview#installing-psscriptanalyzer). To install **PSScriptAnalyzer** from source code: @@ -190,7 +190,7 @@ Get-TestFailures ## Using PSScriptAnalyzer The documentation in this section can be found in -[Using PSScriptAnalyzer](https://docs.microsoft.com/powershell/utility-modules/psscriptanalyzer/using-scriptanalyzer). +[Using PSScriptAnalyzer](https://learn.microsoft.com/powershell/utility-modules/psscriptanalyzer/using-scriptanalyzer). ## Contributions are welcome diff --git a/build.psm1 b/build.psm1 index d6274ec5f..9f27d99a8 100644 --- a/build.psm1 +++ b/build.psm1 @@ -546,7 +546,7 @@ function ConvertTo-PortableVersion { } } -# see https://docs.microsoft.com/en-us/dotnet/core/tools/global-json for rules +# see https://learn.microsoft.com/dotnet/core/tools/global-json for rules # on how version checks are done function Test-SuitableDotnet { param ( diff --git a/docs/Cmdlets/Get-ScriptAnalyzerRule.md b/docs/Cmdlets/Get-ScriptAnalyzerRule.md index 2efa05288..64bd7307f 100644 --- a/docs/Cmdlets/Get-ScriptAnalyzerRule.md +++ b/docs/Cmdlets/Get-ScriptAnalyzerRule.md @@ -3,7 +3,7 @@ external help file: Microsoft.Windows.PowerShell.ScriptAnalyzer.dll-Help.xml Module Name: PSScriptAnalyzer ms.custom: PSSA v1.21.0 ms.date: 10/07/2021 -online version: https://docs.microsoft.com/powershell/module/psscriptanalyzer/get-scriptanalyzerrule?view=ps-modules&wt.mc_id=ps-gethelp +online version: https://learn.microsoft.com/powershell/module/psscriptanalyzer/get-scriptanalyzerrule?view=ps-modules&wt.mc_id=ps-gethelp schema: 2.0.0 --- diff --git a/docs/Cmdlets/Invoke-Formatter.md b/docs/Cmdlets/Invoke-Formatter.md index 6e4b3a642..91dc68add 100644 --- a/docs/Cmdlets/Invoke-Formatter.md +++ b/docs/Cmdlets/Invoke-Formatter.md @@ -3,7 +3,7 @@ external help file: Microsoft.Windows.PowerShell.ScriptAnalyzer.dll-Help.xml Module Name: PSScriptAnalyzer ms.custom: PSSA v1.21.0 ms.date: 10/07/2021 -online version: https://docs.microsoft.com/powershell/module/psscriptanalyzer/invoke-formatter?view=ps-modules&wt.mc_id=ps-gethelp +online version: https://learn.microsoft.com/powershell/module/psscriptanalyzer/invoke-formatter?view=ps-modules&wt.mc_id=ps-gethelp schema: 2.0.0 --- diff --git a/docs/Cmdlets/Invoke-ScriptAnalyzer.md b/docs/Cmdlets/Invoke-ScriptAnalyzer.md index 32d8b1c45..4605d1d89 100644 --- a/docs/Cmdlets/Invoke-ScriptAnalyzer.md +++ b/docs/Cmdlets/Invoke-ScriptAnalyzer.md @@ -3,7 +3,7 @@ external help file: Microsoft.Windows.PowerShell.ScriptAnalyzer.dll-Help.xml Module Name: PSScriptAnalyzer ms.custom: PSSA v1.21.0 ms.date: 10/07/2021 -online version: https://docs.microsoft.com/powershell/module/psscriptanalyzer/invoke-scriptanalyzer?view=ps-modules&wt.mc_id=ps-gethelp +online version: https://learn.microsoft.com/powershell/module/psscriptanalyzer/invoke-scriptanalyzer?view=ps-modules&wt.mc_id=ps-gethelp schema: 2.0.0 --- @@ -514,7 +514,7 @@ following keys: The keys and values in the profile are interpreted as if they were standard parameters and values of `Invoke-ScriptAnalyzer`, similar to splatting. For more information, see -[about_Splatting](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_splatting). +[about_Splatting](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_splatting). ```yaml Type: Object diff --git a/docs/Rules/ProvideCommentHelp.md b/docs/Rules/ProvideCommentHelp.md index 885c035ea..b9305da14 100644 --- a/docs/Rules/ProvideCommentHelp.md +++ b/docs/Rules/ProvideCommentHelp.md @@ -17,9 +17,9 @@ presence of comment based help and not on the validity or format. For assistance on comment based help, use the command `Get-Help about_comment_based_help` or the following articles: -- [Writing Comment-based Help](https://docs.microsoft.com/powershell/scripting/developer/help/writing-comment-based-help-topics) -- [Writing Help for PowerShell Cmdlets](https://docs.microsoft.com/powershell/scripting/developer/help/writing-help-for-windows-powershell-cmdlets) -- [Create XML-based help using PlatyPS](https://docs.microsoft.com/powershell/scripting/dev-cross-plat/create-help-using-platyps) +- [Writing Comment-based Help](https://learn.microsoft.com/powershell/scripting/developer/help/writing-comment-based-help-topics) +- [Writing Help for PowerShell Cmdlets](https://learn.microsoft.com/powershell/scripting/developer/help/writing-help-for-windows-powershell-cmdlets) +- [Create XML-based help using PlatyPS](https://learn.microsoft.com/powershell/utility-modules/platyps/create-help-using-platyps) ## Configuration diff --git a/docs/Rules/ShouldProcess.md b/docs/Rules/ShouldProcess.md index ed954932f..2e50e2764 100644 --- a/docs/Rules/ShouldProcess.md +++ b/docs/Rules/ShouldProcess.md @@ -18,9 +18,9 @@ but makes no calls to `ShouldProcess` or it calls `ShouldProcess` but does not d For more information, see the following articles: -- [about_Functions_Advanced_Methods](/powershell/module/microsoft.powershell.core/about/about_functions_advanced_methods) -- [about_Functions_CmdletBindingAttribute](/powershell/module/microsoft.powershell.core/about/about_Functions_CmdletBindingAttribute) -- [Everything you wanted to know about ShouldProcess](/powershell/scripting/learn/deep-dives/everything-about-shouldprocess) +- [about_Functions_Advanced_Methods](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_functions_advanced_methods) +- [about_Functions_CmdletBindingAttribute](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_Functions_CmdletBindingAttribute) +- [Everything you wanted to know about ShouldProcess](https://learn.microsoft.com/powershell/scripting/learn/deep-dives/everything-about-shouldprocess) ## How @@ -66,5 +66,10 @@ function Set-File { $Content | Out-File -FilePath $Path } + else + { + # Code that should be processed if doing a WhatIf operation + # Must NOT change anything outside of the function / script + } } ``` diff --git a/docs/Rules/UseApprovedVerbs.md b/docs/Rules/UseApprovedVerbs.md index 7343b711f..ee7721444 100644 --- a/docs/Rules/UseApprovedVerbs.md +++ b/docs/Rules/UseApprovedVerbs.md @@ -16,7 +16,7 @@ All cmdlets must used approved verbs. Approved verbs can be found by running the command `Get-Verb`. Additional documentation on approved verbs can be found in the microsoft docs page -[Approved Verbs for PowerShell Commands](https://docs.microsoft.com/powershell/scripting/developer/cmdlet/approved-verbs-for-windows-powershell-commands). +[Approved Verbs for PowerShell Commands](https://learn.microsoft.com/powershell/scripting/developer/cmdlet/approved-verbs-for-windows-powershell-commands). Some unapproved verbs are documented on the approved verbs page and point to approved alternatives. Try searching for the verb you used to find its approved form. For example, searching for `Read`, `Open`, or `Search` leads you to `Get`.