Module/Administration/Import-BCSLicenseToTenant.ps1
<#
.SYNOPSIS .DESCRIPTION .EXAMPLE .NOTES Author: Mathias Stjernfelt Website: http://www.brightcom.se #> function Import-BCSLicenseToTenant { Param ( [Parameter(ValueFromPipelineByPropertyName, Mandatory = $true)] [string]$serverInstance, [Parameter(ValueFromPipelineByPropertyName, Mandatory = $true)] [string]$tenant, [Parameter(ValueFromPipelineByPropertyName, Mandatory = $true)] [string]$licenseFile ) begin {} process { Import-BCSDynamicsNavModules -ServerInstance $serverInstance if ($licenseFile -like "http://*" -or $licenseFile -like "https://*") { $tempFolderPath = Join-Path $Env:Temp $(New-Guid) New-Item -Type Directory -Path $tempFolderPath | Out-Null $TempLicenseFile = "$tempFolderPath\license.flf" Write-Host "Downloading license file from $licenseFile" (New-Object System.Net.WebClient).DownloadFile($licenseFile, $TempLicenseFile) } else { $TempLicenseFile = $licenseFile } Import-NAVServerLicense -ServerInstance $serverInstance -LicenseFile $TempLicenseFile -Tenant $tenant } end { } } Export-ModuleMember -Function Import-BCSLicenseToTenant |