-
Notifications
You must be signed in to change notification settings - Fork 0
Repair ScriptStyle
external help file: Codesmithy-help.xml Module Name: Codesmithy online version: https://docs.microsoft.com/powershell/module/psscriptanalyzer/invoke-scriptanalyzer schema: 2.0.0
Accepts justifications for script analysis rule violations, fixing the rest using Invoke-ScriptAnalysis.
Repair-ScriptStyle [-Path] <String> [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm]
[<CommonParameters>]
{{ Fill in the Description }}
Repair-ScriptStyle .\MyScript.ps1
PSAvoidUsingWriteHost in A:\Scripts\MyScript.ps1 (!) Warning Lines: 19, 24, 25, 26, 27, 31, 32 File 'MyScript.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information.
Confirm Are you sure you want to perform this action? Performing the operation "provide justification" on target "PSAvoidUsingWriteHost in A:\Scripts\MyScript.ps1". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):
The path to a PowerShell script file to repair the style of.
Type: String
Parameter Sets: (All)
Aliases: FullName
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: FalseShows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalsePrompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
https://docs.microsoft.com/powershell/module/psscriptanalyzer/invoke-scriptanalyzer