We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
While testing watchdog, found that it gives me error:
PS C:\Program Files\rport> PowerShell.exe -ExecutionPolicy Bypass -File .\watchdog.ps1 -Threshold 90 Cannot convert value "1667558884,94853" to type "System.Int32". Error: "Input string was not in a correct format." At C:\Program Files\rport\watchdog.ps1:58 char:5 + $now = ((Get-Date -UFormat %s) - [int](Get-Date -UFormat %Z) * 36 ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : InvalidCastFromStringToInteger
The text was updated successfully, but these errors were encountered:
@guntisratkevics Thank you so much for reporting. You are not on an English Windows. We should have had this in mind. 🤦♂️
Try replacing line 58 by
#$now = ((Get-Date -UFormat %s) - [int](Get-Date -UFormat %Z) * 3600) $now = [DateTimeOffset]::Now.ToUnixTimeSeconds()
Now, the date if fetched in a universal culture independent format. Tested on a German Windows Server 2022.
Sorry, something went wrong.
04aa53c
I did it with:
#$now = ((Get-Date -UFormat %s) - [int](Get-Date -UFormat %Z) * 3600) $now = ((Get-Date -UFormat %s).Substring(0,10) - [int](Get-Date -UFormat %Z) * 3600)
but yours is better
No branches or pull requests
While testing watchdog, found that it gives me error:
The text was updated successfully, but these errors were encountered: