mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-25 22:30:22 -07:00
Add option names to Fail-Json and Exit-Json
Small fix.
This commit is contained in:
parent
8f9b885113
commit
908a4dc4f7
1 changed files with 4 additions and 4 deletions
|
@ -13,7 +13,7 @@ $ErrorActionPreference = "Stop"
|
||||||
$osversion = [Environment]::OSVersion
|
$osversion = [Environment]::OSVersion
|
||||||
$lowest_version = 10
|
$lowest_version = 10
|
||||||
if ($osversion.Version.Major -lt $lowest_version ) {
|
if ($osversion.Version.Major -lt $lowest_version ) {
|
||||||
Fail-Json $result "Sorry, this version of windows, $osversion, does not support Toast notifications. Toast notifications are available from version $lowest_version"
|
Fail-Json -obj $result -message "Sorry, this version of windows, $osversion, does not support Toast notifications. Toast notifications are available from version $lowest_version"
|
||||||
}
|
}
|
||||||
|
|
||||||
$stopwatch = [system.diagnostics.stopwatch]::startNew()
|
$stopwatch = [system.diagnostics.stopwatch]::startNew()
|
||||||
|
@ -45,7 +45,7 @@ $result = @{
|
||||||
# and no-one to read the message, so exit but do not fail
|
# and no-one to read the message, so exit but do not fail
|
||||||
# if there are no logged in users to notify.
|
# if there are no logged in users to notify.
|
||||||
|
|
||||||
if ((get-process -name explorer -EA silentlyContinue).Count -gt 0){
|
if ((Get-Process -Name explorer -ErrorAction SilentlyContinue).Count -gt 0){
|
||||||
|
|
||||||
[Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] > $null
|
[Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] > $null
|
||||||
$template = [Windows.UI.Notifications.ToastNotificationManager]::GetTemplateContent([Windows.UI.Notifications.ToastTemplateType]::ToastText01)
|
$template = [Windows.UI.Notifications.ToastNotificationManager]::GetTemplateContent([Windows.UI.Notifications.ToastTemplateType]::ToastText01)
|
||||||
|
@ -88,4 +88,4 @@ $stopwatch.Stop()
|
||||||
$result.time_taken = $stopwatch.Elapsed.TotalSeconds
|
$result.time_taken = $stopwatch.Elapsed.TotalSeconds
|
||||||
$result.sent_localtime = $endsend_at.Trim()
|
$result.sent_localtime = $endsend_at.Trim()
|
||||||
|
|
||||||
Exit-Json $result
|
Exit-Json -obj $result
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue