The Measure-FleetCoreWorkload command requires specific NuGet packages and modules for diagnostic data collection (Get-SDDCDiagnosticInfo).
Warning: The following script temporarily sets the PSGallery repository to Trusted to allow installation, which relaxes the security boundary. It attempts to restore the original installation policy after completion.
$repo = Get-PSRepository -Name PSGallery
if ($null -eq $repo) { Write-Host "The PSGallery is not configured on this system, please address this before continuing" }
else {
if ($repo.InstallationPolicy -ne 'Trusted') {
Write-Host "Setting the PSGallery repository to Trusted, original InstallationPolicy: $($repo.InstallationPolicy)"
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
}
### Installing the pre-requisite modules
Install-PackageProvider NuGet -Force
Install-Module -Name PrivateCloud.DiagnosticInfo -Force
Install-Module -Name MSFT.Network.Diag -Force
if ($repo.InstallationPolicy -ne 'Trusted') {
Write-Host "Resetting the PSGallery repository to $($repo.InstallationPolicy)"
Set-PSRepository -Name PSGallery -InstallationPolicy $repo.InstallationPolicy
}
}