Sitecore Installation Framework functions

version: 2.0.0

Cannot find a proper task? Check Sitecore Install Extensions
TypeNameSynopsis
Task Install-SitecoreConfiguration Invokes a Sitecore installation Starts an installation based on a JSON configuration file.
PS C:\> Install-SitecoreConfiguration -Path .\MyConfig.json

Starts an installation based on a JSON configuration file and executes only the named tasks.
PS C:\> Install-SitecoreConfiguration -Path .\MyConfig.json -Tasks Alpha,Beta,Epsilon

Starts an installation based on a JSON configuration file and executes all tasks except the named tasks.
PS C:\> Install-SitecoreConfiguration -Path .\MyConfig.json -Skip Alpha,Beta

Starts an installation based on a JSON configuration file and executes from the specified task.
PS C:\> Install-SitecoreConfiguration -Path .\MyConfig.json -From Beta

Starts an installation based on a JSON configuration file and executes from the task named `Alpha` to the task named `Beta`.
PS C:\> Install-SitecoreConfiguration -Path .\MyConfig.json -From Alpha -To Beta

Starts an installation based on a JSON configuration file, overriding the value for the `SiteName` parameter an contained in that file.
PS C:\> Install-SitecoreConfiguration -Path .\MyConfig.json -SiteName 'MySite'

Starts an installation based on a JSON configuration file and skips parameters validation.
PS C:\> Install-SitecoreConfiguration -Path .\MyConfig.json -SkipValidation
Example json configuration

"Task-Name": {
	"Type": "SitecoreConfiguration",
	"Params": {
		"Path": "",
		"Tasks": "",
		"From": "",
		"To": "",
		"Skip": "",
		"WorkingDirectory": "",
		"ExportMergedConfig": "",
		"SkipValidation": "",
		"Uninstall": ""
	}
}
Task Install-SitecoreConfiguration Invokes a Sitecore installation Starts an installation based on a JSON configuration file.
PS C:\> Install-SitecoreConfiguration -Path .\MyConfig.json

Starts an installation based on a JSON configuration file and executes only the named tasks.
PS C:\> Install-SitecoreConfiguration -Path .\MyConfig.json -Tasks Alpha,Beta,Epsilon

Starts an installation based on a JSON configuration file and executes all tasks except the named tasks.
PS C:\> Install-SitecoreConfiguration -Path .\MyConfig.json -Skip Alpha,Beta

Starts an installation based on a JSON configuration file and executes from the specified task.
PS C:\> Install-SitecoreConfiguration -Path .\MyConfig.json -From Beta

Starts an installation based on a JSON configuration file and executes from the task named `Alpha` to the task named `Beta`.
PS C:\> Install-SitecoreConfiguration -Path .\MyConfig.json -From Alpha -To Beta

Starts an installation based on a JSON configuration file, overriding the value for the `SiteName` parameter an contained in that file.
PS C:\> Install-SitecoreConfiguration -Path .\MyConfig.json -SiteName 'MySite'

Starts an installation based on a JSON configuration file and skips parameters validation.
PS C:\> Install-SitecoreConfiguration -Path .\MyConfig.json -SkipValidation
Example json configuration

"Task-Name": {
	"Type": "SitecoreConfiguration",
	"Params": {
		"Path": "",
		"Tasks": "",
		"From": "",
		"To": "",
		"Skip": "",
		"WorkingDirectory": "",
		"ExportMergedConfig": "",
		"SkipValidation": "",
		"Uninstall": ""
	}
}
Export-WebDeployParameters Creates a parameters file for a Web Deploy Package This will output a webdeploy-parameters.json file to the working directory. The file will contain all fields with their default values. You can then add this to a configuration.
PS C:\> Export-WebDeployParameters -Package c:\webdeploy.zip -OutPath .

This will output a webdeploy-parameters.xml file to the working directory. The file will contain only the required parameters. This can be passed directly to web deploy using the `-SetParamFile` argument
PS C:\> Export-WebDeployParameters -Package c:\webdeploy.zip -OutPath . -Format xml -Required
Get-SitecoreInstallExtension Returns information on the extensions registered with the Sitecore Install Framework. Will return all tasks and config functions registered by default.
PS C:\> Get-SitecoreInstallExtension

Will return all tasks registered by default.
PS C:\> Get-SitecoreInstallExtension -Type Task

Will return all task and config functions registered by default or through the given configuration.
PS C:\> Get-SitecoreInstallExtension -Path c:\configs\example.json
Task Install-SitecoreConfiguration Invokes a Sitecore installation Starts an installation based on a JSON configuration file.
PS C:\> Install-SitecoreConfiguration -Path .\MyConfig.json

Starts an installation based on a JSON configuration file and executes only the named tasks.
PS C:\> Install-SitecoreConfiguration -Path .\MyConfig.json -Tasks Alpha,Beta,Epsilon

Starts an installation based on a JSON configuration file and executes all tasks except the named tasks.
PS C:\> Install-SitecoreConfiguration -Path .\MyConfig.json -Skip Alpha,Beta

Starts an installation based on a JSON configuration file and executes from the specified task.
PS C:\> Install-SitecoreConfiguration -Path .\MyConfig.json -From Beta

Starts an installation based on a JSON configuration file and executes from the task named `Alpha` to the task named `Beta`.
PS C:\> Install-SitecoreConfiguration -Path .\MyConfig.json -From Alpha -To Beta

Starts an installation based on a JSON configuration file, overriding the value for the `SiteName` parameter an contained in that file.
PS C:\> Install-SitecoreConfiguration -Path .\MyConfig.json -SiteName 'MySite'

Starts an installation based on a JSON configuration file and skips parameters validation.
PS C:\> Install-SitecoreConfiguration -Path .\MyConfig.json -SkipValidation
Example json configuration

"Task-Name": {
	"Type": "SitecoreConfiguration",
	"Params": {
		"Path": "",
		"Tasks": "",
		"From": "",
		"To": "",
		"Skip": "",
		"WorkingDirectory": "",
		"ExportMergedConfig": "",
		"SkipValidation": "",
		"Uninstall": ""
	}
}
Task (New) Invoke-AddWebFeatureSSLTask Creates and binds a certificate chain to a website. Attempts to locate a certificate chain for `test.com` and if one is not found then a root authority will be created and a subordinate web certificate created. The web certificate will then be assigned to `test.com`
PS C:\> Invoke-AddWebFeatureSSLTask -Hostname test.com
Example json configuration

"Task-Name": {
	"Type": "AddWebFeatureSSL",
	"Params": {
		"SiteName": "",
		"HostName": "",
		"ClientCertLocation": "",
		"OutputDirectory": "",
		"Password": "",
		"Port": "",
		"RootCertLocation": "",
		"RootCertName": "",
		"RootDnsName": ""
	}
}
ConfigFunction Invoke-AndConfigFunction Performs an AND operation on two or more values. Returns true.
PS C:\> Invoke-AndConfigFunction -Values 1,2,3

Returns false.
PS C:\> Invoke-AndConfigFunction -Values '1',' ','2'
Config function Invoke-AndConfigFunction is registered as And
Task Invoke-AppPoolTask Task to support the creation and modification of an IIS Application Pool. This creates a new application pool with the name 'NewPool'.
PS C:\> Invoke-AppPoolTask -Name 'NewPool'

This creates a new application pool with the name 'NewPool' and sets the Recycling.PeriodicRestart.Requests value to 500.
PS C:\> $properties = @{
            Recycling = @{
                PeriodicRestart = @{
                    Requests = 500
                }
            }
        }
PS C:\> Invoke-AppPoolTask -Name 'NewPool' -Properties $properties
Example json configuration

"Task-Name": {
	"Type": "AppPool",
	"Params": {
		"Name": "",
		"Properties": ""
	}
}
ConfigFunction (New) Invoke-CheckInstalledSoftwareConfigFunction Determines if a program has been installed. Determine if a program called `Test Software` is installed.
PS C:\> Invoke-CheckInstalledSoftwareConfigFunction -Name "Test Software"

Determine if a program called `Test Software` is installed and if so return the version.
PS C:\> Invoke-CheckInstalledSoftwareConfigFunction -Name "Test Software" -Version
Config function Invoke-CheckInstalledSoftwareConfigFunction is registered as CheckInstalledSoftware
Task Invoke-CommandTask Task to support the execution of an arbitrary command. Assuming nuget is available on the current PATH, this invokes nuget.exe and displays a list of the sources available in a condensed format.
PS C:\> Invoke-CommandTask -Path nuget -Arguments sources,-format,short

This invokes nuget from a specific location and displays a list of the sources available in a condensed format.
PS C:\> Invoke-CommandTask -Path c:\utilities\nuget.exe -Arguments sources,-format,short
Example json configuration

"Task-Name": {
	"Type": "Command",
	"Params": {
		"Path": "",
		"Arguments": "",
		"TaskName": ""
	}
}
ConfigFunction Invoke-ConcatConfigFunction Concatenate values within a configuration This example takes a collection of values and concatenates them together.
PS C:\> Invoke-ConcateConfigFunction 1,2,3,4
PS C:\> 1234
Config function Invoke-ConcatConfigFunction is registered as Concat
Task Invoke-CopyTask Task to support copying files or folders to a new location. This copies all files and folders from c:\source to c:\dest.
PS C:\> Invoke-CopyTask -Source c:\source -Destination c:\dest

This copies the source file to the destination folder, retaining the file name. NOTE: The trailing slash is required on the destination to identify the path as a directory.
PS C:\> Invoke-CopyTask -Source c:\source\file.txt -Destination c:\dest\

This copies the source file to a new destination and renames the file to `other.txt`.
PS C:\> Invoke-CopyTask -Source c:\source\file.txt -Destination c:\dest\other.txt
Example json configuration

"Task-Name": {
	"Type": "Copy",
	"Params": {
		"Source": "",
		"Destination": ""
	}
}
Task Invoke-CreateServiceTask Creates a Windows service This registers a service called 'Example' with the executable path 'c:\my\service.exe -list 5'. The service can be started automatically.
PS C:\> Invoke-CreateServiceTask -Name Example -Path c:\my\service.exe -Arguments '-list',5 -Startup Automatic
Example json configuration

"Task-Name": {
	"Type": "CreateService",
	"Params": {
		"Name": "",
		"Path": "",
		"Arguments": "",
		"StartupType": "",
		"Description": "",
		"DisplayName": ""
	}
}
Task Invoke-DownloadFileTask Task to support the downloading of files from the Internet.
PS C:\> Invoke-DownloadFileTask -SourceUrl http://www.somedomain.com/SomeFile.txt -DestinationPath C:\Temp\SomeFile.txt

PS (Invoke-RestMethod -Uri 'https://dev.sitecore.net/api/authorization' -Method Post -ContentType "application/json"  -Body "{username:'yourUserName', password:'yourPassword'}" -SessionVariable session)
PS C:\> Invoke-DownloadFileTask -SourceUrl http://www.somedomain.com/SomeFile.txt -DestinationPath C:\Temp\SomeFile.txt -LoginSession $session

This downloads the file 'SomeFile.txt' from 'www.somedomain.com' and saves it to 'C:\Temp\SomeFile.txt'
PS $userPr = "userName"
PS $secpasswd = ConvertTo-SecureString "userPwd" -AsPlainText -Force
PS $credential = New-Object System.Management.Automation.PSCredential($userPr, $secpasswd)
PS C:\> Invoke-DownloadFileTask -SourceUrl http://www.somedomain.com/SomeFile.txt -DestinationPath C:\Temp\SomeFile.txt -Credentials $credential
Example json configuration

"Task-Name": {
	"Type": "DownloadFile",
	"Params": {
		"SourceUri": "",
		"DestinationPath": "",
		"LoginSession": "",
		"Credentials": ""
	}
}
Task Invoke-EnsurePathTask Creates paths or cleans existing paths. This clears all content from the c:\deploy folder. If the folder does not already exist, it will be created.
PS C:\> Invoke-EnsurePathTask -Clean c:\deploy

This checks if the path c:\destination exists. If it does not exist, it will be created. If it does exist, no changes will occur.
PS C:\> Invoke-EnsurePathTask -Exists c:\destination

This cleans and creates multiple paths at the same time.
PS C:\> Invoke-EnsurePathTask -Clean c:\logs,c:\deploy -Exists c:\destination,c:\backup
Example json configuration

