Using Powershell environmental variables as strings when outputting files
问题 I am using Get-WindowsAutopilotInfo to generate a computer's serial number and a hash code and export that info as a CSV. Here is the code I usually use: new-item "c:\Autopilot_Export" -type directory -force Set-Location "C:\Autopilot_Export" Get-WindowsAutopilotInfo.ps1 -OutputFile Autopilot_CSV.csv Robocopy C:\Autopilot_Export \\Zapp\pc\Hash_Exports /copyall This outputs a CSV file named "Autopilot_CSV.csv" to the C:\Autopilot_Export directory and then Robocopy copies it to the Network