DifferentialProfile/DifferentialProfile.psm1
Import-Module -Name $PSScriptRoot\..\Util\Util function New-RMDifferentialProfile { param( [string] $Name, [System.Object] $Entitlement, [string] $OrganizationId, [string] $Description, [string] $ApplianceId, [string[]] $Schedule, [string] $TransferMode, #Differetial Configs [string] $MigrationId, [string] $SourceId, [hashtable] $Target, [hashtable] $Source, [bool] $ShutdownSource, [bool] $ShutdownTarget, [bool] $RemoveTargetAgent, [bool] $PublishMigrationHub, [string] $TransferType, [System.Object] $MigrationInstructions, [System.Object] $TargetProperties, [string] $TargetIp ) $DifferentialProfiles = @{ "name" = $Name "entitlement" = $Entitlement.id "organization_id" = $OrganizationId "description" = $null "appliance_id" = $ApplianceId "schedule" = @() "transfer_mode" = "run-once" "differential_configs" = @( @{ "migration" = $MigrationId "source_id" = $SourceId "source" = $Source "shutdown_source" = $ShutdownSource "shutdown_target" = $ShutdownTarget "remove_target_agent" = $RemoveTargetAgent "publish_migration_hub" = $PublishMigrationHub "transfer_type" = $TransferType "target_properties" = $TargetProperties "migration_instructions" = $MigrationInstructions "target_ip" = $TargetIp } ) } | ConvertTo-Json -Depth 100 $RMLoginResult = Get-Variable -Name "RMContext-UserLogin" -ValueOnly $Uri = Get-Variable -Name "RMContext-ReactorURI" -ValueOnly $Headers = @{ Accept = "application/rm+json" "X-Auth-Token" = $RMLoginResult.token } $Params = @{ Method = "Post" Uri = $Uri + "/differentialprofiles" Body = $DifferentialProfiles ContentType = "application/json" Headers = $Headers } Invoke-RMRestMethod -Params $Params } |