Skip to content

Instantly share code, notes, and snippets.

@abelevtsov
Created November 30, 2016 11:12
Show Gist options
  • Save abelevtsov/355e912afc15d74dbb3fa21489f2781d to your computer and use it in GitHub Desktop.
Save abelevtsov/355e912afc15d74dbb3fa21489f2781d to your computer and use it in GitHub Desktop.
$environment = $OctopusParameters["Octopus.Environment.Name"]
$buildPath = $OctopusParameters["BuildPath"]
$apiuri = $OctopusParameters["PluginRegistrationServiceUrl"]
Write-Output "Publish Plugins to $environment"
$start_time = Get-Date
$mergedPluginAssemblyPath = "$buildPath\Sk.Crm.Plugins.dll"
$mergedPluginAssemblyPath = $mergedPluginAssemblyPath -replace "\\", "\\"
$configPath = "$buildPath\RegisterFile.crmregister"
$configPath = $configPath -replace "\\", "\\"
$data = @"
{
"mergedPluginAssemblyPath": "$mergedPluginAssemblyPath",
"configPath": "$configPath",
"environment": "$environment"
}
"@
Write-Output $data
Invoke-WebRequest -Uri $apiuri -Method POST -Body $data -ContentType "application/json"
Write-Output "Plugins published successfully, time taken: $((Get-Date).Subtract($start_time).Seconds) second(s)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment