-
Notifications
You must be signed in to change notification settings - Fork 75
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
Avoid error when installing packages in headless mode #1266
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -1534,7 +1534,7 @@ public class Shell { | |||||
$SHCNF_IDLIST = 0 | ||||||
[void][Shell]::SHChangeNotify($SHCNE_ASSOCCHANGED, $SHCNF_IDLIST, [IntPtr]::Zero, [IntPtr]::Zero) | ||||||
# Refresh the Taskbar | ||||||
Stop-Process -Name explorer -Force # This restarts the explorer process so that the new taskbar is displayed. | ||||||
Stop-Process -Name explorer -Force -ErrorAction SilentlyContinue # This restarts the explorer process so that the new taskbar is displayed. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think using
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nitpick] I think it would be a good idea to document why the # Restart the explorer process to refresh the taskbar.
# Use '-ErrorAction Continue' to avoid failing the package installation if it fails,
# for example if there is no desktop session (as in this case explorer.exe is not running)
Stop-Process -Name explorer -Force -ErrorAction Continue |
||||||
} catch { | ||||||
VM-Write-Log-Exception $_ | ||||||
} | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have just merged a PR that updated this package, so there is now a merge conflict here. @thack1 can you please fix it?