Contact Info

Crumbtrail » Administration » Powershell » Powershell 1.0 » Export-Alias

Export-Alias - Powershell 1.0 CmdLet

Microsoft Windows PowerShell is a command-line shell and scripting tool based on the Microsoft .NET Framework. It is designed for system administrators, engineers and developers to control and automate the administration of Windows and applications.

More than hundred command-line tools (so called "cmdlets") can be used to perform system administration tasks and Windows Management Instrumentation (WMI). These cmdlets are easy to use, with standard naming conventions and common parameters, and standard tools for piping, sorting, filtering, and formatting data and objects.


Export an alias list to a file


-path string
       The path to the file where the alias information will be stored.

   -name string
       The name(s) of the aliases to export.
       Separate multiple names with commas, (default=all aliases)
        Pass the object created by this cmdlet along the pipeline.
   -as ExportAliasFormat
        Format output as comma-separated (CSV) or (Script).

        Append output to the specified file, rather than overwrite.
    -description string
        Enables you to add a description to the exported file. The description 
        appears at the top of the file, following the header information. It is
         preceded by a # symbol.
    -scope string
        Either a named scope: "global", "local", or "script"; or a number
        to indicate the scope level. Scope = 0 = current scope
        Increasing the scope value by 1 will increate the scope to include the
        parent scope of the current scope. 
        Do not overwrite an existing file, -Append will take precendence over -NoClobber.
       Override the read-only attribute on the output file.
       Describe what would happen if you executed the command without actually
       executing the command.
       Prompt for confirmation before executing the command.
        -Verbose, -Debug,-ErrorAction,-ErrorVariable, -OutVariable.

Export alias information to alias.txt formatted as a series of set-alias commands:

PS C: >export-alias -path alias.txt -as script