### Install AzCopy to Default Path Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Invoke-BapInstallAzCopy This example demonstrates how to install AzCopy using the default download URL and installation path. ```powershell Invoke-BapInstallAzCopy ``` -------------------------------- ### Get Examples for a Command Source: https://github.com/d365collaborative/d365bap.tools/blob/development/README.md Retrieves all available examples for a specified PowerShell command. This is helpful for understanding how to use the command in practice. ```powershell Get-Help Get-BapEnvironment -Examples ``` -------------------------------- ### Start Publish All Customizations Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Invoke-PpePublishAllCustomizations This example demonstrates how to start the publish all customizations process for a specific Power Platform environment using its ID. It will fail if any internal errors occur during the process. ```powershell Invoke-PpePublishAllCustomizations -EnvironmentId "eec2c11a-a4c7-4e1d-b8ed-f62acc9c74c6" ``` -------------------------------- ### Invoke-BapEnvironmentInstallD365App Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Invoke-BapEnvironmentInstallD365App Installs one or more D365 Apps in a specified environment and monitors their installation status. ```APIDOC ## Invoke-BapEnvironmentInstallD365App ### Description Installs one or more Dynamics 365 applications in a specified environment. The cmdlet continuously checks the status of all initiated installations every 60 seconds until they are no longer in a 'Running' state. ### Syntax ```powershell Invoke-BapEnvironmentInstallD365App -EnvironmentId -PackageId [-ProgressAction ] [] ``` ### Parameters #### Path Parameters - **EnvironmentId** (String) - Required - The ID of the D365 environment where the app will be installed. - **PackageId** (String[]) - Required - An array of Package IDs for the D365 Apps to be installed. #### Common Parameters - **ProgressAction** (ActionPreference) - Optional - Specifies how to display progress information. - **** - Optional - Includes standard PowerShell parameters like Verbose, Debug, ErrorAction, etc. ### Examples #### Example 1: Install specific D365 Apps ```powershell Invoke-BapEnvironmentInstallD365App -EnvironmentId eec2c11a-a4c7-4e1d-b8ed-f62acc9c74c6 -PackageId 'be69fc64-7393-4c3c-8908-2a1c2e53aef9','6defa8de-87f9-4478-8f9a-a7d685394e24' ``` This command installs two D365 Apps using their respective IDs and monitors the installation progress until completion. #### Example 2: Install D365 Apps with pending updates ```powershell $appIds = @(Get-BapEnvironmentD365App -EnvironmentId eec2c11a-a4c7-4e1d-b8ed-f62acc9c74c6 -InstallState Installed -UpdatesOnly | Select-Object -ExpandProperty PpacD365AppId) Invoke-BapEnvironmentInstallD365App -EnvironmentId eec2c11a-a4c7-4e1d-b8ed-f62acc9c74c6 -PackageId $appIds ``` This command first retrieves the IDs of D365 Apps with pending updates and then installs them, monitoring the progress. ### Sample Output (Install initialized) ``` status createdDateTime lastActionDateTime error statusMessage operationId ------ --------------- ------------------ ----- ------------- ----------- Running 02/03/2024 13.42.07 02/03/2024 13.42.16 5c80df7f-d89e-42bd-abeb-98e577ae49f4 Running 02/03/2024 13.42.09 02/03/2024 13.42.12 6885e0f4-639f-4ebc-b21e-49ce5d5e920d ``` ### Sample Output (Partly succeeded installation) ``` status createdDateTime lastActionDateTime error statusMessage operationId ------ --------------- ------------------ ----- ------------- ----------- Succeeded 02/03/2024 13.42.07 02/03/2024 13.44.48 5c80df7f-d89e-42bd-abeb-98e577ae49f4 Running 02/03/2024 13.42.09 02/03/2024 13.45.55 6885e0f4-639f-4ebc-b21e-49ce5d5e920d ``` ### Sample Output (Completely succeeded installation) ``` status createdDateTime lastActionDateTime error statusMessage operationId ------ --------------- ------------------ ----- ------------- ----------- Succeeded 02/03/2024 13.42.07 02/03/2024 13.44.48 5c80df7f-d89e-42bd-abeb-98e577ae49f4 Succeeded 02/03/2024 13.42.09 02/03/2024 13.48.26 6885e0f4-639f-4ebc-b21e-49ce5d5e920d ``` ``` -------------------------------- ### Start SSMS with Default Version Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Start-UdeDbSsms Starts SSMS version 20 and connects to the database using JIT credentials for the ID 'demo'. Ensure JIT credentials are set using Set-UdeDbJitCache prior to execution. ```powershell Start-UdeDbSsms -Id "demo" ``` -------------------------------- ### Start SSMS with Specific Version Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Start-UdeDbSsms Starts SSMS version 21 and connects to the database using JIT credentials for the ID 'demo'. Ensure JIT credentials are set using Set-UdeDbJitCache prior to execution. ```powershell Start-UdeDbSsms -Id "demo" -Version 21 ``` -------------------------------- ### Invoke-FscmRestService - Basic GET Request Source: https://github.com/d365collaborative/d365bap.tools/blob/development/docs/Invoke-FscmRestService.md This example demonstrates calling a service operation using the default GET method without a payload. Ensure the EnvironmentId and Endpoint are correctly specified. ```powershell Invoke-FscmRestService -EnvironmentId "eec2c631-a74f-4f7c-b5a4-67d0ee4c0b3c" -Endpoint "MyServiceGroup/MyService/GetData" ``` -------------------------------- ### Enable a User Source: https://github.com/d365collaborative/d365bap.tools/blob/development/docs/Set-FscmUser.md This example demonstrates how to enable a specific user in a Finance and Operations environment using their email address. ```powershell Set-FscmUser -EnvironmentId "env-123" -User "alice@contoso.com" -State Enabled ``` -------------------------------- ### Install D365 Apps by Package ID Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Invoke-BapEnvironmentInstallD365App Installs two D365 Apps using their specific Package IDs. The cmdlet monitors the installation progress until completion. ```powershell Invoke-BapEnvironmentInstallD365App -EnvironmentId eec2c11a-a4c7-4e1d-b8ed-f62acc9c74c6 -PackageId 'be69fc64-7393-4c3c-8908-2a1c2e53aef9','6defa8de-87f9-4478-8f9a-a7d685394e24' ``` -------------------------------- ### Install Available D365 App Updates Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-BapEnvironmentD365App Queries for D365 Apps with available updates, collects their PackageIds, and then invokes the installation process using Invoke-BapEnvironmentInstallD365App. ```powershell $appIds = @(Get-BapEnvironmentD365App -EnvironmentId *test* -UpdatesOnly | Select-Object -ExpandProperty PpacD365AppId) PS C:\> Invoke-BapEnvironmentInstallD365App -EnvironmentId *test* -D365AppId $appIds ``` -------------------------------- ### Get All D365 Apps in an Environment Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-BapEnvironmentD365App Queries the specified environment for all available D365 Apps. Outputs installed or failed apps and indicates if an update is available. ```powershell Get-BapEnvironmentD365App -EnvironmentId eec2c11a-a4c7-4e1d-b8ed-f62acc9c74c6 ``` -------------------------------- ### Invoke-PpacD365AppInstall Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Invoke-PpacD365AppInstall Installs a specified D365 application in the target environment. ```APIDOC ## Invoke-PpacD365AppInstall ### Description Installs D365 applications in the environment. ### Syntax ```powershell Invoke-PpacD365AppInstall -EnvironmentId -D365App [-ProgressAction ] ``` ### Parameters #### Path Parameters * **-EnvironmentId** (String) - Required - The id of the environment that you want to work against. * **-D365App** (String[]) - Required - The name, unique name or package name of the D365 application you want to install in the environment. Supports single or multiple application names. #### Optional Parameters * **-ProgressAction** (ActionPreference) - Optional - {{ Fill ProgressAction Description }} ### Examples #### Example 1 ```powershell Invoke-PpacD365AppInstall -EnvironmentId "eec2c11a-a4c7-4e1d-b8ed-f62acc9c74c6" -D365App "Invoice Capture for Dynamics 365 Finance" ``` This will install the "Invoice Capture for Dynamics 365 Finance" application in the environment. #### Example 2 ```powershell Invoke-PpacD365AppInstall -EnvironmentId "eec2c11a-a4c7-4e1d-b8ed-f62acc9c74c6" -D365App "msdyn_FnoInvoiceCaptureAnchor" ``` This will install the "Invoice Capture for Dynamics 365 Finance" application in the environment. It will use the unique name of the application (msdyn_FnoInvoiceCaptureAnchor) to find the application and install it. #### Example 3 ```powershell Invoke-PpacD365AppInstall -EnvironmentId "eec2c11a-a4c7-4e1d-b8ed-f62acc9c74c6" -D365App "MicrosoftOperationsVEAnchor","msdyn_FnoInvoiceCaptureAnchor" ``` This will install the "Microsoft Operations VE" and "Invoice Capture for Dynamics 365 Finance" applications in the environment. It will use the unique name of the D365 applications to find the applications and install them. It will start the installation of both applications, and then wait for the installation process to finish. ``` -------------------------------- ### Confirm Visual Studio 2022 Installation (Latest) Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Confirm-UdeVs2022Installation Checks for Visual Studio 2022 installation and prepares prerequisite files using the latest online configuration. Use this command to ensure you have the most up-to-date configuration files. ```powershell Confirm-UdeVs2022Installation -Latest ``` -------------------------------- ### Confirm Visual Studio 2022 Installation (Default) Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Confirm-UdeVs2022Installation Checks for Visual Studio 2022 installation and prepares prerequisite files using bundled configuration. Use this command for a standard check. ```powershell Confirm-UdeVs2022Installation ``` -------------------------------- ### Install d365bap.tools Module for Current User Source: https://github.com/d365collaborative/d365bap.tools/blob/development/README.md Installs the d365bap.tools module for the current user only, without requiring administrator privileges. This is useful for user-specific installations. ```PowerShell Install-Module -Name d365bap.tools -Scope CurrentUser ``` -------------------------------- ### Install D365 Apps with Updates Only Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Invoke-BapEnvironmentInstallD365App This snippet installs D365 Apps that have pending updates. It first retrieves the IDs of apps with updates and then initiates the installation process. ```powershell $apps = @(Get-BapEnvironmentD365App -EnvironmentId eec2c11a-a4c7-4e1d-b8ed-f62acc9c74c6 -InstallState Installed -UpdatesOnly) PS C:\> Invoke-BapEnvironmentInstallD365App -EnvironmentId eec2c11a-a4c7-4e1d-b8ed-f62acc9c74c6 -PackageId $apps.PpacD365AppId ``` -------------------------------- ### Install a Single D365 Application by Display Name Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Invoke-PpacD365AppInstall Installs a specific D365 application using its display name. Ensure the application name is accurate as it appears in PPAC. ```powershell Invoke-PpacD365AppInstall -EnvironmentId "eec2c11a-a4c7-4e1d-b8ed-f62acc9c74c6" -D365App "Invoice Capture for Dynamics 365 Finance" ``` -------------------------------- ### Enable Multiple Users Source: https://github.com/d365collaborative/d365bap.tools/blob/development/docs/Set-FscmUser.md This example illustrates how to enable multiple users simultaneously in a Finance and Operations environment by providing a comma-separated list of User IDs. ```powershell Set-FscmUser -EnvironmentId "env-123" -User "alice","bob" -State Enabled ``` -------------------------------- ### Install d365bap.tools Module Source: https://github.com/d365collaborative/d365bap.tools/blob/development/README.md Installs the latest version of the d365bap.tools module from the PowerShell Gallery. This command requires administrator privileges. ```PowerShell Install-Module -Name d365bap.tools ``` -------------------------------- ### Get Environment and List Users Source: https://github.com/d365collaborative/d365bap.tools/blob/development/learning/notebooks/learn-commands.ipynb Retrieves the first environment's ID and lists the first five users of that environment. Use `-AsExcelOutput` to get the list as an Excel file. ```powershell $environments = Get-BapEnvironment $firstEnvironmentId = $environments[0].EnvId $environmentUsers = Get-PpacUser -EnvironmentId $firstEnvironmentId # Only list the first five users $environmentUsers | Select-Object -First 5 ``` -------------------------------- ### Invoke-FscmRestService - Explicit GET Method Source: https://github.com/d365collaborative/d365bap.tools/blob/development/docs/Invoke-FscmRestService.md This example explicitly sets the Method to 'Get' when calling a service operation. It's useful for clarity or when the default 'Post' might be misinterpreted. ```powershell Invoke-FscmRestService -EnvironmentId "eec2c631-a74f-4f7c-b5a4-67d0ee4c0b3c" -Endpoint "MyServiceGroup/MyService/GetData" -Method Get ``` -------------------------------- ### Get D365 Apps Matching a Name Pattern Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-BapEnvironmentD365App Queries the specified environment for D365 Apps matching a wildcard pattern. Outputs installed or failed apps and indicates if an update is available. ```powershell Get-BapEnvironmentD365App -EnvironmentId *test* ``` -------------------------------- ### Install D365 Apps with Pending Updates Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Invoke-BapEnvironmentInstallD365App Installs D365 Apps that have pending updates. It first retrieves the IDs of apps with updates and then initiates the installation, monitoring its progress. ```powershell $appIds = @(Get-BapEnvironmentD365App -EnvironmentId eec2c11a-a4c7-4e1d-b8ed-f62acc9c74c6 -InstallState Installed -UpdatesOnly | Select-Object -ExpandProperty PpacD365AppId) PS C:\> Invoke-BapEnvironmentInstallD365App -EnvironmentId eec2c11a-a4c7-4e1d-b8ed-f62acc9c74c6 -PackageId $appIds ``` -------------------------------- ### Retrieve all UDE Configurations Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-UdeConfig Use this command to get a list of all available UDE configurations. ```powershell Get-UdeConfig ``` -------------------------------- ### Get Full Help for a Command Source: https://github.com/d365collaborative/d365bap.tools/blob/development/README.md Retrieves all available help content for a specified PowerShell command. This includes detailed explanations, parameters, and syntax. ```powershell Get-Help Get-BapEnvironment -Full ``` -------------------------------- ### List D365 Apps in Environment Source: https://github.com/d365collaborative/d365bap.tools/blob/development/learning/notebooks/learn-commands.ipynb Use `Get-BapEnvironmentD365App` to list all solutions and Dynamics 365 business applications installed in an environment. Requires the environment ID. ```powershell Get-BapEnvironmentD365App -EnvironmentId $firstEnvironmentId ``` -------------------------------- ### Install Multiple D365 Applications by Unique Name Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Invoke-PpacD365AppInstall Installs multiple D365 applications simultaneously using their unique internal names. The cmdlet will initiate installations for all specified applications and wait for them to complete. ```powershell Invoke-PpacD365AppInstall -EnvironmentId "eec2c11a-a4c7-4e1d-b8ed-f62acc9c74c6" -D365App "MicrosoftOperationsVEAnchor","msdyn_FnoInvoiceCaptureAnchor" ``` -------------------------------- ### Compare D365 Apps Between Environments Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Compare-BapEnvironmentD365App Compares all installed D365 Apps from the source environment against the destination environment. This is the baseline comparison. ```powershell Compare-BapEnvironmentD365App -SourceEnvironmentId *uat* -DestinationEnvironmentId *test* ``` -------------------------------- ### Install App Update Source: https://github.com/d365collaborative/d365bap.tools/blob/development/learning/notebooks/install-appupdates.ipynb Install a specific app update in a Dynamics 365 environment using its ID and the package ID of the update. This command initiates the update process. ```powershell Invoke-BapEnvironmentInstallD365App -EnvironmentId $environments[0].Id -PackageId $appIds[0] ``` -------------------------------- ### Retrieve All Environments Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-BapEnvironment Use this command to get a list of all Power Platform environments within your tenant. ```powershell Get-BapEnvironment ``` -------------------------------- ### Query D365 Apps with Install Failed Status Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-BapEnvironmentD365App Queries the environment for D365 Apps that are in a failed installation state. Outputs all available details for these apps. ```powershell Get-BapEnvironmentD365App -EnvironmentId *test* -Status InstallFailed ``` -------------------------------- ### Install a Single D365 Application by Unique Name Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Invoke-PpacD365AppInstall Installs a D365 application using its unique internal name. This is useful when the display name is not known or to ensure the correct application is targeted. ```powershell Invoke-PpacD365AppInstall -EnvironmentId "eec2c11a-a4c7-4e1d-b8ed-f62acc9c74c6" -D365App "msdyn_FnoInvoiceCaptureAnchor" ``` -------------------------------- ### Create UDE with Custom Domain Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/New-UnifiedEnvironment Deploys a new Unified Developer Environment (UDE) with a specified custom domain name. It includes a demo database by default and installs the latest Finance and Operations version without restricting access. ```powershell New-UnifiedEnvironment -Type "UDE" -Name "MyUdeEnv" -Location "Europe" -CustomDomainName "myudeenv" ``` -------------------------------- ### Assign a User to Multiple Security Roles Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Add-PpacSecurityRoleMember This example demonstrates how to assign a user to multiple security roles simultaneously. Provide a comma-separated list of role names for the -Role parameter. ```powershell Add-PpacSecurityRoleMember -EnvironmentId "env-123" -User "alice@contoso.com" -Role "System Customizer", "Environment Maker" ``` -------------------------------- ### Retrieve JIT Database Access Credentials Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-UdeDbJitCache This example shows how to retrieve JIT database access credentials for a specific ID. Ensure the ID exists in the local cache. ```powershell Get-UdeDbJitCache -Id "demo" ``` -------------------------------- ### Compare Solutions Between Two Environments Source: https://github.com/d365collaborative/d365bap.tools/blob/development/learning/notebooks/learn-commands.ipynb Compares the solutions (D365 Apps) installed in two environments, highlighting only the differences. This helps in managing and synchronizing application versions across environments. ```powershell Compare-BapEnvironmentD365App -SourceEnvironmentId $environments[0].EnvId -DestinationEnvironmentId $environments[1].EnvId -ShowDiffOnly ``` -------------------------------- ### Retrieve All Deployment Locations Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-PpacDeployLocation Use this command to get a list of all available deployment locations for Power Platform environments. ```powershell Get-PpacDeployLocation ``` -------------------------------- ### Set UDE Configuration via Piped Environment ID Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Set-UdeConfig This example demonstrates setting UDE configuration by piping the environment object obtained from Get-UnifiedEnvironment. It uses the environment's default packages version. ```powershell Get-UnifiedEnvironment -EnvironmentId "env-123" | Set-UdeConfig -Path "C:\CustomSourceCode" ``` -------------------------------- ### Invoke D365 Platform Update Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Invoke-PpacD365PlatformUpdate Queues the update or installation of a specific D365 Platform version for a given environment. ```powershell Invoke-PpacD365PlatformUpdate -EnvironmentId "env-123" -Version "10.0.45.4" ``` -------------------------------- ### List D365 Environments with a Specific App Source: https://github.com/d365collaborative/d365bap.tools/blob/development/learning/notebooks/learn-commands.ipynb This Python snippet is a placeholder for exploring how to list D365 environments that have a specific application installed. It is intended for experimental use. ```python # How about listing all the environments that have a specific D365 app installed? ``` -------------------------------- ### Get Only Installed D365 Apps Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-BapEnvironmentD365App Queries the specified environment for only installed D365 Apps. Outputs installed or failed apps and indicates if an update is available. ```powershell Get-BapEnvironmentD365App -EnvironmentId *test* -Status Installed ``` -------------------------------- ### Compare D365 Apps and Output to Excel Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Compare-BapEnvironmentD365App Compares all installed D365 Apps and exports the detailed comparison results to an Excel file, which will automatically open after generation. ```powershell Compare-BapEnvironmentD365App -SourceEnvironmentId *uat* -DestinationEnvironmentId *test* -AsExcelOutput ``` -------------------------------- ### Retrieve All UDE Environment Packages Source: https://github.com/d365collaborative/d365bap.tools/blob/development/docs/Get-UnifiedEnvironmentPackage.md Use this command to get all UDE environment packages for a given environment ID. Ensure you have the correct environment ID. ```powershell Get-UnifiedEnvironmentPackage -EnvironmentId "env-123" ``` -------------------------------- ### Get PowerApps and Export to Excel Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-BapEnvironmentPowerApp Retrieves all available PowerApps from the specified environment and exports the details directly to an Excel file, which will automatically open. ```powershell Get-BapEnvironmentPowerApp -EnvironmentId *uat* -AsExcelOutput ``` -------------------------------- ### Enable Change Tracking for Virtual Entity Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Set-BapEnvironmentVirtualEntity This example enables change tracking for the specified virtual entity. Use this when you need to track modifications made to the virtual entity's data. ```powershell Set-BapEnvironmentVirtualEntity -EnvironmentId eec2c11a-a4c7-4e1d-b8ed-f62acc9c74c6 -Name AccountantEntity -TrackingOn ``` -------------------------------- ### Get Default Help for a Command Source: https://github.com/d365collaborative/d365bap.tools/blob/development/README.md Retrieves the default help information for a specified PowerShell command. This is useful for a quick overview of the command's functionality. ```powershell Get-Help Get-BapEnvironment ``` -------------------------------- ### Get JIT Database Access Information with Whitelisted IP Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-UdeDbJit Retrieves JIT database access information for a specified environment ID, whitelisting a specific IP address. It assigns the 'Reader' role and uses the default reason. ```powershell Get-UdeDbJit -EnvironmentId "env-123" -WhitelistIp "85.168.174.10" ``` -------------------------------- ### Authenticate Azure Account Source: https://github.com/d365collaborative/d365bap.tools/blob/development/learning/notebooks/confirm-integration.ipynb Use this command to authenticate your Azure account using device authentication. Review the 'Get started' notebook for more details on authentication. ```powershell Connect-AzAccount -UseDeviceAuthentication ``` -------------------------------- ### Learn about a PowerShell Cmdlet Source: https://github.com/d365collaborative/d365bap.tools/blob/development/learning/notebooks/learn-commands.ipynb Use the Get-Help cmdlet to learn more about a specific cmdlet's syntax, description, and related links. This is useful for understanding how to use a cmdlet effectively. ```powershell Get-Help Get-PpacUser ``` -------------------------------- ### Get Apps with Available Updates Source: https://github.com/d365collaborative/d365bap.tools/blob/development/learning/notebooks/install-appupdates.ipynb Retrieve a list of installed apps in an environment that have updates available. This snippet outputs the first app ID found to confirm an update exists. ```powershell $environments = Get-BapEnvironment $appIds = @(Get-BapEnvironmentD365App -EnvironmentId $environments[0].EnvId -Status Installed -UpdatesOnly | Select-Object -ExpandProperty PpacD365AppId) $appIds[0] # Output the first app id that has an update available to make sure there is at least one ``` -------------------------------- ### Create USE without Demo Database Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/New-UnifiedEnvironment Creates a new Unified Sandbox Environment (USE) without a demo database. It uses a default domain name, deploys the latest Finance and Operations version, and does not restrict access. ```powershell New-UnifiedEnvironment -Type "USE" -Name "MyUseEnv" -Location "Europe" -NoDemoDb ``` -------------------------------- ### Retrieve Latest Extension History Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-UdeVsPowerPlatformExtensionHistory Use this command to get the most recent UDE VS Power Platform extension history entry from the local logs. No special setup is required. ```powershell Get-UdeVsPowerPlatformExtensionHistory ``` -------------------------------- ### Query D365 Apps with Available Updates Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-BapEnvironmentD365App Queries the environment for all D365 Apps and filters the output to only include those with available updates. Compares available vs installed apps. ```powershell Get-BapEnvironmentD365App -EnvironmentId *test* -UpdatesOnly ``` -------------------------------- ### Create UDE with Default Settings Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/New-UnifiedEnvironment Creates a new Unified Developer Environment (UDE) with a default demo database and auto-assigned domain name in the specified location. It deploys the latest Finance and Operations version and does not restrict access. ```powershell New-UnifiedEnvironment -Type "UDE" -Name "MyUdeEnv" -Location "Europe" ``` -------------------------------- ### Fetch All Solutions from Environment Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-PpeSolution Use this command to retrieve all solutions present in a specified Power Platform environment. Ensure you provide a valid EnvironmentId. ```powershell Get-PpeSolution -EnvironmentId eec2c11a-a4c7-4e1d-b8ed-f62acc9c74c6 ``` -------------------------------- ### Fetch Solutions by Name Pattern Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-PpeSolution This command fetches solutions from a Power Platform environment that match a specified name pattern. Wildcards are supported and will be resolved according to Microsoft's best practices. ```powershell Get-PpeSolution -EnvironmentId eec2c11a-a4c7-4e1d-b8ed-f62acc9c74c6 -Name "*invoice*" ``` -------------------------------- ### Fetch All Solutions and Export to Excel Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-PpeSolution This command retrieves all solutions from a Power Platform environment and directly outputs the results into an Excel file for detailed analysis and persistence. ```powershell Get-PpeSolution -EnvironmentId eec2c11a-a4c7-4e1d-b8ed-f62acc9c74c6 -AsExcelOutput ``` -------------------------------- ### Set Tenant Details using a Hash Table Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Set-BapTenantDetail This snippet demonstrates how to set tenant details by first retrieving existing tenant information into a hash table using Get-BapTenant, and then passing that hash table to Set-BapTenantDetail. This is useful for updating details based on existing configurations. ```powershell $detailsHash = Get-BapTenant -TenantId "12345678-1234-1234-1234-123456789012" -AsHashTable PS C:\> Set-BapTenantDetail -Id "Contoso" @detailsHash ``` -------------------------------- ### Create Users and Remap Existing Users Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Add-FscmUserFromSecurityGroup This example shows how to create users from an Entra Security Group, assign them a role, and crucially, remap any existing users that are not found by UPN but share a UserId. This ensures all members are accounted for and assigned the correct role. ```powershell Add-FscmUserFromSecurityGroup -EnvironmentId "env-123" -SecurityGroup "Contoso Sales Team" -Role "Sales Clerk" -RemapExisting ``` -------------------------------- ### Create UDE with Specific Version Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/New-UnifiedEnvironment Deploys a new Unified Developer Environment (UDE) with a specified version of Finance and Operations. It includes a demo database by default and uses an auto-assigned domain name without access restrictions. ```powershell New-UnifiedEnvironment -Type "UDE" -Name "MyUdeEnv" -Location "Europe" -Version "10.0.44" ``` -------------------------------- ### Add a Security Group as a Power Platform Team with Specific Admin Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Add-PpacTeamOnSecurityGroup This example shows how to add a Microsoft Entra ID security group as a team, similar to the previous example, but explicitly sets a specific user's email as the team administrator. This is useful when the default administrator (the cmdlet user) is not desired. ```powershell Add-PpacTeamOnSecurityGroup -EnvironmentId "env-123" -Name "Contoso Sales Team" -SecurityGroup "Contoso Sales Security Group" -MembershipType "Members and Guests" -Role "System Customizer" -TeamAdmin "admin@contoso.com" ``` -------------------------------- ### Fetch All Solution History Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-PpeSolutionHistory Use this command to retrieve the history of all solutions within a specified Power Platform environment. ```powershell Get-PpeSolutionHistory -EnvironmentId eec2c11a-a4c7-4e1d-b8ed-f62acc9c74c6 ``` -------------------------------- ### Get Specific FscmUser by Name Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-FscmUser Retrieves a specific Finance and Operations user by their username from a given environment. ```powershell Get-FscmUser -EnvironmentId "ContosoEnv" -User "john.doe" ``` -------------------------------- ### Download UDE Developer Files Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-UdeDeveloperFile Downloads UDE developer files for a specified environment ID to the default path. Use the -Download switch to initiate the download. ```powershell Get-UdeDeveloperFile -EnvironmentId "env-123" -Download ``` -------------------------------- ### Get Group Members by ObjectId Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-GraphGroupMember Use this command to retrieve members of a Security Group by providing its unique ObjectId. ```powershell Get-GraphGroupMember -Group "12345678-90ab-cdef-1234-567890abcdef" ``` -------------------------------- ### Get JIT Database Access Information with Custom Reason Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-UdeDbJit Retrieves JIT database access information for a specified environment ID, using a custom reason for access. It whitelists the public IP address and assigns the 'Reader' role. ```powershell Get-UdeDbJit -EnvironmentId "env-123" -Reason "Needed for data migration" ``` -------------------------------- ### Disable a User by User ID Source: https://github.com/d365collaborative/d365bap.tools/blob/development/docs/Set-FscmUser.md This example shows how to disable a user in a Finance and Operations environment using their User ID. ```powershell Set-FscmUser -EnvironmentId "env-123" -User "alice" -State Disabled ``` -------------------------------- ### Disable Virtual Entity Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Set-BapEnvironmentVirtualEntity This example disables the specified virtual entity. Use this when the virtual entity is no longer needed or should not be accessible. ```powershell Set-BapEnvironmentVirtualEntity -EnvironmentId eec2c11a-a4c7-4e1d-b8ed-f62acc9c74c6 -Name AccountantEntity -VisibilityOff ``` -------------------------------- ### Open UDE VS Package Deploy Folder Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-UdeVsPackageDeploy The -OpenFolder parameter launches File Explorer directly to the directory containing the UDE VS package deploys. This provides quick access to the deployment files. ```powershell Get-UdeVsPackageDeploy -OpenFolder ``` -------------------------------- ### Get Only Non-Installed D365 Apps Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-BapEnvironmentD365App Queries the specified environment for only non-installed D365 Apps. Outputs all available details for these apps. ```powershell Get-BapEnvironmentD365App -EnvironmentId *test* -Status None ``` -------------------------------- ### Retrieve All Application Users Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-PpacApplicationUser Use this command to get a list of all application users within a specified Power Platform environment. ```powershell Get-PpacApplicationUser -EnvironmentId "env-123" ``` -------------------------------- ### Retrieve All UDE VS Package Deploys Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-UdeVsPackageDeploy Use the -All parameter to retrieve all available UDE VS package deploys stored in the local temporary folder. This is useful for reviewing historical deployments. ```powershell Get-UdeVsPackageDeploy -All ``` -------------------------------- ### Get All FscmUsers Including Microsoft Accounts Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-FscmUser Retrieves all Finance and Operations users, including Microsoft accounts, from a specified environment. ```powershell Get-FscmUser -EnvironmentId "ContosoEnv" -IncludeMicrosoftAccounts ``` -------------------------------- ### Get Enterprise Policy Information Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-BapEnvironmentLinkEnterprisePolicy Retrieves all Enterprise Policy information from a specified Dataverse environment. This is the default output format. ```powershell Get-BapEnvironmentLinkEnterprisePolicy -EnvironmentId eec2c11a-a4c7-4e1d-b8ed-f62acc9c74c6 ``` -------------------------------- ### Add User and Remap Existing Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Add-FscmUser Adds a user to the environment and remaps any existing user with the same UserId to the new UPN. Assigns the default 'System user' role. ```powershell Add-FscmUser -EnvironmentId "ContosoEnv" -User "john.doe" -RemapExisting ``` -------------------------------- ### Get All PowerApps from Environment Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-BapEnvironmentPowerApp Retrieves all available Canvas and Model-driven PowerApps from the specified environment. Supports wildcard characters for the EnvironmentId. ```powershell Get-BapEnvironmentPowerApp -EnvironmentId *uat* ``` -------------------------------- ### Preview Orphaned UDE Configurations Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Clear-UdeOrphanedConfig Use this command to list orphaned UDE configurations (XppConfig directories and XRef databases) without removing them. This allows for a review before any changes are made. ```powershell Clear-UdeOrphanedConfig ``` -------------------------------- ### EnvironmentId Parameter Source: https://github.com/d365collaborative/d365bap.tools/blob/development/docs/Get-FscmOdata.md Specifies the ID of the environment to query. Accepts environment name, GUID (PPAC), or LCS environment ID. ```yaml Type: String Parameter Sets: (All) Aliases: Required: True Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -------------------------------- ### Retrieve Unified Environments Without Version Details Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-UnifiedEnvironment This command retrieves all UDE/USE environments but skips version details for faster execution. ```powershell Get-UnifiedEnvironment -SkipVersionDetails ``` -------------------------------- ### Get Specific FscmUser by UPN Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-FscmUser Retrieves a specific Finance and Operations user by their User Principal Name (UPN) from a given environment. ```powershell Get-FscmUser -EnvironmentId "ContosoEnv" -User "john@contoso.com" ``` -------------------------------- ### Retrieve All Environment Operations Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-BapEnvironmentOperation Use this command to get all life cycle operations for a specified environment ID. Ensure the EnvironmentId is provided. ```powershell Get-BapEnvironmentOperation -EnvironmentId "env-123" ``` -------------------------------- ### Retrieve All Unified Environments Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-UnifiedEnvironment This command retrieves all available Unified Environments (UDE/USE). ```powershell Get-UnifiedEnvironment ``` -------------------------------- ### Retrieve a specific security role Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-FscmSecurityRole Use this command to get details for a single security role by its exact name in a specified environment. ```powershell Get-FscmSecurityRole -EnvironmentId "ContosoEnv" -Name "System Administrator" ``` -------------------------------- ### Retrieve the Active UDE Configuration Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-UdeConfig Use this command to get only the currently active UDE configuration. This is useful for quickly identifying the environment in use. ```powershell Get-UdeConfig -Active ``` -------------------------------- ### Preview Orphaned UDE Configurations Including Packages Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Clear-UdeOrphanedConfig This command lists orphaned UDE configurations along with their package directories. It does not perform any removal, serving as a preview for a more comprehensive cleanup. ```powershell Clear-UdeOrphanedConfig -IncludePackages ``` -------------------------------- ### Retrieve All D365 Platform Updates Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-PpacD365PlatformUpdate Use this command to get all available D365 platform updates for a given environment. Ensure you have the correct EnvironmentId. ```powershell Get-PpacD365PlatformUpdate -EnvironmentId "eec2c11a-a4c7-4e1d-b8ed-f62acc9c74c6" ``` -------------------------------- ### Retrieve All Members of a Security Role Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-PpacSecurityRoleMember Use this command to get all members of a specified security role within an environment. The results are displayed in the console. ```powershell Get-FscmSecurityRoleMember -EnvironmentId "ContosoEnv" -Role "System Customizer" ``` -------------------------------- ### Fetch Solution History by Name Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-PpeSolutionHistory Use this command to retrieve the history of solutions that match a specific name pattern within a Power Platform environment. Wildcards are supported. ```powershell Get-PpeSolutionHistory -EnvironmentId eec2c11a-a4c7-4e1d-b8ed-f62acc9c74c6 -Name "*invoice*" ``` -------------------------------- ### Download Operation Logs Source: https://github.com/d365collaborative/d365bap.tools/wiki/docs/Get-PpacD365OperationHistory Use the -DownloadLog switch to attempt downloading operation logs for each entry in the history to the default path. ```powershell Get-PpacD365OperationHistory -EnvironmentId "eec2a-a4c7-4e1d-b8ed-f62acc9c74c6" -DownloadLog ```