ConvertTo-Expression

3.3.9

The ConvertTo-Expression cmdlet converts (serializes) an object to a
PowerShell expression. The object can be stored in a variable,  file or
any other common storage for later use or to be ported to another
system.

An expression can be restored to an object using the native
Invoke-Expression cmdlet:

   $Object = Invoke-Expression ($Object | ConverTo-Expression)

Or
The ConvertTo-Expression cmdlet converts (serializes) an object to a
PowerShell expression. The object can be stored in a variable,  file or
any other common storage for later use or to be ported to another
system.

An expression can be restored to an object using the native
Invoke-Expression cmdlet:

   $Object = Invoke-Expression ($Object | ConverTo-Expression)

Or Converting it to a [ScriptBlock] and invoking it with cmdlets
along with Invoke-Command or using the call operator (&):

   $Object = &([ScriptBlock]::Create($Object | ConverTo-Expression))

An expression that is stored in a PowerShell (.ps1) file might also
be directly invoked by the PowerShell dot-sourcing technique,  e.g.:

   $Object | ConvertTo-Expression | Out-File .\Expression.ps1
   $Object = . .\Expression.ps1

Warning: Invoking partly trusted input with Invoke-Expression or
[ScriptBlock]::Create() methods could be abused by malicious code
injections.

Show more
The owner has unlisted this package. This could mean that the script is deprecated or shouldn't be used anymore.

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Script -Name ConvertTo-Expression -RequiredVersion 3.3.9

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Package Details

Author(s)

  • Ronald Bode (iRon)

Tags

PSON PowerShell Object Notation Expression Serialize Stringify

Functions

Serialize Quote QuoteKey Here Stringify GetTypeName Prefix Iterate

Dependencies

This script has no dependencies.

FileList

Version History

Version Downloads Last updated
3.3.0 462 5/11/2020
3.2.19 113 10/19/2019
3.2.16 36 10/18/2019
3.2.12 62 8/29/2019
3.2.10 57 7/20/2019
3.2.9 40 6/26/2019
3.1.1 196 1/7/2019
3.1.0 41 1/5/2019
3.0.4 62 12/14/2018
3.0.2 35 12/13/2018
3.0.1 39 12/1/2018
2.7.0 50 8/30/2018
2.6.0 38 8/28/2018
2.4.6 49 8/2/2018
2.4.2 46 6/21/2018
2.4.1 38 6/21/2018
2.3.0 73 1/27/2018
Show more