Custom scripts
- Last Updated: May 8, 2026
- 1 minute read
- Automate MFT
- Documentation
The following custom cmdlets and regular PowerShell
cmdlets are allowed with Automate MFT.
For practical examples of using custom cmdlets, see
Custom script samples.
Custom cmdlets
Customcmdlets are provided to manage cached files
and session variables.
|
Custom |
Purpose |
|---|---|
|
|
Adds a new item to the local cache. Throws an exception if an item with
the same Arguments:
|
|
|
Gets the contents of a cached file and returns it as a string. |
|
|
Retrieves all items stored in the local MFT
cache, returned as an array of The
MftItem
has following properties:
|
|
|
Gets the value of a task parameter. Arguments:
|
|
|
Gets the value of a named session variable. |
|
|
Removes the specified file from the local MFT cache. |
|
|
Renames a local cached file. Arguments:
|
|
|
Sets the content of the specified cached file with the provided string value. |
|
|
Gets the value of a task parameter. Arguments:
|
|
|
Sets the value of a named session variable. |
PowerShell cmdlets
A subset of standard PowerShell cmdlets is enabled
for general scripting.
|
PowerShell Cmdlet |
Purpose |
|---|---|
|
|
Adds properties or methods to an object. |
|
|
Deletes the contents of an item. |
|
|
Deletes the contents of an item. |
|
|
Compares two sets of objects. |
|
|
Converts a CliXml-formatted string to an object. |
|
|
Converts CLIXML back into PowerShell objects. |
|
|
Converts CSV text into objects. |
|
|
Converts JSON text into PowerShell objects. |
|
|
Converts Markdown into PowerShell objects. |
|
|
Converts a secure string into encrypted text. |
|
|
Converts strings in key=value format into a hash table. |
|
|
Converts an object to a CliXml-formatted string. |
|
|
Converts objects to CLIXML (XML-based) format. |
|
|
Converts objects to CSV-formatted text. |
|
|
Converts objects into HTML format. |
|
|
Converts objects into JSON format. |
|
|
Converts a string into a secure, encrypted string. |
|
|
Converts objects into XML. |
|
|
Performs an operation on each pipeline item. |
|
|
Displays objects using a custom view. |
|
|
Displays binary data in hex format. |
|
|
Formats output as a list. |
|
|
Formats output as a table. |
|
|
Displays one property per line across the screen. |
|
|
Reads the contents of a file. |
|
|
Gets the current date and time. |
|
|
Computes the hash of a file. |
|
|
Lists object properties and methods. |
|
|
Selects a random item or random number. |
|
|
Generates cryptographically secure random data. |
|
|
Gets the system’s current time zone information. |
|
|
Returns unique items from a sorted list. |
|
|
Shows how long the system has been running. |
|
|
Retrieves PowerShell variables. |
|
|
Groups objects by a specified property. |
|
|
Imports a CLIXML file and creates corresponding objects. |
|
|
Combines a path and a child path into a single path. |
|
|
Joins strings using a separator. |
|
|
Calculates statistics like count, sum, average. |
|
|
Moves an item from one location to another. |
|
|
Generates a new GUID value. |
|
|
Creates a new item. |
|
|
Creates a new generic list object. |
|
|
Creates an instance of a .NET object. |
|
|
Creates a new custom PowerShell object. |
|
|
Creates a temporary file on disk. |
|
|
Creates a time interval object. |
|
|
Sends output directly to the console host. |
|
|
Sends output to a string instead of the console. |
|
|
Renames an item. |
|
|
Selects specific properties or top/bottom items. |
|
|
Searches text using patterns or regex. |
|
|
Searches XML using XPath. |
|
|
Writes or replaces content in a file. |
|
|
Changes the value of an item to the value specified in the command. |
|
|
Creates or changes a variable. |
|
|
Sorts objects by a specified property. |
|
|
Returns the specified part of a path. |
|
|
Pauses execution for a specified time. |
|
|
Updates items in a list. |
|
|
Filters objects based on a condition. |
|
|
Writes text directly to the console. |