Skip to content

Commit

Permalink
Improved error output
Browse files Browse the repository at this point in the history
  • Loading branch information
farag2 committed Feb 23, 2024
1 parent c54f828 commit 9270607
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 42 deletions.
14 changes: 7 additions & 7 deletions src/Sophia_Script_for_Windows_10/Module/Sophia.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -12902,7 +12902,7 @@ function Set-AppGraphicsPerformance

do
{
$Choice = Show-Menu -Menu @($Browse, $Skip) -Default 2
$Choice = Show-Menu -Menu $Browse -Default 1 -AddSkip

switch ($Choice)
{
Expand Down Expand Up @@ -13097,8 +13097,8 @@ function CleanupTask

if ($TaskUserAccount -ne $env:USERNAME)
{
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line, $TaskUserAccount) -Verbose
Write-Error -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line, $TaskUserAccount) -ErrorAction SilentlyContinue
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line.Trim(), $TaskUserAccount) -Verbose
Write-Error -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line.Trim(), $TaskUserAccount) -ErrorAction SilentlyContinue
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

return
Expand Down Expand Up @@ -13521,8 +13521,8 @@ function SoftwareDistributionTask

if ($TaskUserAccount -ne $env:USERNAME)
{
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line, $TaskUserAccount) -Verbose
Write-Error -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line, $TaskUserAccount) -ErrorAction SilentlyContinue
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line.Trim(), $TaskUserAccount) -Verbose
Write-Error -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line.Trim(), $TaskUserAccount) -ErrorAction SilentlyContinue
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

return
Expand Down Expand Up @@ -13826,8 +13826,8 @@ function TempTask

if ($TaskUserAccount -ne $env:USERNAME)
{
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line, $TaskUserAccount) -Verbose
Write-Error -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line, $TaskUserAccount) -ErrorAction SilentlyContinue
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line.Trim(), $TaskUserAccount) -Verbose
Write-Error -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line.Trim(), $TaskUserAccount) -ErrorAction SilentlyContinue
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

return
Expand Down
14 changes: 7 additions & 7 deletions src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -9434,7 +9434,7 @@ function Set-AppGraphicsPerformance

do
{
$Choice = Show-Menu -Menu @($Browse, $Skip) -Default 2
$Choice = Show-Menu -Menu $Browse -Default 1 -AddSkip

switch ($Choice)
{
Expand Down Expand Up @@ -9563,8 +9563,8 @@ function CleanupTask

if ($TaskUserAccount -ne $env:USERNAME)
{
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line, $TaskUserAccount) -Verbose
Write-Error -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line, $TaskUserAccount) -ErrorAction SilentlyContinue
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line.Trim(), $TaskUserAccount) -Verbose
Write-Error -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line.Trim(), $TaskUserAccount) -ErrorAction SilentlyContinue
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

return
Expand Down Expand Up @@ -9987,8 +9987,8 @@ function SoftwareDistributionTask

if ($TaskUserAccount -ne $env:USERNAME)
{
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line, $TaskUserAccount) -Verbose
Write-Error -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line, $TaskUserAccount) -ErrorAction SilentlyContinue
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line.Trim(), $TaskUserAccount) -Verbose
Write-Error -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line.Trim(), $TaskUserAccount) -ErrorAction SilentlyContinue
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

return
Expand Down Expand Up @@ -10292,8 +10292,8 @@ function TempTask

if ($TaskUserAccount -ne $env:USERNAME)
{
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line, $TaskUserAccount) -Verbose
Write-Error -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line, $TaskUserAccount) -ErrorAction SilentlyContinue
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line.Trim(), $TaskUserAccount) -Verbose
Write-Error -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line.Trim(), $TaskUserAccount) -ErrorAction SilentlyContinue
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

return
Expand Down
14 changes: 7 additions & 7 deletions src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -10521,7 +10521,7 @@ function Set-AppGraphicsPerformance

do
{
$Choice = Show-Menu -Menu @($Browse, $Skip) -Default 2
$Choice = Show-Menu -Menu $Browse -Default 1 -AddSkip

switch ($Choice)
{
Expand Down Expand Up @@ -10716,8 +10716,8 @@ function CleanupTask

if ($TaskUserAccount -ne $env:USERNAME)
{
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line, $TaskUserAccount) -Verbose
Write-Error -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line, $TaskUserAccount) -ErrorAction SilentlyContinue
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line.Trim(), $TaskUserAccount) -Verbose
Write-Error -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line.Trim(), $TaskUserAccount) -ErrorAction SilentlyContinue
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

return
Expand Down Expand Up @@ -11140,8 +11140,8 @@ function SoftwareDistributionTask

if ($TaskUserAccount -ne $env:USERNAME)
{
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line, $TaskUserAccount) -Verbose
Write-Error -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line, $TaskUserAccount) -ErrorAction SilentlyContinue
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line.Trim(), $TaskUserAccount) -Verbose
Write-Error -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line.Trim(), $TaskUserAccount) -ErrorAction SilentlyContinue
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

return
Expand Down Expand Up @@ -11445,8 +11445,8 @@ function TempTask

if ($TaskUserAccount -ne $env:USERNAME)
{
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line, $TaskUserAccount) -Verbose
Write-Error -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line, $TaskUserAccount) -ErrorAction SilentlyContinue
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line.Trim(), $TaskUserAccount) -Verbose
Write-Error -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line.Trim(), $TaskUserAccount) -ErrorAction SilentlyContinue
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

