1
1
---
2
2
description : Avoid overwriting built in cmdlets
3
- ms.date : 06/28/2023
3
+ ms.date : 12/12/2024
4
4
ms.topic : reference
5
5
title : AvoidOverwritingBuiltInCmdlets
6
6
---
@@ -14,7 +14,7 @@ This rule flags cmdlets that are available in a given edition/version of PowerSh
14
14
operating system which are overwritten by a function declaration. It works by comparing function
15
15
declarations against a set of allowlists that ship with PSScriptAnalyzer. These allowlist files are
16
16
used by other PSScriptAnalyzer rules. More information can be found in the documentation for the
17
- [ UseCompatibleCmdlets] ( ./UseCompatibleCmdlets.md ) rule.
17
+ [ UseCompatibleCmdlets] [ 01 ] rule.
18
18
19
19
## Configuration
20
20
@@ -37,14 +37,17 @@ following your settings file.
37
37
38
38
The parameter ` PowerShellVersion ` is a list of allowlists that ship with PSScriptAnalyzer.
39
39
40
- ** Note** : The default value for ` PowerShellVersion ` is ` core-6.1.0-windows ` if PowerShell 6 or
41
- later is installed, and ` desktop-5.1.14393.206-windows ` if it is not.
40
+ > [ !NOTE]
41
+ > The default value for ` PowerShellVersion ` is ` core-6.1.0-windows ` if PowerShell 6 or
42
+ > later is installed, and ` desktop-5.1.14393.206-windows ` if it's not.
42
43
43
44
Usually, patched versions of PowerShell have the same cmdlet data, therefore only settings of major
44
45
and minor versions of PowerShell are supplied. One can also create a custom settings file as well
45
- with the
46
- [ New-CommandDataFile.ps1] ( https://github.com/PowerShell/PSScriptAnalyzer/blob/development/Utils/New-CommandDataFile.ps1 )
47
- script and use it by placing the created ` JSON ` into the ` Settings ` folder of the ` PSScriptAnalyzer `
48
- module installation folder, then the ` PowerShellVersion ` parameter is just its file name (that can
49
- also be changed if desired). Note that the ` core-6.0.2-* ` files were removed in PSScriptAnalyzer
50
- 1.18 since PowerShell 6.0 reached end of life.
46
+ with the [ New-CommandDataFile.ps1] [ 02 ] script and use it by placing the created ` JSON ` into the
47
+ ` Settings ` folder of the ` PSScriptAnalyzer ` module installation folder, then the ` PowerShellVersion `
48
+ parameter is just its filename (that can also be changed if desired). Note that the ` core-6.0.2-* `
49
+ files were removed in PSScriptAnalyzer 1.18 since PowerShell 6.0 reached end of life.
50
+
51
+ <!-- link references -->
52
+ [ 01 ] : ./UseCompatibleCmdlets.md
53
+ [ 02 ] : https://github.com/PowerShell/PSScriptAnalyzer/blob/main/Utils/New-CommandDataFile.ps1
0 commit comments