Set-PSAnsiFileMap
SYNOPSIS
Modify or add a PSAnsiFileEntry
SYNTAX
Set-PSAnsiFileMap [-Description] <String> [-Pattern <String>] [-Ansi <String>] [-Passthru] [-WhatIf] [-Confirm]
[<CommonParameters>]
DESCRIPTION
Use this command to modify an existing entry in the global $PSAnsiFileMap variable or add a new entry. If modifying, you must specify a regular expression pattern or an ANSI escape sequence. If you are adding a new entry, you need to supply both values.
EXAMPLES
Example 1
PS C:\> Set-PSAnsiFileMap Temporary -Ansi "`e[38;5;190m"
Update the ANSI pattern for temporary files. This change will not persist unless you export the map.
Example 2
PS C:\> Set-PSAnsiFileMap -Description "Config" -Pattern "\.(yml)$" -Ansi "`e[38;5;25m"ge
Add a new PSAnsiFileMap entry. This change will not persist unless you export the map.
PARAMETERS
-Ansi
Specify an ANSI escape sequence. You only need to define the opening sequence.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-Description
Specify the file map entry. If it is a new entry it will be added.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Passthru
Display the updated map.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-Pattern
Specify a regular expression pattern for the file name.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
None
OUTPUTS
PSAnsiFileEntry
NOTES
Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/