ERROR: You cannot call a method on a null-valued expression.
Test.psf (34, 3): ERROR: At Line: 34 char: 3
ERROR: + [PSCustomObject]@{
ERROR: + ~~~~~~~~~~~~~~~~~~
ERROR: + CategoryInfo : InvalidOperation: (:) [], RuntimeException
ERROR: + FullyQualifiedErrorId : InvokeMethodOnNull
ERROR:
Or it loops twice and I get the correct information, but it's doubled.
- [PSCustomObject]@{
- $getdate = get-date
- PCT = $env:username;
- Asset = $env:COMPUTERNAME;
- Date = $getdate.ToShortDateString();
- Time = $getdate.ToShortTimeString();
- } | EXPORT-CSV "\\server\Projects\$($form1.Text)\Usage.csv" -NoTypeInformation -Append