-
Notifications
You must be signed in to change notification settings - Fork 67
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
Start-GSDriveFileUpload throws Exception setting "CursorVisible": "The handle is invalid on ps jobs #242
Comments
hey @DCurtin - Thanks for opening this up! I think to catch all scenarios, I can wrap the call to It seems to catch as expected here: Start-Job {
try {
[System.Console]::CursorVisible = $true
}
catch {
"Couldn't be set"
}
} | Wait-Job | Receive-Job Thoughts? |
Also worth noting that |
## 2.33.2 - 2019-10-06 * [Issue #242](#242) * Fixed: Error handling around `[System.Console]::CursorVisible` on `Start-GSDriveFileUpload`, `Wait-GSDriveFileUpload` and `Write-InlineProgress` * Cleaned up verbose handling on `Stop-GSDriveFileUpload` due to file uploads showing as Failed even though they were successful. * Miscellaneous * Updated build.ps1 script for better verbose output
## 2.33.2 - 2019-10-06 * [Issue #242](#242) * Fixed: Error handling around `[System.Console]::CursorVisible` on `Start-GSDriveFileUpload`, `Wait-GSDriveFileUpload` and `Write-InlineProgress` * Cleaned up verbose handling on `Stop-GSDriveFileUpload` due to file uploads showing as Failed even though they were successful. * Miscellaneous * Updated build.ps1 script for better verbose output
hey @DCurtin - Fix added and deployed in PSGSuite v2.33.2, you should no longer see that pesky error! Let me know if all is well =] |
awesome, I noticed that about it kicking off background jobs. I likely don't need to wrap it in a job but wanted a way to manage sets in a more custom way. Really appreciate this project. |
All's well, thank you for the update. |
Yup! It starts them as async requests in background threads. You can check on the status at any time with |
Describe the bug
Exception thrown
Exception setting "CursorVisible": "The handle is invalid.
when running Start-GSDriveFileUpload in a ps job
To Reproduce
Steps to reproduce the behavior:
$newJob = Start-Job -ScriptBlock {Start-GSDriveFileUpload -Path $args[0] -Parents @('some-parent-id') -Verbose} -ArgumentList @('filepath');
Expected behavior
CursorVisble exception to not be thrown?
The file seems to upload successfully regardless. So it's not terribly important, just annoying
Environment (please complete the following information):
Additional context
When running get-host on a job this is returned
Name : ServerRemoteHost
Version : 1.0.0.0
InstanceId : 0c466ab7-b486-42fc-af7e-2dc2a99a2617
UI : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture : en-US
CurrentUICulture : en-US
PrivateData :
DebuggerEnabled : True
IsRunspacePushed : False
Runspace : System.Management.Automation.Runspaces.LocalRunspace
On line 328 and 221 of https://github.com/scrthq/PSGSuite/blob/master/PSGSuite/Public/Drive/Start-GSDriveFileUpload.ps1
It's setting [System.Console]::CursorVisible = $true when $host.name Is not PS ISE
maybe ServerRemoteHost needs to be added to the filter?
The text was updated successfully, but these errors were encountered: