After some trial and error, I found that
$computername = $env:computername
I also tried
$computername.Value
.
Instead, if I use
$computername = get-content env:computername
I can send it to a text file using
$computername | Out-File $file
No comments:
Post a Comment
Note: only a member of this blog may post a comment.