web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Powershell script to d...
Power Apps
Unanswered

Powershell script to download and extract changes from powerapps environment into CI/CD

(0) ShareShare
ReportReport
Posted on by 7

I have following Power shell script which works when I run from windows computer but when run including in CI/CD process throws error:

 

#[CmdletBinding()]

#param
#(
# [string]$connectionString #The connection string as per CRM Sdk
#)

#$tenantName=read-Host "Tenant Name (https://{TenantName}.crm6.dynamics.com)"
#$userName=Read-Host "Login name"
#$password=Read-Host "Password"

<#
$modules=Get-Module -ListAvailable -Name Xrm.Framework.CI.PowerShell.Cmdlets | Where-Object {$_.Version.Major -eq 9}


if($modules -eq $null -or $modules.Count -eq 0){
 Write-Host "Module Xrm.Framework.CI.PowerShell.Cmdlets missing. Installing the module...."
 Install-Module -Name Xrm.Framework.CI.PowerShell.Cmdlets
}

$module = Get-Module -Name Xrm.Framework.CI.PowerShell.Cmdlets
if($module -eq $null){
 Write-Host "Importing Module..."
 Import-Module -Name Xrm.Framework.CI.PowerShell.Cmdlets
}
#>



$connectionString="AuthType=Office365;Url=https://test.crm6.dynamics.com;UserName=tt@tt.com;Password=test122"

$ErrorActionPreference = "Stop"

#Script Location
$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition
Write-Verbose "Script Path: $scriptPath"

Write-Host "ConnectionString = $connectionString"

& "$scriptPath\lib\ExtractCustomizations.ps1" -Verbose -solutionPackager "$scriptPath\lib\SolutionPackager.exe" -solutionFilesFolder "$scriptPath\SolutionPackages\package" -mappingFile "$scriptPath\SolutionPackages\Mapping.xml" -solutionName "MySolution" -connectionString $connectionString -TreatPackWarningsAsErrors $false<p> </p><p>what I am doing wrong in this script? </p>

 

I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 531 Most Valuable Professional

#2
Haque Profile Picture

Haque 261

#3
Kalathiya Profile Picture

Kalathiya 221 Super User 2026 Season 1

Last 30 days Overall leaderboard