return
Expand Down
14 changes: 7 additions & 7 deletions src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -12910,7 +12910,7 @@ function Set-AppGraphicsPerformance

do
{
$Choice = Show-Menu -Menu @($Browse, $Skip) -Default 2
$Choice = Show-Menu -Menu $Browse -Default 1 -AddSkip

switch ($Choice)
{
Expand Down Expand Up @@ -13105,8 +13105,8 @@ function CleanupTask

if ($TaskUserAccount -ne $env:USERNAME)
{
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line, $TaskUserAccount) -Verbose
Write-Error -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line, $TaskUserAccount) -ErrorAction SilentlyContinue
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line.Trim(), $TaskUserAccount) -Verbose
Write-Error -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line.Trim(), $TaskUserAccount) -ErrorAction SilentlyContinue
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

return
Expand Down Expand Up @@ -13529,8 +13529,8 @@ function SoftwareDistributionTask

if ($TaskUserAccount -ne $env:USERNAME)
{
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line, $TaskUserAccount) -Verbose
Write-Error -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line, $TaskUserAccount) -ErrorAction SilentlyContinue
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line.Trim(), $TaskUserAccount) -Verbose
Write-Error -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line.Trim(), $TaskUserAccount) -ErrorAction SilentlyContinue
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

return
Expand Down Expand Up @@ -13834,8 +13834,8 @@ function TempTask

if ($TaskUserAccount -ne $env:USERNAME)
{
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line, $TaskUserAccount) -Verbose
Write-Error -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line, $TaskUserAccount) -ErrorAction SilentlyContinue
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line.Trim(), $TaskUserAccount) -Verbose
Write-Error -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line.Trim(), $TaskUserAccount) -ErrorAction SilentlyContinue
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

return
Expand Down
14 changes: 7 additions & 7 deletions src/Sophia_Script_for_Windows_11/Module/Sophia.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -12026,7 +12026,7 @@ function Set-AppGraphicsPerformance

do
{
$Choice = Show-Menu -Menu @($Browse, $Skip) -Default 2
$Choice = Show-Menu -Menu $Browse -Default 1 -AddSkip

switch ($Choice)
{
Expand Down Expand Up @@ -12221,8 +12221,8 @@ function CleanupTask

if ($TaskUserAccount -ne $env:USERNAME)
{
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line, $TaskUserAccount) -Verbose
Write-Error -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line, $TaskUserAccount) -ErrorAction SilentlyContinue
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line.Trim(), $TaskUserAccount) -Verbose
Write-Error -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line.Trim(), $TaskUserAccount) -ErrorAction SilentlyContinue
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

return
Expand Down Expand Up @@ -12645,8 +12645,8 @@ function SoftwareDistributionTask

if ($TaskUserAccount -ne $env:USERNAME)
{
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line, $TaskUserAccount) -Verbose
Write-Error -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line, $TaskUserAccount) -ErrorAction SilentlyContinue
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line.Trim(), $TaskUserAccount) -Verbose
Write-Error -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line.Trim(), $TaskUserAccount) -ErrorAction SilentlyContinue
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

return
Expand Down Expand Up @@ -12950,8 +12950,8 @@ function TempTask

if ($TaskUserAccount -ne $env:USERNAME)
{
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line, $TaskUserAccount) -Verbose
Write-Error -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line, $TaskUserAccount) -ErrorAction SilentlyContinue
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line.Trim(), $TaskUserAccount) -Verbose
Write-Error -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line.Trim(), $TaskUserAccount) -ErrorAction SilentlyContinue
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

return
Expand Down
14 changes: 7 additions & 7 deletions src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -12029,7 +12029,7 @@ function Set-AppGraphicsPerformance

do
{
$Choice = Show-Menu -Menu @($Browse, $Skip) -Default 2
$Choice = Show-Menu -Menu $Browse -Default 1 -AddSkip

switch ($Choice)
{
Expand Down Expand Up @@ -12224,8 +12224,8 @@ function CleanupTask

if ($TaskUserAccount -ne $env:USERNAME)
{
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line, $TaskUserAccount) -Verbose
Write-Error -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line, $TaskUserAccount) -ErrorAction SilentlyContinue
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line.Trim(), $TaskUserAccount) -Verbose
Write-Error -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line.Trim(), $TaskUserAccount) -ErrorAction SilentlyContinue
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

return
Expand Down Expand Up @@ -12648,8 +12648,8 @@ function SoftwareDistributionTask

if ($TaskUserAccount -ne $env:USERNAME)
{
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line, $TaskUserAccount) -Verbose
Write-Error -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line, $TaskUserAccount) -ErrorAction SilentlyContinue
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line.Trim(), $TaskUserAccount) -Verbose
Write-Error -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line.Trim(), $TaskUserAccount) -ErrorAction SilentlyContinue
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

return
Expand Down Expand Up @@ -12953,8 +12953,8 @@ function TempTask

if ($TaskUserAccount -ne $env:USERNAME)
{
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line, $TaskUserAccount) -Verbose
Write-Error -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line, $TaskUserAccount) -ErrorAction SilentlyContinue
Write-Verbose -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line.Trim(), $TaskUserAccount) -Verbose
Write-Error -Message ($Localization.ScheduledTaskPresented -f $MyInvocation.Line.Trim(), $TaskUserAccount) -ErrorAction SilentlyContinue
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

return
Expand Down

0 comments on commit 9270607

Please sign in to comment.