Prise en charge de PowerShell pour PowerApps (préversion)PowerShell support for PowerApps (preview)

Avec le lancement de la préversion des cmdlets PowerShell pour les administrateurs et les créateurs d’applications, vous pouvez automatiser de nombreuses tâches de monitoring et de gestion qui, actuellement, ne peuvent être utilisées que manuellement dans PowerApps ou le Centre d’administration PowerApps.With the preview launch of the PowerShell cmdlets for app creators and administrators, you can automate many of the monitoring and management tasks that are only possible manually today in PowerApps or the PowerApps Admin center.

InstallationInstallation

Pour exécuter des applets de commande PowerShell pour les créateurs d’applications, procédez comme suit :To run the PowerShell cmdlets for app creators, do the following:

  1. Téléchargez le fichier de scripts PowerShell.Download the PowerShell scripts file.

  2. Décompressez le fichier dans un dossier.Unzip the file into a folder.

  3. Ouvrez une fenêtre de commande PowerShell dans ce même dossier, en tant qu’administrateur.Open a PowerShell command window (as administrator) in that same folder.

  4. Exécutez la commande à usage unique PowerShell suivante (cela suppose que vous n’ayez jamais exécuté de commandes PowerShell sur l’ordinateur actuel) :Run the following one-time PowerShell command (this presumes you've never run PowerShell commands on the current machine):

    Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force
    
  5. Importez les modules nécessaires à l’aide des commandes suivantes :Import the necessary modules using the following commands:

    Import-Module .\Microsoft.PowerApps.Administration.PowerShell.psm1 -Force
    Import-Module .\Microsoft.PowerApps.PowerShell.psm1 -Force
    
  6. Il existe un problème connu aujourd’hui qui peut également vous amener à débloquer manuellement les fichiers PowerShell à l’aide de la commande suivante :There is a known issue today that may also require you to manually unblock the PowerShell files using the following command:

    dir . | Unblock-File
    
  7. Avant d’accéder aux commandes, fournissez vos informations d’identification à l’aide de la commande suivante.Before accessing any of the commands, provide your credentials using the following command. Ces informations d’identification sont actualisées jusqu’à ~8 heures avant qu’il vous soit demandé de vous reconnecter pour continuer d’utiliser les cmdlets.These credentials are refreshed for up to ~8 hours before you're required to sign in again to continue using the cmdlets.

    # This call will open a prompt to collect the credentials (AAD account & password) that will be 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
    

Applets de commande PowerApps pour les créateurs d’applications (préversion)PowerApps cmdlets for app creators (preview)

PrérequisPrerequisite

Les utilisateurs avec une licence PowerApps valide peuvent exécuter les opérations de ces cmdlets, mais ils n’auront accès qu’aux ressources (par exemple, les applications, les flux, etc.) qui ont été créées ou partagées avec eux.Users with a valid PowerApps license can perform the operations in these cmdlets, but they will only have access to the resources (for example, apps, flows, etc.) that have been created or shared with them.

Liste des cmdletsCmdlet list

Note

Nous avons mis à jour certains noms de fonction des applets de commande dans la dernière version pour ajouter des préfixes appropriés servant à éviter les collisions.We have updated some of the cmdlets function names in the latest release in order to add appropriate prefixes to prevent collisions. Consultez le tableau ci-dessous pour une vue d’ensemble de ce qui a changé.See the table below for an overview of what has changed.

ObjectifPurpose CmdletCmdlet
Lire les environnementsRead environments Get-PowerAppEnvironment (anciennement Get-PowerAppsEnvironment)Get-PowerAppEnvironment (previously Get-PowerAppsEnvironment)
Get-FlowEnvironmentGet-FlowEnvironment
Lire, mettre à jour et supprimer une application de canevasRead, update, and delete a canvas app Get-PowerApp (anciennement Get-App)Get-PowerApp (previously Get-App)
Remove-PowerApp (anciennement Remove-App)Remove-PowerApp (previously Remove-App)
Publish-PowerApp (anciennement Publish-App)Publish-PowerApp (previously Publish-App)
Set-AppDisplayName (anciennement Set-PowerAppDisplayName)Set-AppDisplayName (previously Set-PowerAppDisplayName)
Get-PowerAppVersion (anciennement Get-AppVersion)Get-PowerAppVersion (previously Get-AppVersion)
Restore-PowerAppVersion (anciennement Restore-AppVersion)Restore-PowerAppVersion (previously Restore-AppVersion)
Lire, mettre à jour et supprimer les autorisations d’une application de canevasRead, update, and delete canvas app permissions Get-PowerAppRoleAssignment (anciennement Get-AppRoleAssignment)Get-PowerAppRoleAssignment (previously Get-AppRoleAssignment)
Set-PowerAppRoleAssignment (anciennement Set-AppRoleAssignment)Set-PowerAppRoleAssignment (previously Set-AppRoleAssignment)
Remove-PowerAppRoleAssignment (anciennement Remove-AppRoleAssignment)Remove-PowerAppRoleAssignment (previously Remove-AppRoleAssignment)
Lire, mettre à jour et supprimer un fluxRead, update, and delete a flow Get-FlowGet-Flow
Get-FlowRunGet-FlowRun
Enable-FlowEnable-Flow
Disable-FlowDisable-Flow
Remove-FlowRemove-Flow
Lire, mettre à jour et supprimer les autorisations d’un fluxRead, update, and delete flow permissions Get-FlowOwnerRoleGet-FlowOwnerRole
Set-FlowOwnerRoleSet-FlowOwnerRole
Remove-FlowOwnerRoleRemove-FlowOwnerRole
Lire des approbations de flux et y répondreRead and respond to flow approvals Get-FlowApprovalRequestGet-FlowApprovalRequest
Get-FlowApprovalGet-FlowApproval
RespondTo-FlowApprovalRequestRespondTo-FlowApprovalRequest
Lire et supprimer des connexionsRead and delete connections Get-PowerAppConnection (anciennement Get-Connection)Get-PowerAppConnection (previously Get-Connection)
Remove-PowerAppConnection (anciennement Remove-Connection)Remove-PowerAppConnection (previously Remove-Connection)
Lire, mettre à jour et supprimer les autorisations de connexionRead, update, and delete connection permissions Get-PowerAppConnectionRoleAssignment (anciennement Get-ConnectionRoleAssignment)Get-PowerAppConnectionRoleAssignment (previously Get-ConnectionRoleAssignment)
Set-PowerAppConnectionRoleAssignment (anciennement Set-ConnectionRoleAssignment)Set-PowerAppConnectionRoleAssignment (previously Set-ConnectionRoleAssignment)
Remove-PowerAppConnectionRoleAssignment (anciennement Remove-ConnectionRoleAssignment)Remove-PowerAppConnectionRoleAssignment (previously Remove-ConnectionRoleAssignment)
Lire et supprimer des connecteursRead and delete connectors Get-PowerAppConnector (anciennement Get-Connector)Get-PowerAppConnector (previously Get-Connector)
Remove-PowerAppConnector (anciennement Remove-Connector)Remove-PowerAppConnector (previously Remove-Connector)
Lire, mettre à jour et supprimer des autorisations de connecteur personnaliséesRead, update, and delete custom connector permissions Get-PowerAppConnectorRoleAssignment (anciennement Get-ConnectorRoleAssignment)Get-PowerAppConnectorRoleAssignment (previously Get-ConnectorRoleAssignment)
Set-PowerAppConnectorRoleAssignment (anciennement Set-ConnectorRoleAssignment)Set-PowerAppConnectorRoleAssignment (previously Set-ConnectorRoleAssignment)
Remove-PowerAppConnectorRoleAssignment (anciennement Remove-ConnectorRoleAssignment)Remove-PowerAppConnectorRoleAssignment (previously Remove-ConnectorRoleAssignment)

Note

Utilisez les commandes suivantes pour comprendre la syntaxe et afficher des exemples pour chaque cmdlet :Use the following commands to understand syntax and view samples for each of the cmdlets:

Get-Help Get-PowerAppEnvironment
Get-Help Get-PowerAppEnvironment -Examples
Get-Help Get-PowerAppEnvironment -Detailed

Cmdlets PowerApps pour les administrateurs (préversion)PowerApps cmdlets for administrators (preview)

PrérequisPrerequisite

Afin d’effectuer les opérations d’administration dans les cmdlets d’administration, vous aurez besoin de ce qui suit :To perform the administration operations in the admin cmdlets, you'll need the following:

Liste des cmdletsCmdlet list

Note

Nous avons mis à jour certains noms de fonction des applets de commande dans la dernière version pour ajouter des préfixes appropriés servant à éviter les collisions.We have updated some of the cmdlets function names in the latest release in order to add appropriate prefixes to prevent collisions. Consultez le tableau ci-dessous pour une vue d’ensemble de ce qui a changé.See the table below for an overview of what has changed.

ObjectifPurpose CmdletsCmdlets
Lire, mettre à jour et supprimer des environnements et des bases de données Common Data Service for AppsRead, update, and delete environments & Common Data Service for Apps databases New-AdminPowerAppEnvironment *New*New-AdminPowerAppEnvironment *New*
Set-AdminPowerAppEnvironmentDisplayName *New*Set-AdminPowerAppEnvironmentDisplayName *New*
Get-AdminPowerAppEnvironment (anciennement Get-AdminEnvironment)Get-AdminPowerAppEnvironment (previously Get-AdminEnvironment)
Remove-AdminPowerAppEnvironment (anciennement Remove-AdminEnvironment)Remove-AdminPowerAppEnvironment (previously Remove-AdminEnvironment)
New-AdminPowerAppCdsDatabase *New*New-AdminPowerAppCdsDatabase *New*
Get-AdminPowerAppCdsDatabaseLanguages *New*Get-AdminPowerAppCdsDatabaseLanguages *New*
Get-AdminPowerAppCdsDatabaseCurrencies *New*Get-AdminPowerAppCdsDatabaseCurrencies *New*
Get-AdminPowerAppEnvironmentLocations *New*Get-AdminPowerAppEnvironmentLocations *New*
Lire, mettre à jour et supprimer les autorisations de l’environnementRead, update, and delete environment permissions

Aujourd’hui, ces applets de commande s’appliquent uniquement aux environnements qui n’ont pas une base de données Common Data Service (CDS) for Apps.These cmdlets only work today for environments that do not have a Common Data Service (CDS) for Apps database.
Get-AdminPowerAppEnvironmentRoleAssignment (anciennement Get-AdminEnvironmentRoleAssignment)Get-AdminPowerAppEnvironmentRoleAssignment (previously Get-AdminEnvironmentRoleAssignment)
Set-AdminPowerAppEnvironmentRoleAssignment (anciennement Set-AdminEnvironmentRoleAssignment)Set-AdminPowerAppEnvironmentRoleAssignment (previously Set-AdminEnvironmentRoleAssignment)
Remove-AdminPowerAppEnvironmentRoleAssignment (anciennement Remove-AdminEnvironmentRoleAssignment)Remove-AdminPowerAppEnvironmentRoleAssignment (previously Remove-AdminEnvironmentRoleAssignment)
Lire, mettre à jour et supprimer des applications de canevasRead, update, and remove canvas apps Get-AdminPowerApp (anciennement Get-AdminApp)Get-AdminPowerApp (previously Get-AdminApp)
Remove-AdminPowerApp (anciennement Remove-AdminApp)Remove-AdminPowerApp (previously Remove-AdminApp)
Get-AdminPowerAppConnectionReferences *New*Get-AdminPowerAppConnectionReferences *New*
Set-AdminPowerAppAsFeatured *New*Set-AdminPowerAppAsFeatured *New*
Clear-AdminPowerAppAsFeatured *New*Clear-AdminPowerAppAsFeatured *New*
Set-AdminPowerAppAsHero *New*Set-AdminPowerAppAsHero *New*
Clear-AdminPowerAppAsHero *New*Clear-AdminPowerAppAsHero *New*
Set-AdminPowerAppApisToBypassConsent *New*Set-AdminPowerAppApisToBypassConsent *New*
Clear-AdminPowerAppApisToBypassConsent *New*Clear-AdminPowerAppApisToBypassConsent *New*
Lire, mettre à jour et supprimer les autorisations d’une application de canevasRead, update, and delete canvas app permissions Get-AdminPowerAppRoleAssignment (anciennement Get-AdminAppRoleAssignment)Get-AdminPowerAppRoleAssignment (previously Get-AdminAppRoleAssignment)
Remove-AdminPowerAppRoleAssignment (anciennement Remove-AdminAppRoleAssignment)Remove-AdminPowerAppRoleAssignment (previously Remove-AdminAppRoleAssignment)
Set-AdminPowerAppRoleAssignment (anciennement Set-AdminAppRoleAssignment)Set-AdminPowerAppRoleAssignment (previously Set-AdminAppRoleAssignment)
Set-AdminPowerAppOwner (anciennement Set-AdminAppOwner)Set-AdminPowerAppOwner (previously Set-AdminAppOwner)
Lire, mettre à jour et supprimer des fluxRead, update, and delete flows Get-AdminFlowGet-AdminFlow
Enable-AdminFlowEnable-AdminFlow
Disable-AdminFlowDisable-AdminFlow
Remove-AdminFlowRemove-AdminFlow
Remove-AdminFlowApprovals *New*Remove-AdminFlowApprovals *New*
Lire, mettre à jour et supprimer les autorisations d’un fluxRead, update, and delete flow permissions Get-AdminFlowOwnerRoleGet-AdminFlowOwnerRole
Set-AdminFlowOwnerRoleSet-AdminFlowOwnerRole
Remove-AdminFlowOwnerRoleRemove-AdminFlowOwnerRole
Lire et supprimer des connexionsRead and delete connections Get-AdminPowerAppConnection (anciennement Get-AdminConnection)Get-AdminPowerAppConnection (previously Get-AdminConnection)
Remove-AdminPowerAppConnection (anciennement Remove-AdminConnection)Remove-AdminPowerAppConnection (previously Remove-AdminConnection)
Lire, mettre à jour et supprimer les autorisations de connexionRead, update, and delete connection permissions Get-AdminPowerAppConnectionRoleAssignment (anciennement Get-AdminConnectionRoleAssignment)Get-AdminPowerAppConnectionRoleAssignment (previously Get-AdminConnectionRoleAssignment)
Set-AdminPowerAppEnvironmentConnectionRoleAssignment (anciennement Set-AdminConnectionRoleAssignment)Set-AdminPowerAppEnvironmentConnectionRoleAssignment (previously Set-AdminConnectionRoleAssignment)
Remove-AdminPowerAppConnectionRoleAssignment (anciennement Remove-AdminConnectionRoleAssignment)Remove-AdminPowerAppConnectionRoleAssignment (previously Remove-AdminConnectionRoleAssignment)
Lire et supprimer des connecteurs personnalisésRead and delete custom connectors Get-AdminPowerAppConnector (anciennement Get-AdminConnector)Get-AdminPowerAppConnector (previously Get-AdminConnector)
Remove-AdminPowerAppConnector (anciennement Remove-AdminConnector)Remove-AdminPowerAppConnector (previously Remove-AdminConnector)
Lire, mettre à jour et supprimer des autorisations de connecteur personnaliséesRead, update, and delete custom connector permissions Get-AdminPowerAppConnectorRoleAssignment (anciennement Get-AdminConnectorRoleAssignment)Get-AdminPowerAppConnectorRoleAssignment (previously Get-AdminConnectorRoleAssignment)
Set-AdminPowerAppConnectorRoleAssignment (anciennement Set-AdminConnectorRoleAssignment)Set-AdminPowerAppConnectorRoleAssignment (previously Set-AdminConnectorRoleAssignment)
Remove-AdminPowerAppConnectorRoleAssignment (anciennement Remove-AdminConnectorRoleAssignment)Remove-AdminPowerAppConnectorRoleAssignment (previously Remove-AdminConnectorRoleAssignment)
Lire les paramètres utilisateur PowerApps, les paramètres utilisateur-application et les notifications d’un utilisateurRead a user's PowerApps user settings, user-app settings, and notifications Get-AdminPowerAppsUserDetailsGet-AdminPowerAppsUserDetails
Lire et supprimer des paramètres Microsoft Flow d’un utilisateur qui ne sont pas visibles par l’utilisateur, mais qui prennent en charge l’exécution de fluxRead & delete a user's Microsoft Flow settings, which are not visible to user, but that support flow execution Get-AdminFlowUserDetailsGet-AdminFlowUserDetails
Remove-AdminFlowUserDetailsRemove-AdminFlowUserDetails
Créer, lire, mettre à jour et supprimer des stratégies de protection contre la perte de données pour votre organisationCreate, read, update & delete data loss prevention policies for your organization Get-AdminDlpPolicy (anciennement Get-AdminApiPolicy)Get-AdminDlpPolicy (previously Get-AdminApiPolicy)
Add-AdminDlpPolicy (anciennement Add-AdminApiPolicy)Add-AdminDlpPolicy (previously Add-AdminApiPolicy)
Remove-AdminDlpPolicy (anciennement Remove-AdminApiPolicy)Remove-AdminDlpPolicy (previously Remove-AdminApiPolicy)
Set-AdminDlpPolicy (anciennement Set-AdminApiPolicy)Set-AdminDlpPolicy (previously Set-AdminApiPolicy)
Add-ConnectorToBusinessDataGroupAdd-ConnectorToBusinessDataGroup
Remove-ConnectorFromBusinessDataGroupRemove-ConnectorFromBusinessDataGroup

Note

Utilisez les commandes suivantes pour comprendre la syntaxe et afficher un exemple pour chaque cmdlet :Use the following commands to understand syntax and view sample for each of the cmdlets:

Get-Help Get-AdminPowerAppEnvironment
Get-Help Get-AdminPowerAppEnvironment -Examples
Get-Help Get-AdminPowerAppEnvironment -Detailed

Historique des versionsVersion History

VersionVersion DateDate Mises à jourUpdates
1.01.0 23/04/201804/23/2018
  1. Lancement initial des applets de commande PowerApps pour les créateurs d’applications (préversion), notamment les applets de commande de gestion pour Environnements, Applications, Flux, Approbations Flow, Connexions et Connecteurs personnalisésInitial launch of the PowerApps cmdlets for app creators (preview) including management cmdlets for Environments, Apps, Flows, Flow approvals, Connections, and Custom Connectors
  2. Lancement initial des applets de commande PowerApps pour les administrateurs (préversion), notamment les applets de commande d’administration pour Environnements, Applications et FluxInitial launch of the PowerApps cmdlets for administrators (preview) including administrative cmdlets for Environments, Apps, and Flows
2.02.0 24/05/201805/24/2018
  1. Correctifs de bogues mineurs dans les applets de commande destinées aux administrateurs et créateurs d’applicationsMinor bug fixes in both the cmdlets for app creators and administrators
  2. Ajout des nouvelles applets de commande d’administration suivantes :Added the following new administrative cmdlets:
    Get-AdminConnectionGet-AdminConnection
    Remove-AdminConnectionRemove-AdminConnection
    Get-AdminConnectionRoleAssignmentGet-AdminConnectionRoleAssignment
    Set-AdminConnectionRoleAssignmentSet-AdminConnectionRoleAssignment
    Remove-AdminConnectionRoleAssignmentRemove-AdminConnectionRoleAssignment
    Get-AdminConnectorGet-AdminConnector
    Remove-AdminConnectorRemove-AdminConnector
    Set-AdminConnectorRoleAssignmentSet-AdminConnectorRoleAssignment
    Get-AdminConnectorRoleAssignmentGet-AdminConnectorRoleAssignment
    Remove-AdminConnectorRoleAssignmentRemove-AdminConnectorRoleAssignment
    Get-AdminPowerAppsUserDetailsGet-AdminPowerAppsUserDetails
    Get-AdminFlowUserDetailsGet-AdminFlowUserDetails
    Remove-AdminFlowUserDetailsRemove-AdminFlowUserDetails
    Get-AdminApiPolicyGet-AdminApiPolicy
    Add-AdminApiPolicyAdd-AdminApiPolicy
    Remove-AdminApiPolicyRemove-AdminApiPolicy
    Set-AdminApiPolicySet-AdminApiPolicy
    Add-ConnectorToBusinessDataGroupAdd-ConnectorToBusinessDataGroup
    Remove-ConnectorFromBusinessDataGroupRemove-ConnectorFromBusinessDataGroup
3.03.0 30/07/201807/30/2018
  1. Possibilité ajoutée de passer des informations d’identification à Add-PowerAppsAccount (pour activer les scripts périodiques)Added the ability to pass-in credentials to the Add-PowerAppsAccount (to enable recurring scripting)
  2. Correctifs de bogues mineurs dans les applets de commande destinées aux administrateurs et créateurs d’applicationsMinor bug fixes in both the cmdlets for app creators and administrators
  3. Ajout du préfixe « PowerApp » ou « Flow » à chaque applet de commande destinée aux créateurs d’applicationsAdded the "PowerApp" or "Flow" prefix to each cmdlet for app creators
  4. Ajout du préfixe « AdminPowerApp » ou « AdminFlow » à chaque applet de commande destinée aux administrateurs d’applicationsAdded the "AdminPowerApp" or "AdminFlow" prefix to each cmdlet for administrators
  5. Ajout des nouvelles applets de commande d’administration suivantes :Added the following new administrative cmdlets:
    New-AdminPowerAppEnvironmentNew-AdminPowerAppEnvironment
    Set-AdminPowerAppEnvironmentDisplayNameSet-AdminPowerAppEnvironmentDisplayName
    New-AdminPowerAppCdsDatabaseNew-AdminPowerAppCdsDatabase
    Get-AdminPowerAppCdsDatabaseLanguagesGet-AdminPowerAppCdsDatabaseLanguages
    Get-AdminPowerAppCdsDatabaseCurrenciesGet-AdminPowerAppCdsDatabaseCurrencies
    Get-AdminPowerAppEnvironmentLocationsGet-AdminPowerAppEnvironmentLocations
    Get-AdminPowerAppConnectionReferencesGet-AdminPowerAppConnectionReferences
    Set-AdminPowerAppAsFeaturedSet-AdminPowerAppAsFeatured
    Clear-AdminPowerAppAsFeaturedClear-AdminPowerAppAsFeatured
    Set-AdminPowerAppAsHeroSet-AdminPowerAppAsHero
    Clear-AdminPowerAppAsHeroClear-AdminPowerAppAsHero
    Set-AdminPowerAppApisToBypassConsentSet-AdminPowerAppApisToBypassConsent
    Clear-AdminPowerAppApisToBypassConsentClear-AdminPowerAppApisToBypassConsent
    Remove-AdminFlowApprovalsRemove-AdminFlowApprovals
4.04.0 15/08/201808/15/2018 Paramètre facultatif ajouté à New-AdminPowerAppCdsDatabase pour rendre la fonction synchrone, par défaut (autrement dit, aucune donnée n’est retournée tant que la base de données n’est pas correctement provisionnée)Added an optional parameter to the New-AdminPowerAppCdsDatabase to make the function synchronous, by default (i.e. it will not return until the database is successfully provisioned)
5.05.0 24/08/201808/24/2018 Résolution d’un problème, où les applets de commande d’administration Flow ne retournaient pas de données pour certains utilisateurs, en se basant sur leurs paramètres de sécuritéFixed an issue where the Flow admin cdmlets where not returning data for some using based on their security settings

Des questions ?Questions?

Si vous avez des commentaires, des suggestions ou des questions, envoyez-les au forum communautaire d’administration PowerApps.If you have any comments, suggestions, or questions, post them on the Administering PowerApps community board.