"Task-Name": {
	"Type": "EnsurePath",
	"Params": {
		"Clean": "",
		"Exists": ""
	}
}
ConfigFunction Invoke-EnvironmentConfigFunction Supports referencing of environment variables in configurations This example resolves the environment system drive.
PS C:\> Invoke-EnvironmentConfigFunction SystemDrive
PS C:\> C:\
Config function Invoke-EnvironmentConfigFunction is registered as Environment
ConfigFunction Invoke-EqualConfigFunction Returns true or false based on the equality of two values. returns false.
PS C:\> Invoke-EqualConfigFunction -LeftOperand 1 -RightOperand 2

returns true.
PS C:\> Invoke-EqualConfigFunction -LeftOperand '' -RightOperand '    '
Config function Invoke-EqualConfigFunction is registered as Equal
Task Invoke-FilePermissionsTask Sets file permissions for a path Gives the current user Read and Write permissions to the path c:\examplepath.
PS C:\> $right = @{User = $env:username; FileSystemRights = 'Read','Write'}
PS C:\> Invoke-FilePermissionsTask -Path c:\examplepath -Rights $right

Gives the current user Read and Write permissions to the path c:\examplepath and all its children.
PS C:\> $right = @{User = $env:username; FileSystemRights = 'Read','Write'; InheritanceFlags = 'ContainerInherit','ObjectInherit'}
PS C:\> Invoke-FilePermissionsTask -Path c:\examplepath -Rights $right
Example json configuration

"Task-Name": {
	"Type": "FilePermissions",
	"Params": {
		"Path": "",
		"Rights": ""
	}
}
ConfigFunction Invoke-GetCertificateConfigFunction Returns the certificate for the given name or thumbprint under a certificate path. Searches the default certificate path `cert:\LocalMachine\My` for the certificate with the name `MyCert`.
PS C:\> Invoke-GetCertificateConfigFunction -Id 'MyCert'

Searches the default certificate path `cert:\LocalMachine\My` for the certificate with the thumbprint `80AE58424A64BAAF7E82764BB9BE79EE27B46A96`.
PS C:\> Invoke-GetCertificateConfigFunction -Id '80AE58424A64BAAF7E82764BB9BE79EE27B46A96'

Searches the certificate path `cert:\LocalMachine\Root` for the certificate with the name `MyRootCert`.
PS C:\> Invoke-GetCertificateConfigFunction -Id 'MyRootCert' -CertStorePath 'cert:\LocaMachine\Root`
Config function Invoke-GetCertificateConfigFunction is registered as GetCertificate
ConfigFunction Invoke-GetCertificateThumbprintConfigFunction Returns the thumbprint for the requested certificate. Searches the default certificate path `cert:\LocalMachine\My` for the certificate with the name `MyCert` and returns the thumbprint.
PS C:\> Invoke-GetCertificateConfigFunction -Id 'MyCert'

Searches the default certificate path `cert:\LocalMachine\My` for the certificate with the thumbprint `80AE58424A64BAAF7E82764BB9BE79EE27B46A96` and returns the thumbprint.
PS C:\> Invoke-GetCertificateConfigFunction -Id '80AE58424A64BAAF7E82764BB9BE79EE27B46A96'

Searches the certificate path `cert:\LocalMachine\Root` for the certificate with the name `MyRootCert` and returns the thumbprint.
PS C:\> Invoke-GetCertificateConfigFunction -Id 'MyRootCert' -CertStorePath 'cert:\LocaMachine\Root`
Config function Invoke-GetCertificateThumbprintConfigFunction is registered as GetCertificateThumbprint
Task Invoke-HostHeaderTask Performs the action over the entry in the system hosts file. This will add a new host entry of '127.0.0.1 customhost' to the hosts file.
PS C:\> Invoke-HostHeaderTask -Hostname customhost

This will add a new host entry of '192.168.0.5 customhost' to the hosts file.
PS C:\> Invoke-HostHeaderTask -Hostname customhost -IPAddress 192.168.0.5

This will remove host entry of '192.168.0.5 customhost' from the hosts file.
PS C:\> Invoke-HostHeaderTask -Hostname customhost -IPAddress 192.168.0.5 -Action "Remove"
Example json configuration

"Task-Name": {
	"Type": "HostHeader",
	"Params": {
		"Hostname": "",
		"IPAddress": "",
		"Action": ""
	}
}
Task Invoke-HttpRequestTask Task to support making requests over the Internet. This makes a 'GET' request to the URI 'www.somedomain.com'.
PS C:\> Invoke-HttpRequestTask -Uri "http://www.somedomain.com"

This makes a 'POST' request to the URI 'www.somedomain.com' using the data in the Parameters as the payload of the request.
PS C:\> Invoke-HttpRequestTask -Uri "http://www.somedomain.com" -Action "POST" -Parameters @{ param1="data" }

This makes a 'GET' request to the URI 'www.somedomain.com' and throw an exception if the response status code is not 404.
PS C:\> Invoke-HttpRequestTask -Uri "http://www.somedomain.com" -ExpectedStatusCode 404
Example json configuration

"Task-Name": {
	"Type": "HttpRequest",
	"Params": {
		"Uri": "",
		"Action": "",
		"ContentType": "",
		"Parameters": "",
		"ExpectedStatusCode": ""
	}
}
ConfigFunction Invoke-IfConfigFunction Returns a value based on the result of a condition. Evaluates `$value` as a boolean. If `$value` is a non-empty string the value 'abc' is returned. Otherwise the value 'def' will be returned.
PS C:\> Invoke-IfConfigFunction -Condition $value -WhenTrue 'abc' -WhenFalse 'def'
Config function Invoke-IfConfigFunction is registered as If
Task Invoke-IISConfigurationTask Configures an IIS Configuration property Sets the `uploadReadAheadSize` for the `SC1` site to a value of `491520000`
PS C:\> Invoke-IISConfigurationTask -SiteName SC1 -ConfigPath 'system.webServer/serverRuntime' -Key 'uploadReadAheadSize' -Value 491520000
Example json configuration

"Task-Name": {
	"Type": "IISConfiguration",
	"Params": {
		"SiteName": "",
		"ConfigPath": "",
		"Key": "",
		"Value": ""
	}
}
Task (New) Invoke-InsertXmlTask Inserts a new sub-document into an XML document in a file, appended as a child to one or many parents. Inserts the 'subroot' document as a child of the 'config' element.
PS C:\> Invoke-InsertXmlTask -FilePath c:\example.xml -XPath //root/config -Xml "avalue"

Inserts a copy of the 'subroot' document as a child of each child of the 'config' element.
PS C:\> Invoke-InsertXmlTask -FilePath c:\example.xml -XPath //root/config/* -Xml "avalue"
Example json configuration

"Task-Name": {
	"Type": "InsertXml",
	"Params": {
		"FilePath": "",
		"XPath": "",
		"Xml": ""
	}
}
Task (New) Invoke-InstallPSModuleTask Installs PowerShell module on a remote server. This will register 'https://repository1' PowerShell repository source as 'Repository1' and install 'Module1' PowerShell module on the remote server represented by '$remoteSession' session.
PS C:\> Invoke-InstallPSModuleTask -ModuleName "Module1" -RepositoryName "Repository1" -RepositorySource "https://repository1" -ToSession $remoteSession
Example json configuration

"Task-Name": {
	"Type": "InstallPSModule",
	"Params": {
		"ModuleName": "",
		"ModuleRequiredVersion": "",
		"RepositoryName": "",
		"RepositorySource": "",
		"ToSession": ""
	}
}
Task (New) Invoke-InstallSitecoreConfigurationTask Installs Sitecore configuration to the remote server. This will install Sitecore configuration represented by '$configParameters' parameters to the remote server represented by $remoteSession session.
PS C:\> Invoke-InstallSitecoreConfigurationTask -ConfigurationParameters $configParameters -Session $remoteSession
Example json configuration

"Task-Name": {
	"Type": "InstallSitecoreConfiguration",
	"Params": {
		"ConfigurationParameters": "",
		"Session": ""
	}
}
Task Invoke-IoXmlTask Enables, Disables and Deletes configuration files as stated in an IOXML file Update configuration files in "sc902" as stated in sample.ioxml
Invoke-IoXmlTask -RootDirectoryPath "C:\inetpub\wwwroot\sc902" -IoXmlPath "C:\sample.ioxml"
Example json configuration

"Task-Name": {
	"Type": "IoXml",
	"Params": {
		"RootDirectoryPath": "",
		"IoXmlPath": ""
	}
}
ConfigFunction Invoke-JoinConfigFunction Joins a list of values as a single string Creates the following string: "1,2,3"
PS C:\> Invoke-JoinConfigFunction -Values @(1,2,3)

Creates the following string: "1:2:3"
PS C:\> Invoke-JoinConfigFunction -Values @(1,2,3) -Delimiter ":"
Config function Invoke-JoinConfigFunction is registered as Join
ConfigFunction Invoke-JoinPathConfigFunction Joins a list of values as a single path Returns the path 'c:\example\path'
PS C:\> Invoke-JoinPathConfigFunction c: example path

Returns the path '.\abc'
PS C:\> Invoke-JoinPathConfigFunction @('.\',$null,'abc')

Returns the path '.\test\abc'
PS C:\> $obj = [pscustomobject]@{ Value = 'test' }
PS C:\> $obj | Add-Member -Name ToString -MemberType ScriptMethod -Value { $this.Value } -Force
PS C:\> Invoke-JoinPathConfigFunction '.\',$obj,'abc'
Config function Invoke-JoinPathConfigFunction is registered as JoinPath
Task Invoke-ManageAppPoolTask Task to support the Starting, Stopping and Restarting of an application pool. Starts the application pool named DefaultAppPool.
PS C:\> Invoke-ManageAppPoolTask -Name "DefaultAppPool" -Action "Start"

Stops the application pool named DefaultAppPool.
PS C:\> Invoke-ManageAppPoolTask -Name "DefaultAppPool" -Action "Stop"

Restarts the application pool named DefaultAppPool.
PS C:\> Invoke-ManageAppPoolTask -Name "DefaultAppPool" -Action "Restart"
Example json configuration

"Task-Name": {
	"Type": "ManageAppPool",
	"Params": {
		"Name": "",
		"Action": ""
	}
}
Task Invoke-ManageServiceTask Manages changes to an existing service. Updates the existing service 'Example', setting its status to running and changing its startup type to automatic.
PS C:\> Invoke-ManageServiceTask -Name Example -Status Running -StartupType Automatic
Example json configuration

"Task-Name": {
	"Type": "ManageService",
	"Params": {
		"Name": "",
		"Status": "",
		"StartupType": "",
		"Description": "",
		"DisplayName": "",
		"PostDelay": ""
	}
}
Task Invoke-ManageSolrConfigTask Manages changes to the configuration of a core on an existing Solr instance. Adds a new request handler called 'new_query' to 'core0' on the Solr instance at 'http://localhost:8983:/solr'.
PS C:\> Invoke-ManageSolrConfigTask -Address "http://localhost:8983:/solr" -CoreName "core0" -Config @{
	'add-requesthandler' = @{
		name = "/new_query"
		class = "solr.SearchHandler"
		defaults = @{
			echoParams = "explicit"
			wt = "json"
			indent = true
		}
	}
}
Example json configuration

"Task-Name": {
	"Type": "ManageSolrConfig",
	"Params": {
		"Address": "",
		"CoreName": "",
		"Config": "",
		"RetryCount": "",
		"RetryDelay": "",
		"RequestTimeout": ""
	}
}
Task Invoke-ManageSolrCoreTask Manages changes to the cores of an existing Solr instance. Creates a new core called 'core0' on the Solr instance at 'http://localhost:8983:/solr'.
PS C:\> Invoke-ManageSolrCoreTask -Action "Create" -Address "http://localhost:8983:/solr" -Arguments @{ Name = "core0" }

Removes an existing core called 'core0' on the Solr instance at 'http://localhost:8983:/solr'.
PS C:\> Invoke-ManageSolrCoreTask -Action "Unload" -Address "http://localhost:8983:/solr" -Arguments @{ Core = "core0" }

Splits the exiting core 'core0' into the two paths '/Path1' and '/Path2' on the Solr instance at 'http://localhost:8983:/solr'.
PS C:\> Invoke-ManageSolrCoreTask -Action "Split" -Address "http://localhost:8393:/solr" -Arguments @{ Core = "core0" ; Path = @("/Path1","/Path2") }
Example json configuration

"Task-Name": {
	"Type": "ManageSolrCore",
	"Params": {
		"Action": "",
		"Address": "",
		"Arguments": "",
		"RetryCount": "",
		"RetryDelay": "",
		"RequestTimeout": ""
	}
}
Task Invoke-ManageSolrSchemaTask Manages changes to the schema of an existing Solr core. Replaces the dynamic field `*_s` with new properties
PS C:\> Invoke-ManageSolrSchemaTask -Address "http://localhost:8983:/solr" -Core sitecore_master_index -Arguments @{
    'replace-dynamic-field' = @(
        @{
            name: '*_s',
            type: 'lowercase',
            stored: $false,
            indexed: $true
        }
    )
}

Invokes the command using with arguments sources from the file `c:\schema.json`
PS C:\> Invoke-ManageSolrSchemaTask -Address "http://localhost:8983:/solr" -Core sitecore_master_index -ArgumentsFile c:\schema.json
Example json configuration

"Task-Name": {
	"Type": "ManageSolrSchema",
	"Params": {
		"Address": "",
		"Arguments": "",
		"Core": "",
		"RequestTimeout": "",
		"RetryCount": "",
		"RetryDelay": "",
		"Address": "",
		"ArgumentsFile": "",
		"Core": "",
		"RequestTimeout": "",
		"RetryCount": "",
		"RetryDelay": ""
	}
}
Task Invoke-ManageWebsiteTask Task to support the starting and stopping of an IIS web site. Starts the site named 'Default Web Site'.
PS C:\> Invoke-ManageWebsiteTask -Name "Default Web Site" -Action "Start"

Stops the site named 'Default Web Site'.
PS C:\> Invoke-ManageWebsiteTask -Name "Default Web Site" -Action "Stop"

Restarts the site named 'Default Web Site'.
PS C:\> Invoke-ManageWebsiteTask -Name "Default Web Site" -Action "Restart"
Example json configuration

"Task-Name": {
	"Type": "ManageWebsite",
	"Params": {
		"Name": "",
		"Action": ""
	}
}
ConfigFunction (New) Invoke-ModuleConfigFunction Determines if a module is present on the current system. Determines if the module `SQLServer` is installed.
PS C:\> Invoke-ModuleConfigFunction -Name SQLServer

Returns the version of the `SQLServer` module.
PS C:\> Invoke-ModuleConfigFunction -Name SQLServer -Version
Config function Invoke-ModuleConfigFunction is registered as Module
ConfigFunction (New) Invoke-NewPSCredentialConfigFunction Creates and returns a Powershell credential object. Creates a Powershell credential object using the Username `User1` and the Password `Password123`.
PS C:\> Invoke-NewPSCredentialConfigFunction -Username User1 -Password (ConvertTo-SecureSting
-String 'Password123' -AsPlainText -Force)
Config function Invoke-NewPSCredentialConfigFunction is registered as NewPSCredential
Task (New) Invoke-NewRootCertificateTask Creates a new Root Certificate Authority Creates a Root Certificate Authority in the default location of Cert:\LocalMachine\root
PS C:\> Invoke-NewRootCertificateTask
Example json configuration

"Task-Name": {
	"Type": "NewRootCertificate",
	"Params": {
		"DnsName": "",
		"StoreLocation": "",
		"FriendlyName": "",
		"Path": "",
		"Name": "",
		"Password": "",
		"IncludePrivateKey": ""
	}
}
Task (New) Invoke-NewSignedCertificateTask Creates an SSL certificate for web hosting. Creates a web hosting certificate signed by the `$Signer` root authority.
PS C:\> $Signer = (Invoke-GetCertificateConfigFunction -ID 1234567890ABCDEF00001234567890ABCDEF0000 )
PS C:\> Invoke-NewSignedCertificateTask -Signer $Signer

Creates a web hosting certificate signed by the `$Signer` root authority with the Common Name set to `website.com` and also including `example.com` and `127.0.0.1` as Subject Alternative Names.
PS C:\> $Signer = (Invoke-GetCertificateConfigFunction -ID 1234567890ABCDEF00001234567890ABCDEF0000 )
PS C:\> Invoke-NewSignedCertificateTask -Signer $Signer -DNSName "website.com","example.com","127.0.0.1"
Example json configuration

"Task-Name": {
	"Type": "NewSignedCertificate",
	"Params": {
		"Signer": "",
		"CertStoreLocation": "",
		"DnsName": "",
		"FriendlyName": "",
		"Path": "",
		"Name": "",
		"Password": "",
		"IncludePrivateKey": ""
	}
}
ConfigFunction Invoke-NotConfigFunction Returns the logical opposite of the given value. Returns false.
PS C:\> Invoke-NotConfigFunction -Value 1

Returns true.
PS C:\> Invoke-NotConfigFunction -Value ''
Config function Invoke-NotConfigFunction is registered as Not
ConfigFunction Invoke-OrConfigFunction Performs an OR operation on two or more values. Returns true.
PS C:\> Invoke-OrConfigFunction -Values 1,2,3

Returns true.
PS C:\> Invoke-OrConfigFunction -Values '1',' ','2'

Returns false.
PS C:\> Invoke-OrConfigFunction -Values 0,' ',0
Config function Invoke-OrConfigFunction is registered as Or
ConfigFunction (New) Invoke-RandomStringConfigFunction Generates a random string of the specified length. Returns a string of length 10 using all available characters.
PS C:\> Invoke-RandomStringConfigFunction -Length 10
wO_R!WC(`?

Returns a string of length 10 using only capital letters.
PS C:\> Invoke-RandomStringConfigFunction -Length 10 -DisallowCaps -DisallowNumbers -DisallowSpecial
UXLIINHIOW

Returns a string of length 10 without any of the special printable characters and requiring at least one each of the allowed characters (caps, lower and numbers)
PS C:\> Invoke-RandomStringConfigFunction -Length 10 -EnforceComplexity -DisallowSpecial
8stGlLRjpp

Returns a string of length 8 using only numbers. Note this is still returned as a string not an int.
PS C:\> Invoke-RandomStringConfigFunction -Length 8 -DisallowSpecial -DisallowCaps -DisallowLower
07923743
Config function Invoke-RandomStringConfigFunction is registered as RandomString
ConfigFunction Invoke-ReadJsonConfigFunction Reads the contents of a json file. Reads the content of the configuration.json file and returns an object that represents the data in the file.
PS C:\> Invoke-ReadJsonConfigFunction -Path .\configuration.json
Config function Invoke-ReadJsonConfigFunction is registered as ReadJson
Task (New) Invoke-RemoveAppPoolTask Removes an application pool from IIS. Removes the IIS application pool with demoapppool name.
PS C:\> Invoke-RemoveAppPoolTask -Name "demoapppool"
Example json configuration

"Task-Name": {
	"Type": "RemoveAppPool",
	"Params": {
		"Name": ""
	}
}
Task Invoke-RemoveServiceTask Removes a service from the machine. Removes the 'Example' service.
PS C:\> Invoke-RemoveServiceTask -Name Example
Example json configuration

"Task-Name": {
	"Type": "RemoveService",
	"Params": {
		"Name": ""
	}
}
Task (New) Invoke-RemoveWebsiteTask Removes an IIS website. Removes the IIS website with demosite name.
PS C:\> Invoke-RemoveWebsiteTask -Name "demosite"
Example json configuration

"Task-Name": {
	"Type": "RemoveWebsite",
	"Params": {
		"Name": ""
	}
}
Task (New) Invoke-RemoveXmlTask Removes one or more nodes from an XML document in a file specified by an XPath. Removes the 'config' element from the XML document in the file.
PS C:\> Invoke-RemoveXmlTask -FilePath c:\example.xml -XPath //root/config

Removes all the child elements of the 'config' element from the XML document in the file.
PS C:\> Invoke-RemoveXmlTask -FilePath c:\example.xml -XPath //root/config/*

Removes the 'name' attribute from the 'config' element in the XML document in the file.
PS C:\> Invoke-RemoveXmlTask -FilePath c:\example.xml -XPath //root/config/@name
Example json configuration

"Task-Name": {
	"Type": "RemoveXml",
	"Params": {
		"FilePath": "",
		"XPath": "",
		"IgnoreNoMatches": ""
	}
}
ConfigFunction Invoke-ResolveCertificatePathConfigFunction Supports resolving file system paths from Certificate store paths in configurations. This example resolves the file system directory of the specified Certificate store path.
PS C:\> Invoke-ResolveCertificatePathConfigFunction -CertificatePath Cert:\LocalMachine\My\0000000000000000000000000000000000000000
Config function Invoke-ResolveCertificatePathConfigFunction is registered as ResolveCertificatePath
ConfigFunction Invoke-ResolvePathConfigFunction Supports resolving file system paths in configurations. This example resolves the parent directory of the current directory and returns the full directory path.
PS C:\> Invoke-ResolvePathConfigFunction -Path ..
Config function Invoke-ResolvePathConfigFunction is registered as ResolvePath
ConfigFunction (New) Invoke-RestAuthenticationConfigFunction Performs authentication to the REST endpoint specified with `LoginUri` parameter by posting username as `Username` parameter and password as `Password`. Returns web session if the credentials satisfy authentication service and `null` in opposite case.
PS C:\> Invoke-RestAuthenticationConfigFunction -LoginUri 'https://dev.sitecore.net/api/authorization' -Username 'dev@sitecore.com' -Password 'SomePassword'
Config function Invoke-RestAuthenticationConfigFunction is registered as RestAuthentication
Task Invoke-SetXmlTask Sets values in an XML document. Sets the value of //root/config in the file to be 'test'.
PS C:\> Invoke-SetXmlTask -FilePath c:\example.xml -XPath //root/config -Value test

Adds or updates the //root/config element with an attribute called 'extra' and a value of 'test'.
PS C:\> Invoke-SetXmlTask -FilePath c:\example.xml -XPath //root/config -Attributes @{ extra = 'test' }

Adds a new element at //root/config/text with a value of 'test2' and an 'extra' attribute with a value of 'test3'.
PS C:\> Invoke-SetXmlTask -FilePath c:\example.xml -XPath //root/config -Element test -value test2 -Attributes @{ extra = 'test3' }
Example json configuration

"Task-Name": {
	"Type": "SetXml",
	"Params": {
		"Attributes": "",
		"Element": "",
		"FilePath": "",
		"Value": "",
		"XPath": ""
	}
}
Task Invoke-SitecoreUrlTask Makes a request to s specific Sitecore Url. Logs in to the Sitecore instance at http://localhost and then requests the /sitecore/admin/showconfig.aspx page.
PS C:\> Invoke-SitecoreUrlTask -SitecoreInstanceRoot "http://localhost" -SitecoreActionPath "sitecore/admin/showconfig.aspx" -Username "admin" -Password "pass"
Example json configuration

"Task-Name": {
	"Type": "SitecoreUrl",
	"Params": {
		"SitecoreInstanceRoot": "",
		"SitecoreActionPath": "",
		"Username": "",
		"Password": ""
	}
}
ConfigFunction Invoke-SqlConnectionStringConfigFunction Creates a Sql connection string Returns the connection string: 'Data Source=.\Sql2016;Initial Catalog=sitecore_core'
PS C:\> Invoke-SqlConnectionStringConfigFunction '.\SQL2016' 'sitecore_core'

Returns the connection string: 'Data Source=.\Sql2016;Initial Catalog=sitecore_core;User ID=sa;Password=12345'
PS C:\> Invoke-SqlConnectionStringConfigFunction '.\SQL2016' 'sitecore_core' 'sa' '12345
Config function Invoke-SqlConnectionStringConfigFunction is registered as SqlConnectionString
Task Invoke-TransformXmlDocTask Transforms xml files by providing XML Document Transform files This transforms xml files inside root directory by looking at the relative paths of the xml tranformation documents in xdt directory
Invoke-TransformXmlDocTask -RootDirectoryPath "C:\inetpub\wwwroot\sc902" -XdtDirectory "C:\Transforms\MyTransform"
Example json configuration

"Task-Name": {
	"Type": "TransformXmlDoc",
	"Params": {
		"RootDirectoryPath": "",
		"XdtDirectory": ""
	}
}
Task Invoke-UnpackTask Extracts an archive file to disk. Extracts the contents of 'content.zip' to the destination 'c:\unpacked'.
PS C:\> Invoke-UnpackTask -Source content.zip -Destination c:\unpacked
Example json configuration

"Task-Name": {
	"Type": "Unpack",
	"Params": {
		"Source": "",
		"Destination": ""
	}
}
ConfigFunction (New) Invoke-ValidateCountConfigFunction Validates that the parameter array count is in the specified range. The parameter array has length of 3, which is in the range of 2 to 4, so result is `$true`.
PS C:\> Invoke-ValidateCountConfigFunction -MinLength 2 -MaxLength 4 -Param @(1, 2, 3)
PS C:\> $true

The parameter array has length of 5, which isn't in the range of 2 to 4, so result is `$false`.
PS C:\> Invoke-ValidateCountConfigFunction -MinLength 2 -MaxLength  4 -Param @(1, 2, 3, 4, 5)
PS C:\> $false
Config function Invoke-ValidateCountConfigFunction is registered as ValidateCount
ConfigFunction (New) Invoke-ValidateLengthConfigFunction Validates that the parameter length falls in the range. The parameter has length of 5, which is in the range of 4 to 6, so result is `$true`.
PS C:\> Invoke-ValidateLengthConfigFunction -MinLength 4 -MaxLength 6 -Param "April"
PS C:\> $true

The paramter has length of 3, which isn't in the range of 4 to 6, so result is `$false`.
PS C:\> Invoke-ValidateLengthConfigFunction -MinLength 4 -MaxLength 6 -Param "May"
PS C:\> $false
Config function Invoke-ValidateLengthConfigFunction is registered as ValidateLength
ConfigFunction (New) Invoke-ValidateNotNullConfigFunction Verifies the argument is not null. The parameter is not `$null`, result is `$true`.
PS C:\> Invoke-ValidateNotNullConfigFunction -param "Value"
PS C:\> $true

The parameter is `$null`, result is `$false`.
PS C:\> Invoke-ValidateNotNullConfigFunction -param $null
PS C:\> $false
Config function Invoke-ValidateNotNullConfigFunction is registered as ValidateNotNull
ConfigFunction (New) Invoke-ValidateNotNullOrEmptyConfigFunction Validates that the argument is not null and is not an empty string or collection The parameter is not empty string, result is `$true`.
PS C:\> Invoke-ValidateNotNullOrEmptyConfigFunction -param "Value"
PS C:\> $true

The parameter is empty string, result is `$false`.
PS C:\> Invoke-ValidateNotNullOrEmptyConfigFunction -param ""
PS C:\> $false

The parameter is not empty array, result is `$true`.
PS C:\> Invoke-ValidateNotNullOrEmptyConfigFunction -param @(1,2,3)
PS C:\> $false
Config function Invoke-ValidateNotNullOrEmptyConfigFunction is registered as ValidateNotNullOrEmpty
ConfigFunction (New) Invoke-ValidatePatternConfigFunction Validates that parameter matches the RegexPattern. The parameter value matches the pattern, so result is `$true`.
PS C:\> Invoke-ValidatePatternConfigFunction -Pattern "^(ABC)+$" -Param "ABCABC"
PS C:\> $true

If the parameter value doesn't match the pattern, the result is `$false`.
PS C:\> Invoke-ValidatePatternConfigFunction -Pattern "^(ABC)+$" -Param "ABCDABCD"
PS C:\> $false
Config function Invoke-ValidatePatternConfigFunction is registered as ValidatePattern
ConfigFunction (New) Invoke-ValidateRangeConfigFunction Validates that number parameter falls in the range specified by Min and Max. The parameter value is 400, which falls in the range of 100 to 500, result is `$true`.
PS C:\> Invoke-ValidateRangeConfigFunction -Min 100 -Max 500 -Param 400
PS C:\> $true

The parameter value is 600, which doesn't fall in the range of 100 to 500, result is `$false`.
PS C:\> Invoke-ValidateRangeConfigFunction -Min 100 -Max 500 -Param 600
PS C:\> $false
Config function Invoke-ValidateRangeConfigFunction is registered as ValidateRange
ConfigFunction (New) Invoke-ValidateSetConfigFunction Validates that parameter is present in a specified set. The parameter is in the specified set, result is `$true`.
PS C:\> Invoke-ValidateSetConfigFunction -Values @('March', 'April', 'May') -Param 'April'
PS C:\>$true

The parameter is not in the specified set, result is `$false`.
PS C:\> Invoke-ValidateSetConfigFunction -Values @('March', 'April', 'May') -Param 'June'
PS C:\>$false
Config function Invoke-ValidateSetConfigFunction is registered as ValidateSet
Task Invoke-WebBindingTask Creates, updates, and removes web bindings. Adds a new web binding to a site. In this example, the binding matches the default '*:80:' binding.
PS C:\> Invoke-WebBindingTask -SiteName ExampleSite -Add @{ Port = 80 }

Adds a new https binding to a site. In this example, the binding matches the default '*:443:' binding with a certificate.
PS C:\> Invoke-WebBindingTask -SiteName ExampleSite -Add @{ Port = 443; Protocol = 'https'; Thumbprint = '97A875E0F559AB380C1FDBEF3CB391E5C7ED87BA' }

Adds a binding for the localhost address restricted to the hostheader 'Example'.
PS C:\> Invoke-WebBindingTask -SiteName ExampleSite -Add @{ HostHeader = 'Example'; IPAddress = '127.0.0.1' }

Removes all existing bindings before adding a default https binding. The binding is set to '*:443:'.
PS C:\> Invoke-WebBindingTask -SiteName ExampleSite -Remove * -Add @{ Protocol = 'https' }

Removes all existing bindings that use the 'http' protocol.
PS C:\> Invoke-WebBindingTask -SiteName ExampleSite -Remove @{ Protocol = 'http' }

Updates existing bindings using port 80 with an empty hostheader and no assigned IP to use port 81.
PS C:\> Invoke-WebBindingTask -SiteName ExampleSite -Update @{ Port = 80; PropertyName = 'Port'; Value = 81 }

Updates existing binding on port 443 to use the certificate with thumbprint '97A875E0F559AB380C1FDBEF3CB391E5C7ED87BA'.
PS C:\> Invoke-WebBindingTask -SiteName ExampleSite -Update @{ Port = 443; Thumbprint = '97A875E0F559AB380C1FDBEF3CB391E5C7ED87BA' }
Example json configuration

"Task-Name": {
	"Type": "WebBinding",
	"Params": {
		"SiteName": "",
		"Add": "",
		"Remove": "",
		"Update": ""
	}
}
Task Invoke-WebDeployTask Executes a Web Deploy command. This invokes msdeploy from the default path in the following way: c:\\msdeploy.exe -verb:Sync -source:setAcl -dest:setAcl='SiteName',setAclAccess-'FullControl'
PS C:\> $deployArgs = @{
	Source = 'setAcl'
		Dest = @{
			setAcl = 'SiteName'
			setAclAccess = 'FullControl'
		}
	}
PS C:\> Invoke-WebDeployTask -Verb Sync -Arguments $deployArgs
Example json configuration

"Task-Name": {
	"Type": "WebDeploy",
	"Params": {
		"Verb": "",
		"Path": "",
		"Arguments": ""
	}
}
Task Invoke-WebRequestTask Requests a web page, with optional retries Requests the localhost site
PS C:\> Invoke-WebRequestTask -Uri http://localhost

Requests the localhost site. If the site does not return successfully within three attempts an error is thrown.
PS C:\> Invoke-WebRequestTask -Uri http://localhost -RetryCount 3
Example json configuration

"Task-Name": {
	"Type": "WebRequest",
	"Params": {
		"Uri": "",
		"RetryCount": "",
		"RetryDelay": "",
		"RequestTimeout": ""
	}
}
Task Invoke-WebsiteClientCertTask Configures client certificate settings for a website. Configures the website `XConnect` to ignore client certificates.
PS C:\> Invoke-WebsiteClientCertTask -SiteName XConnect -Setting Ignore

Configures the website `XConnect` to accept client certificates and require SSl.
PS C:\> Invoke-WebsiteClientCertTask -SiteName XConnect -Setting Accept -Ssl

Configures the website `XConnect` to require client certificates. When `Require` is chosen for the setting, SSL is also required.
PS C:\> Invoke-WebsiteClientCertTask -SiteName XConnect -Setting Require
Example json configuration

"Task-Name": {
	"Type": "WebsiteClientCert",
	"Params": {
		"SiteName": "",
		"Setting": "",
		"Ssl": ""
	}
}
Task Invoke-WebSiteTask Task to support the creation and modification of an IIS website. This creates a new website named 'NewSite' using the 'NewPool' application pool. The site's physical path is set to c:\inetpub\newsite.
PS C:\> Invoke-WebsiteTask -Name 'NewSite' -ApplicationPool 'NewPool' -PhysicalPath c:\inetpub\newsite

This creates a new website named 'NewSite' using the 'NewPool' application pool. The site's physical path is set to c:\inetpub\newsite. The site will have a binding with the hostname 'Test'.
PS C:\> Invoke-WebsiteTask -Name 'NewSite' -ApplicationPool 'NewPool' -PhysicalPath c:\inetpub\newsite -Hostname 'Test'

This creates a new website named 'NewSite' using the 'NewPool' application pool. The site's physical path is set to c:\inetpub\newsite. The site will have a binding with the port set to 8080.
PS C:\> Invoke-WebsiteTask -Name 'NewSite' -ApplicationPool 'NewPool' -PhysicalPath c:\inetpub\newsite -Port 8080

This creates a new website named 'NewSite' using the 'NewPool' application pool. The site's physical path is set to c:\inetpub\newsite. The site will have a binding with the IP address set to '127.0.0.1'.
PS C:\> Invoke-WebsiteTask -Name 'NewSite' -ApplicationPool 'NewPool' -PhysicalPath c:\inetpub\newsite -IPAddress '127.0.0.1'

This creates the new website and also sets its Limits.ConnectionTimeout property to 1 minute.
PS C:\> $properties = @{
            Limits = @{
                ConnectionTimeout = '00:01:00'
            }
        }
PS C:\> Invoke-WebsiteTask -Name 'NewSite' -ApplicationPool 'NewPool' -PhysicalPath c:\inetpub\newsite -Properties $properties
Example json configuration

"Task-Name": {
	"Type": "WebSite",
	"Params": {
		"Name": "",
		"ApplicationPool": "",
		"PhysicalPath": "",
		"Hostname": "",
		"Port": "",
		"IPAddress": "",
		"Properties": ""
	}
}
ConfigFunction (New) Invoke-WindowsFeatureConfigFunction Returns if a Windows Feature is enabled or not. Determine if the feature "IIS-Webserver" is enabled or not and returns true or false.
PS C:\> Invoke-WindowsFeatureConfigFunction -Name "IIS-WebServer"
Config function Invoke-WindowsFeatureConfigFunction is registered as WindowsFeature
Register-SitecoreInstallExtension Registers extensions to use in Sitecore Install Framework configurations. Registers the `Write-Host` command as a `Task` called `Write`
PS C:\> Register-SitecoreInstallExtension -Command Write-Host -As Write -Type Task

Registers the `Copy-Item` command as a `Task` called `Copy`. The use of `Force` will ensure any registered task called `Copy` will be overwritten.
PS C:\> Register-SitecoreInstallExtension -Command Copy-Item -As Copy -Type Task -Force
Write-TaskHeader THIS FUNCTION IS OBSOLETE AND WILL BE REMOVED IN THE NEXT MAJOR VERSION. Outputs a formatted message to the information stream. This outputs a message in the format '[----- SomeTask : CustomType -----]'. The message will fill the width of the host buffer with extra dashes.
PS C:\> Write-TaskHeader -TaskName 'SomeTask' -TaskType 'CustomType'
Write-TaskInfo THIS FUNCTION IS OBSOLETE AND WILL BE REMOVED IN THE NEXT MAJOR VERSION. PLEASE USE `Write-Information` INSTEAD. If this example is called within a function called 'Invoke-MyFunctionTask', the output is: '[MyFunction]:[Context] log this' If the example is called from some other function, the output would is: '[Context] log this'
PS C:\> Write-TaskInfo -Message 'log this' -Tag 'Context'

This call outputs: '[CustomTask]:[Context] log this'
PS C:\> Write-TaskInfo -Message 'log this' -Tag 'Context' -TaskName 'CustomTask'