Skip to content

Instantly share code, notes, and snippets.

@jcallaghan
Created July 15, 2020 12:54
Show Gist options
  • Save jcallaghan/fc829cf951aa0e9e0a93af8c6e4afd15 to your computer and use it in GitHub Desktop.
Save jcallaghan/fc829cf951aa0e9e0a93af8c6e4afd15 to your computer and use it in GitHub Desktop.
Install-Module -Name Microsoft.PowerApps.Administration.PowerShell
Install-Module -Name Microsoft.PowerApps.PowerShell -AllowClobber
# This call opens prompt to collect credentials (Azure Active Directory account and password) used by the commands
Add-PowerAppsAccount
# Here is how you can pass in credentials (avoiding opening a prompt)
$pass = ConvertTo-SecureString "password" -AsPlainText -Force
Add-PowerAppsAccount -Username foo@bar.com -Password $pass
#Add a canvas app to a Common Data Service solution
Set-PowerAppAsSolutionAware
#Read environments (previously Get-PowerAppsEnvironment)
Get-PowerAppEnvironment
Get-FlowEnvironment
#Read, update, and delete a canvas app
#(previously Get-App)
Get-PowerApp
#(previously Remove-App)
Remove-PowerApp
#(previously Publish-App)
Publish-PowerApp
#(previously Set-PowerAppDisplayName)
Set-AppDisplayName
#(previously Get-AppVersion)
Get-PowerAppVersion
#(previously Restore-AppVersion)
Restore-PowerAppVersion
#Read, update, and delete canvas app permissions
#(previously Get-AppRoleAssignment)
Get-PowerAppRoleAssignment
#(previously Set-AppRoleAssignment)
Set-PowerAppRoleAssignment
#(previously Remove-AppRoleAssignment)
Remove-PowerAppRoleAssignment
#Read, update, and delete a flow
Get-Flow
Get-FlowRun
Enable-Flow
Disable-Flow
Remove-Flow
# Get all flows and their run history
Get-Flow | foreach-object{
write-host $_.DisplayName -ForegroundColor Green
Get-FlowRun $_.FlowName
}
#Read, update, and delete flow permissions
Get-FlowOwnerRole
Set-FlowOwnerRole
Remove-FlowOwnerRole
#Read and respond to flow approvals
Get-FlowApprovalRequest
Get-FlowApproval
RespondTo-FlowApprovalRequest
#Read and delete connections
#(previously Get-Connection)
Get-PowerAppConnection
Get-PowerAppConnection | select ConnectionName, ConnectorName, CreatedBy
Get-PowerAppConnection | where{$_.ConnectorName -eq "shared_msnweather"} | select ConnectionName, ConnectorName, CreatedBy
#(previously Remove-Connection)
Remove-PowerAppConnection
#Read, update, and delete connection permissions
#(previously Get-ConnectionRoleAssignment)
Get-PowerAppConnectionRoleAssignment
#(previously Set-ConnectionRoleAssignment)
Set-PowerAppConnectionRoleAssignment
#(previously Remove-ConnectionRoleAssignment)
Remove-PowerAppConnectionRoleAssignment
#Read and delete connectors
#(previously Get-Connector)
Get-PowerAppConnector
Get-PowerAppConnector | sort-object Source | select ConnectorName, Source, Tier | ft
Get-PowerAppConnector | where {$_.Source -ne "marketplace" -and $_.Publisher -ne "Microsoft"} | select *
Get-PowerAppConnector | where {$_.Source -ne "marketplace" -and $_.Publisher -ne "Microsoft"} | select DisplayName, CreatedTime, Publisher | ft
Get-PowerAppConnector | select connectorname, connectorid, displayname, description, source, tier, connectionparameters |?{$_.source -eq "marketplace"} | Export-Csv AvailableConnectors.csv -NoTypeInformation -Encoding UTF32
#(previously Remove-Connector)
Remove-PowerAppConnector
#Read, update, and delete custom connector permissions
#(previously Get-ConnectorRoleAssignment)
Get-PowerAppConnectorRoleAssignment
#(previously Set-ConnectorRoleAssignment)
Set-PowerAppConnectorRoleAssignment
#(previously Remove-ConnectorRoleAssignment)
Remove-PowerAppConnectorRoleAssignment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment