You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Private/Update-LogicMonitorModule.ps1
+5-6Lines changed: 5 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -63,25 +63,24 @@ Function Update-LogicMonitorModule {
63
63
64
64
# Uninstall the old version
65
65
If ($CheckOnly) {
66
-
Write-LMHost"[INFO]: You are currently using an outdated version ($InstalledVersion) of $Module, please consider upgrading to the latest version ($OnlineVersion) as soon as possible. Use the -AutoUpdateModule switch next time you connect to auto upgrade to the latest version."-ForegroundColor Yellow
66
+
Write-Information"[INFO]: You are currently using an outdated version ($InstalledVersion) of $Module, please consider upgrading to the latest version ($OnlineVersion) as soon as possible. Use the -AutoUpdateModule switch next time you connect to auto upgrade to the latest version."
67
67
}
68
68
Elseif ($UninstallFirst-eq$true) {
69
-
Write-LMHost"[INFO]: You are currently using an outdated version ($InstalledVersion) of $Module, uninstalling prior Module $Module version $InstalledVersion"-ForegroundColor Yellow
69
+
Write-Information"[INFO]: You are currently using an outdated version ($InstalledVersion) of $Module, uninstalling prior Module $Module version $InstalledVersion"
Write-LMHost"[INFO]: You are currently using an outdated version ($InstalledVersion) of $Module. Installing newer Module $Module version $OnlineVersion."-ForegroundColor Yellow
77
+
Write-Information"[INFO]: You are currently using an outdated version ($InstalledVersion) of $Module. Installing newer Module $Module version $OnlineVersion."
Copy file name to clipboardExpand all lines: Public/Connect-LMAccount.ps1
+24-18Lines changed: 24 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,9 @@ Bearer token from your API credential acquired from the LM Portal. For use in pl
17
17
.PARAMETERAccountName
18
18
The subdomain for your LM portal, the name before ".logicmonitor.com" (subdomain.logicmonitor.com)
19
19
20
+
.PARAMETERDisableConsoleLogging
21
+
Disables on info messages from displaying for any subsequent commands are run. Useful when building scripted logicmodules and you want to suppress unwanted output. Console logging is enabled by default.
22
+
20
23
.PARAMETERUseCachedCredential
21
24
This will list all cached account for you to pick from. This parameter is optional
22
25
@@ -26,9 +29,6 @@ Name of cached account you wish to connect to. This parameter is optional and ca
26
29
.PARAMETERSessionSync
27
30
Use session sync capability instead of api key
28
31
29
-
.PARAMETERDisableConsoleLogging
30
-
Disables on stdout messages from displaying for any subsequent commands are run. Useful when building scripted logicmodules and you want to suppress unwanted output. Console logging is enabled by default.
Write-Host"[ERROR]: Unable to fully migrate cached accounts into secret store, your legacy account cache has been archived at: $NewName. No other attemps will be made to migrate any failed accounts."-ForegroundColor Red
142
+
Write-Error"[ERROR]: Unable to fully migrate cached accounts into secret store, your legacy account cache has been archived at: $NewName. No other attemps will be made to migrate any failed accounts."
136
143
}
137
144
}
138
145
@@ -231,7 +238,6 @@ Function Connect-LMAccount {
231
238
BearerToken=$BearerToken
232
239
Portal=$AccountName
233
240
Valid=$true
234
-
Logging=!$DisableConsoleLogging.IsPresent
235
241
Type=$Type
236
242
}
237
243
@@ -245,7 +251,7 @@ Function Connect-LMAccount {
245
251
}
246
252
}
247
253
Catch {
248
-
Write-Host"[ERROR]: Unable to check for newer version of Logic.Monitor module: $($_.Exception.Message)"-ForegroundColor Red
254
+
Write-Error"[ERROR]: Unable to check for newer version of Logic.Monitor module: $($_.Exception.Message)"
249
255
}
250
256
251
257
If (!$SkipCredValidation) {
@@ -261,13 +267,13 @@ Function Connect-LMAccount {
261
267
262
268
If ($ApiInfo) {
263
269
$PortalInfo=Get-LMPortalInfo-ErrorAction Stop
264
-
Write-LMHost"[INFO]: Connected to LM portal $($PortalInfo.companyDisplayName) using account ($($ApiInfo.adminName) via $Type Token) with assigned roles: $($ApiInfo.roles-join",") - ($($PortalInfo.numberOfDevices) devices | $($PortalInfo.numOfWebsites) websites)."-ForegroundColor Green
270
+
Write-Information"[INFO]: Connected to LM portal $($PortalInfo.companyDisplayName) using account ($($ApiInfo.adminName) via $Type Token) with assigned roles: $($ApiInfo.roles-join",") - ($($PortalInfo.numberOfDevices) devices | $($PortalInfo.numOfWebsites) websites)."
265
271
Return
266
272
}
267
273
Else {
268
274
Try {
269
275
$PortalInfo=Get-LMPortalInfo-ErrorAction Stop
270
-
Write-LMHost"[INFO]: Connected to LM portal $($PortalInfo.companyDisplayName) via $Type Token - ($($PortalInfo.numberOfDevices) devices | $($PortalInfo.numOfWebsites) websites)."-ForegroundColor Green
276
+
Write-Information"[INFO]: Connected to LM portal $($PortalInfo.companyDisplayName) via $Type Token - ($($PortalInfo.numberOfDevices) devices | $($PortalInfo.numOfWebsites) websites)."
271
277
Return
272
278
}
273
279
Catch {
@@ -280,7 +286,7 @@ Function Connect-LMAccount {
280
286
$DeviceInfo=Get-LMDevice-ErrorAction Stop
281
287
282
288
If ($DeviceInfo) {
283
-
Write-LMHost"[INFO]: Connected to LM portal $AccountName via $Type Token with limited permissions, ensure your api token has the necessary rights needed to run desired commands."-ForegroundColor Yellow
289
+
Write-Information"[INFO]: Connected to LM portal $AccountName via $Type Token with limited permissions, ensure your api token has the necessary rights needed to run desired commands."
284
290
Return
285
291
}
286
292
Else {
@@ -297,6 +303,6 @@ Function Connect-LMAccount {
297
303
}
298
304
}
299
305
Else {
300
-
Write-LMHost"[INFO]: Skipping validation of credentials, connected to LM portal $AccountName via $Type, ensure your api token has the necessary rights needed to run desired commands."-ForegroundColor Yellow
306
+
Write-Information"[INFO]: Skipping validation of credentials, connected to LM portal $AccountName via $Type, ensure your api token has the necessary rights needed to run desired commands."
0 commit comments