| external help file | PSPublishModule-help.xml |
|---|---|
| Module Name | PSPublishModule |
| online version | https://github.com/EvotecIT/PSPublishModule |
| schema | 2.0.0 |
Analyzes PowerShell files and folders to determine compatibility with Windows PowerShell 5.1 and PowerShell 7+.
Get-PowerShellCompatibility -Path <string> [-Recurse] [-ExcludeDirectories <string[]>] [-ShowDetails] [-ExportPath <string>] [-Internal] [<CommonParameters>]Scans PowerShell files to detect patterns and constructs that can cause cross-version issues (Windows PowerShell 5.1 vs PowerShell 7+), and outputs a compatibility report.
Use this as part of CI to keep modules compatible across editions, and pair it with encoding/line-ending checks when supporting Windows PowerShell 5.1.
PS> Get-PowerShellCompatibility -Path 'C:\MyModule'Analyzes PowerShell files in the folder and returns a compatibility report.
PS> Get-PowerShellCompatibility -Path 'C:\MyModule' -Recurse -ShowDetailsUseful when investigating why a module behaves differently in PS 5.1 vs PS 7+.
PS> Get-PowerShellCompatibility -Path 'C:\MyModule' -ExportPath 'C:\Reports\compatibility.csv'Creates a report that can be attached to CI artifacts.
Directory names to exclude from analysis.
Type: String[]
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueExport the detailed report to a CSV file at the specified path.
Type: String
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueInternal mode used by build pipelines to suppress host output.
Type: SwitchParameter
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TruePath to the file or directory to analyze for PowerShell compatibility.
Type: String
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:
Required: True
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueWhen analyzing a directory, recursively analyze all subdirectories.
Type: SwitchParameter
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueInclude detailed analysis of each file with specific compatibility issues found.
Type: SwitchParameter
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
None
System.Object
- None