Invoke-Script
Executes a script from Sitecore PowerShell Extensions Script Library. This command used to be named Execute-Script - a matching alias added for compatibility with older scripts.
Syntax
Invoke-Script [-Item] <Item> [-ArgumentList <Object[]>]
Invoke-Script [-Path] <String> [-ArgumentList <Object[]>]
Detailed Description
Executes a script from Sitecore PowerShell Extensions Script Library.
© 2010-2019 Adam Najmanowicz, Michael West. All rights reserved. Sitecore PowerShell Extensions
Aliases
The following abbreviations are aliases for this cmdlet:
Execute-Script
Parameters
-Item <Item>
The script item to be executed.
-Path <String>
Path to the script item to be executed. Path can be absolute or Relavie to Script library root. e.g. the following two commands are equivalent:
PS master:> Invoke-Script 'master:\system\Modules\PowerShell\Script Library\Examples\Script Testing\Long Running Script with Progress Demo' PS master:> Invoke-Script 'Examples\Script Testing\Long Running Script with Progress Demo'
-ArgumentList <Object[]>
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Sitecore.Data.Items.Item
Outputs
The output type is the type of the objects that the cmdlet emits.
System.Object
Notes
Help Author: Adam Najmanowicz, Michael West
Examples
EXAMPLE 1
EXAMPLE 2
Run a script with arguments passed in.
The arguments are passed and used in the called script like below:
Related Topics
Last updated