@@ -51,20 +51,20 @@ export class UpdatePowerShell {
5151 private shouldCheckForUpdate ( ) : boolean {
5252 // Respect user setting.
5353 if ( ! this . sessionSettings . promptToUpdatePowerShell ) {
54- this . logger . writeDiagnostic ( "Setting 'promptToUpdatePowerShell' was false." ) ;
54+ this . logger . writeVerbose ( "Setting 'promptToUpdatePowerShell' was false." ) ;
5555 return false ;
5656 }
5757
5858 // Respect environment configuration.
5959 if ( process . env . POWERSHELL_UPDATECHECK ?. toLowerCase ( ) === "off" ) {
60- this . logger . writeDiagnostic ( "Environment variable 'POWERSHELL_UPDATECHECK' was 'Off'." ) ;
60+ this . logger . writeVerbose ( "Environment variable 'POWERSHELL_UPDATECHECK' was 'Off'." ) ;
6161 return false ;
6262 }
6363
6464 // Skip prompting when using Windows PowerShell for now.
6565 if ( this . localVersion . compare ( "6.0.0" ) === - 1 ) {
6666 // TODO: Maybe we should announce PowerShell Core?
67- this . logger . writeDiagnostic ( "Not offering to update Windows PowerShell." ) ;
67+ this . logger . writeVerbose ( "Not prompting to update Windows PowerShell." ) ;
6868 return false ;
6969 }
7070
@@ -78,20 +78,19 @@ export class UpdatePowerShell {
7878
7979 // Skip if PowerShell is self-built, that is, this contains a commit hash.
8080 if ( commit . length >= 40 ) {
81- this . logger . writeDiagnostic ( "Not offering to update development build." ) ;
81+ this . logger . writeVerbose ( "Not prompting to update development build." ) ;
8282 return false ;
8383 }
8484
8585 // Skip if preview is a daily build.
8686 if ( daily . toLowerCase ( ) . startsWith ( "daily" ) ) {
87- this . logger . writeDiagnostic ( "Not offering to update daily build." ) ;
87+ this . logger . writeVerbose ( "Not prompting to update daily build." ) ;
8888 return false ;
8989 }
9090 }
9191
9292 // TODO: Check if network is available?
9393 // TODO: Only check once a week.
94- this . logger . writeDiagnostic ( "Should check for PowerShell update." ) ;
9594 return true ;
9695 }
9796
@@ -107,7 +106,7 @@ export class UpdatePowerShell {
107106 // "ReleaseTag": "v7.2.7"
108107 // }
109108 const data = await response . json ( ) ;
110- this . logger . writeDiagnostic ( `From '${ url } ' received :\n${ data } `) ;
109+ this . logger . writeVerbose ( `Received from '${ url } ':\n${ JSON . stringify ( data , undefined , 2 ) } `) ;
111110 return data . ReleaseTag ;
112111 }
113112
@@ -116,6 +115,7 @@ export class UpdatePowerShell {
116115 return undefined ;
117116 }
118117
118+ this . logger . writeVerbose ( "Checking for PowerShell update..." ) ;
119119 const tags : string [ ] = [ ] ;
120120 if ( process . env . POWERSHELL_UPDATECHECK ?. toLowerCase ( ) === "lts" ) {
121121 // Only check for update to LTS.
@@ -135,11 +135,11 @@ export class UpdatePowerShell {
135135
136136 for ( const tag of tags ) {
137137 if ( this . localVersion . compare ( tag ) === - 1 ) {
138- this . logger . writeDiagnostic ( `Offering to update PowerShell to ${ tag } .` ) ;
139138 return tag ;
140139 }
141140 }
142141
142+ this . logger . write ( "PowerShell is up-to-date." ) ;
143143 return undefined ;
144144 }
145145
@@ -162,6 +162,7 @@ export class UpdatePowerShell {
162162
163163 private async installUpdate ( tag : string ) : Promise < void > {
164164 const releaseVersion = new SemVer ( tag ) ;
165+ this . logger . write ( `Prompting to update PowerShell v${ this . localVersion . version } to v${ releaseVersion . version } .` ) ;
165166 const result = await vscode . window . showInformationMessage (
166167 `You have an old version of PowerShell (${ this . localVersion . version } ).
167168 The current latest release is ${ releaseVersion . version } .
@@ -170,11 +171,11 @@ export class UpdatePowerShell {
170171
171172 // If the user cancels the notification.
172173 if ( ! result ) {
173- this . logger . writeDiagnostic ( "User canceled PowerShell update prompt." ) ;
174+ this . logger . writeVerbose ( "User canceled PowerShell update prompt." ) ;
174175 return ;
175176 }
176177
177- this . logger . writeDiagnostic ( `User said '${ UpdatePowerShell . promptOptions [ result . id ] . title } '.` ) ;
178+ this . logger . writeVerbose ( `User said '${ UpdatePowerShell . promptOptions [ result . id ] . title } '.` ) ;
178179
179180 switch ( result . id ) {
180181 // Yes
0 commit comments