example-scripts/schedule-import-all-solutions.ps1

$conn = Get-RegentConnection -CrmInstance CRMRECRUIT

$publisher = Get-CrmRecords -EntityLogicalName publisher -conn $conn -fields * -FilterAttribute friendlyname -FilterOperator eq -FilterValue "Regent Ops"

$sols = Get-CrmRecords -EntityLogicalName "solution" -conn $conn -Fields uniquename, description, publisherid -FilterAttribute publisherid -FilterOperator eq -FilterValue $publisher.CrmRecords[0].publisherid

Write-Host -ForegroundColor green "Located the following solutions"
$sols.CrmRecords | ForEach-Object {
  Write-Host $_.uniquename
}

Write-host "All the above solutions wil lbe imported into CRMRECRUITDEV. Are you sure you want to continue?" -ForegroundColor Yellow 
$Readhost = Read-Host "Select Y or N (default N) " 
Switch ($ReadHost) {
  Y { $continue = $true} 
  N { $continue = $false} 
  Default { $continue = $false } 
}
if (-not $continue) {
  Write-Host "Canceling operation."
  return
}
$sol.CrmRecords | ForEach-Object {
  Move-RegentSolution -SolutionName FacultyReview `
    -SourceCrmInstance CRMRECRUIT `
    -DestinationCrmInstance CRMRECRUITTEST `
    -Managed $false `
    -PublishCustomizations $false `
    -Emails "dhines@regent.edu" `
    -CommitMessage "Added Faculty Review" `
    -ImportTime "11AM" `
    -Verbose
}