Skip to content

Export-PSAnsiFileMap

SYNOPSIS

Export a PSAnsiFileMap to a file.

SYNTAX

Export-PSAnsiFileMap [-Passthru] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

The PSScriptTools module includes a JSON file that is automatically imported as the global PSAnsiFileMap variable. This variable is used for the custom ANSI formatted table view, among other module commands. If you wish to customize the file map, you can use the Set-PSAnsiFileMap command. These changes are not permanent and will be overwritten the next time you import the PSScriptTools module. To use your customized settings, you need to export your modified $PSAnsiFileMap object with this command.

The command will export the settings to a JSON file called psansifilemap.json in the root of $HOME. The next time you import the PSScriptTools module, it will use this file if found. To revert to the default file map either rename or delete the file in $HOME.

EXAMPLES

Example 1

PS C:\>Export-PSAnsiFileMap -Passthru

    Directory: C:\Users\Jeff

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---          12/28/2020  1:02 PM           1631 psansifilemap.json

PARAMETERS

-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

-Passthru

@{Text=}

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
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

None

System.IO.FileInfo

NOTES

Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/

Get-PSAnsiFileMap

Set-PSAnsiFileMap

Back to top