psutils
psutils copied to clipboard
touch fails when running in strict mode
Most of my scripts calls Set-StrictMode -Version Latest;
initially, and I've noticed that touch fails in this mode:
Set-StrictMode -Version Latest;
touch <file>
The property 'A' cannot be found on this object. Verify that the property exists.
At ...\touch.ps1:45 char:4
+ if($opts.A) {
+ ~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : PropertyNotFoundStrict
This can either be fixed by not accessing hashtable contents as members, but using the indexer, or by calling Set-StrictMode -Off
at the beginning of the file.
Hope you fix this as I love your tools :-) And I'd be happy to make a PR with the change you'd prefer.
Thanks, I'd be happy to accept a PR. Set-StrictMode -Off
sounds good to me