#Requires -Version 7.0 # PIM Manager 3.0.70 -- Start-PimManagerInstall.ps1, standalone (built by tools/setup/Build-PimSupportScripts.ps1; helpers inlined: _pimscriptdoc.ps1, _piminstallpropackage.ps1, ../../engine/_shared/invardiaupdate.verify.ps1, _pimloopbackanswer.ps1) # BUILD-NO-OPTIONAL-LOADS <# .SYNOPSIS Install PIM Manager with one command: download the public PIM Manager release into a new folder, check the download, and run its guided installer (Install-PimManager) with the parameters you give. Two short lines: line 1 downloads this file from the public release, line 2 runs the install with your values. .DESCRIPTION The ONE file a person downloads to install PIM Manager. It is a file of the public PIM Manager release on GitHub: line 1 downloads it, line 2 runs it with your values (see the examples). It: 1. checks that this file is the one published with its release -- a difference stops here, nothing is installed; 2. reads the public release from GitHub (the latest, or -Version), and downloads its zip into a NEW, empty folder in the temp folder; 3. checks the download against the release -- a difference stops here, the folder is removed and nothing is installed; 4. unpacks it and runs tools/setup/Install-PimManager.ps1 FROM that folder with exactly the parameters you gave (the same parameters as Install-PimManager; its help has the details), and ends with its exit code; 5. prints where the files are. -Resume uses that folder again (no new download) only when it holds the SAME edition and the same version this copy installs now; the folder is remembered per tenant and subscription in the temp folder. When it is gone (a new Cloud Shell session), or holds another edition or version, -Resume says so in one line and downloads the release again -- the installation's own progress is kept in its state folder, so it still continues where it stopped. -ReleasePath runs the installer from a release you already have (nothing is downloaded). The copy Invardia gives Pro and trial customers does steps 2-3 with Invardia instead of GitHub: you sign in in the browser (an administrator of -TenantId), it asks Invardia for the PIM Manager Pro package of your update ring for that tenant, checks that Invardia sealed it (its signed manifest) and the download's size and SHA-256 against it, and then runs the installer from it the same way. If Invardia cannot be reached or refuses, it says so in one line and installs nothing -- it never falls back to GitHub. Browser sign-in (your own administrator account): no Azure CLI, no PowerShell modules, no secret, no certificate, no key and no licence in the command. PowerShell 7 (Azure Cloud Shell, or PowerShell 7 on Windows, macOS or Linux). Only -TenantId and -SubscriptionId are needed. The edition comes with the file, never with a parameter: the copy of the public GitHub release installs PIM Manager Community (free); the copy Invardia gives Pro and trial customers installs PIM Manager Pro, without a licence -- the installation asks Invardia for its licence by itself right after the install. Updates follow ring 3 (broad) unless -UpdateRing 2 is given. The Invardia Support app is named by its id with -SupportAppId, never found by name: it then gets 'troubleshoot' access unless -SupportAccess names another level; without -SupportAppId nothing is granted. -ViaSupportApp runs the install as the Invardia Support app: it needs a Connect-InvardiaSupport session for the same tenant in this PowerShell window. Several tenants (MSP) are set up with the managing-tenant build, not this command. Public network by default; -PrivateNetwork installs the private shape (no public address) with the same two lines, with SI's network parameters (-VnetId, -VnetAddressPrefix, -VnetName, -AppsSubnetName / -AppsSubnetPrefix, -EndpointsSubnetName / -EndpointsSubnetPrefix, -PrivateDnsZonesResourceGroupId, -HubVnetId with -PeerToHub / -LinkZonesToHub, -InternalRanges with -FirewallIp for the return route behind a hub firewall, -WebAppAccess); Install-PimManager's help has the details. Exit codes: those of Install-PimManager (0 done, 1 a step failed -- fix it and -Resume, 2 a check failed -- nothing was changed, 3 bad answers -- nothing was changed); 3 also when the release cannot be read or a check of the download fails. .EXAMPLE Invoke-WebRequest https://invardia.com/support/pim/Start-PimManagerInstall.ps1 -OutFile Start-PimManagerInstall.ps1 .\Start-PimManagerInstall.ps1 -TenantId '' -SubscriptionId '' The most common: PIM Manager Pro (or trial) in your own subscription, signed in in the browser, every other answer a default. .EXAMPLE Invoke-WebRequest https://invardia.com/support/pim/Start-PimManagerInstall.ps1 -OutFile Start-PimManagerInstall.ps1 .\Start-PimManagerInstall.ps1 -TenantId '' -SubscriptionId '' -WhatIf To see the plan first: the checks run, then every step the installation would take is printed, and nothing is changed. .EXAMPLE Invoke-WebRequest https://invardia.com/support/pim/Start-PimManagerInstall.ps1 -OutFile Start-PimManagerInstall.ps1 .\Start-PimManagerInstall.ps1 -TenantId '' -SubscriptionId '' -Location westeurope -ResourceGroup rg-pim-manager -SuperAdmins 'admin1@contoso.com','admin2@contoso.com' -AlertRecipients 'pim-alerts@contoso.com' When you choose the region and the resource group yourself, and name the PIM Manager administrators and who gets the alerts. .EXAMPLE Invoke-WebRequest https://invardia.com/support/pim/Start-PimManagerInstall.ps1 -OutFile Start-PimManagerInstall.ps1 .\Start-PimManagerInstall.ps1 -TenantId '' -SubscriptionId '' -SuperAdmins 'admin1@contoso.com' -ViaSupportApp Through the Invardia Support app, after Connect-InvardiaSupport for this tenant: the installation runs as that app, so name the PIM Manager administrators. .EXAMPLE Invoke-WebRequest https://invardia.com/support/pim/Start-PimManagerInstall.ps1 -OutFile Start-PimManagerInstall.ps1 .\Start-PimManagerInstall.ps1 -TenantId '' -SubscriptionId '' -Resume After a stop: run the same command with -Resume; the downloaded release is used again and finished steps are skipped. .NOTES Requirements: PowerShell: 7.0 or later (pwsh; Azure Cloud Shell has it). Windows PowerShell 5.1 is not supported. Role: Owner on the target subscription (Azure); Privileged Role Administrator and Application Administrator (Microsoft Entra); Exchange Administrator only for the mail sender (optional). Hosts: github.com, api.github.com, objects.githubusercontent.com, release-assets.githubusercontent.com (the release); the Pro copy instead: login.microsoftonline.com (your browser sign-in) and invardia.com (the Pro package and the short-lived download link it names); then the installer's: login.microsoftonline.com, management.azure.com, graph.microsoft.com, *.database.windows.net (port 1433), *.azurecr.io, outlook.office365.com (mail sender) PERMISSIONS AND CHANGES (from Start-PimManagerInstall.ps1 manifest, PIM Manager 3.0.70; full page: https://invardia.com/docs/pim/scripts/Start-PimManagerInstall/) The person running it needs: - Owner [azureRbac, the target subscription] -- The installer it runs (Install-PimManager) creates the resource group and its resources and assigns Azure roles to the identities it creates (Contributor + User Access Administrator is the equivalent); its check stops before anything is created without it. - Privileged Role Administrator [entraRole, tenant] -- For the installer: Microsoft Graph application permissions for PIM Manager's identities and the SQL admin group. Without it the installation continues and ends with the command for the right person. - Application Administrator [entraRole, tenant] -- For the installer: the Manager's sign-in app registration (the same as Install-PimManager). - Exchange Administrator (optional) [exchange, Exchange Online] -- For the installer: only for the mail sender (a shared mailbox and its scoped send right). Without it the step is a warning with the command for an Exchange Administrator. - Signed in in the browser as yourself (no command-line tool, no PowerShell module, no secret, no certificate) [other, the tenant and subscription you name] -- The installer signs you in in the browser when it first needs Azure or Microsoft Graph. The Community copy itself reads only public release data and needs no sign-in; the Pro copy signs you in in the browser first (an administrator of -TenantId) to download the PIM Manager Pro package from Invardia for that tenant, and hands that sign-in to the installer. What it creates, changes or grants: - create a new folder in the temp folder (pim-manager-release--) with the downloaded release zip and its unpacked files, and a small note (pim-manager-install-.json in the temp folder) with that folder's path so -Resume uses it again (Local machine) -- The installer runs from the release it was downloaded with; -Resume needs no new download. Undo: Delete the folder and the note. - create the PIM Manager installation, made by Install-PimManager from the downloaded release (every object, permission and scope is listed on its page: https://invardia.com/docs/pim/scripts/Install-PimManager/) (Azure, Microsoft Entra ID, Azure SQL) -- This launcher only fetches the release and starts the installer with your parameters. Undo: As described for Install-PimManager (delete the resource group after exporting the database, and the Entra objects it created). -WhatIf: Downloads and unpacks the release into a new folder in the temp folder (the plan is read from it), then runs Install-PimManager -WhatIf from it: its checks (reads only) and every step it would take. No note is written and nothing in Azure, Microsoft Entra ID or the database is changed. Undo: Delete the release folder and the note in the temp folder; the installation itself is undone as described for Install-PimManager. Reads: the release metadata at api.github.com (public, no sign-in) and the release zip it names (the Pro copy: the signed package answer from invardia.com, with your sign-in, and the zip it names). Writes: a new folder in the temp folder (the zip and its unpacked files) and a small note there with that folder's path; everything else is the installer's (see Install-PimManager). .LINK https://invardia.com/docs/pim/scripts/Start-PimManagerInstall/ #> [CmdletBinding(SupportsShouldProcess)] param( # --- the installer's parameters, passed through unchanged (Install-PimManager has the details) --- [string]$TenantId = '', [string]$SubscriptionId = '', [string]$Location = '', [string]$ResourceGroup = '', [string[]]$SuperAdmins = @(), [string[]]$AlertRecipients = @(), [string]$MailSender = '', [string[]]$PortalUsers = @(), [switch]$AllowAllMembers, [string]$VnetAddressPrefix = '', [Parameter(DontShow)][string]$SubnetAddressPrefix = '', # old name of -AppsSubnetPrefix (one release) [Parameter(DontShow)][string]$Exposure = '', # old name: -Exposure internal = -PrivateNetwork (one release) # --- PRIVATE NETWORK (framework INSTALL-1 item 5): SI's names, passed through unchanged; public without -PrivateNetwork --- [switch]$PrivateNetwork, [string]$VnetId = '', [string]$VnetName = '', [string]$AppsSubnetName = '', [string]$AppsSubnetPrefix = '', [string]$EndpointsSubnetName = '', [string]$EndpointsSubnetPrefix = '', [string]$PrivateDnsZonesResourceGroupId = '', [string]$HubVnetId = '', [switch]$LinkZonesToHub, [switch]$PeerToHub, # framework installer rule 11d (2026-11-04): the return route behind a hub firewall (private only, both or neither) [string[]]$InternalRanges = @(), [string]$FirewallIp = '', [ValidateSet('', 'external', 'internal')][string]$WebAppAccess = '', # INSTALL-1 ALIGN: not documented any more (the copy decides the edition, $script:PimInstallChannel below). Accepted for # ONE release so the 3.0.17 command lines keep working; when given it wins. Drop it in the next release. [ValidateSet('', 'Community', 'Trial', 'Pro')][string]$Edition = '', [ValidateSet('', '2', '3')][string]$UpdateRing = '3', [string]$KeyVaultName = '', [switch]$EngineAzureRootUserAccessAdmin, [string]$InstallId = '', [string]$SupportAppId = '', [ValidateSet('', 'troubleshoot', 'setup', 'asbuilt')][string]$SupportAccess = '', [scriptblock]$Reporter, [string]$StatePath = '', [switch]$Resume, [switch]$PreflightOnly, # run as the Invardia Support app: requires a Connect-InvardiaSupport session for -TenantId in this PowerShell window [switch]$ViaSupportApp, # --- this launcher's own --- # the release to install (e.g. 3.0.5); default: the latest public release [string]$Version = '', # a folder that already holds the unpacked release: nothing is downloaded [string]$ReleasePath = '', # --- test seams (offline tests/Test-PimGuidedInstall.ps1 + the -WhatIf case); omit them for a real install --- [scriptblock]$GetRelease, [scriptblock]$Download, [scriptblock]$RunInstaller, [string]$TestSelfVersion = '', # --- the Pro copy's seams (PRO-PACKAGE-FROM-INVARDIA): the sign-in { param($TenantId) } and Invardia's answer { param($Url, $Token) } [scriptblock]$GetInstallToken, [scriptblock]$InvardiaHttp ) $ErrorActionPreference = 'Stop' # INSTALL-1 ALIGN (owner 2026-11-02: "trial and pro are th same functionality. license is different in time (backend)"): # the ONE line that differs between the two copies. The repository and the GitHub release say 'community'; the copy built # for Invardia (Build-PimSupportScripts) says 'pro'. Trial and Pro are the same install -- Invardia decides by the licence. $script:PimInstallChannel = 'pro' # INSTALL-CHANNEL: 'community' (the GitHub release copy) | 'pro' (the copy handed to Invardia) # ===== BEGIN inlined helper: _PimScriptDoc.ps1 ===== <# .SYNOPSIS Framework 12.7 SCRIPT-DOC-1 + 12.10 item 11 -- the ONE place that knows where a PIM script's documentation page, download and checksum list live, the command form every surface shows (line 1 download, line 2+ run -- owner 2026-10-11), and the run frame every script a person runs uses (the first line "