Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

psm1.ts: remove use of write-information as it pollutes information stream when using Az-modules #1339

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions powershell/generators/psm1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function getProfileExportScript(exportFolderScript: string, isAzure: bool
}

if($profileDirectory) {
Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'"
Write-Verbose -Message "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'"
$exportsPath = $profileDirectory.FullName
}

Expand Down Expand Up @@ -89,7 +89,7 @@ export async function generatePsm1(project: Project) {
} elseif (($accountsModule.Version -lt [System.Version]'${project.accountsVersionMinimum}') -and (-not $localAccounts)) {
Write-Error "\`nThis module requires $accountsName version ${project.accountsVersionMinimum} or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to add the switch '-RegenerateSupportModule' when executing 'test-module.ps1'. Otherwise please open a new PowerShell session and import this module again.\`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop
}
Write-Information "Loaded Module '$($accountsModule.Name)'"
Write-Verbose -Message "Loaded Module '$($accountsModule.Name)'"

# Load the private module dll
$null = Import-Module -Name (Join-Path $PSScriptRoot '${project.dll}')
Expand Down Expand Up @@ -152,7 +152,7 @@ ${azureInitialize}
${getProfileExportScript(`Join-Path $PSScriptRoot '${project.exportsFolder}'`, project.azure)}
# Finalize initialization of this module
$instance.Init();
Write-Information "Loaded Module '$($instance.Name)'"`);
Write-Verbose -Message "Loaded Module '$($instance.Name)'"`);
psm1.trim();
project.state.writeFile(project.psm1, `${psm1}`, undefined, 'source-file-powershell');
}