Powershell help – export to CSV not working – exporting EXE version number – help required…
Hi, I am struggling to get this code below to output to a CSV file. I know I am doing something wrong.
I need to get a version number from an EXE file on multiple devices.
Thanks in advance all 🙂
Script Details :
$ExportPath = “C:Temp”
$ComputerName = Get-Content “C:TempDeviceList.txt”
foreach ($Computer in $ComputerName){
$filePath = “$computerc$Adminprogram.exe”
$fileVersion = (Get-Command $filePath).FileVersionInfo.FileVersion
Write-Host “$computer The file version is $fileVersion”
}
​Hi, I am struggling to get this code below to output to a CSV file. I know I am doing something wrong.I need to get a version number from an EXE file on multiple devices.Thanks in advance all :)Script Details :$ExportPath = “C:Temp”$ComputerName = Get-Content “C:TempDeviceList.txt”foreach ($Computer in $ComputerName){$filePath = “$computerc$Adminprogram.exe”$fileVersion = (Get-Command $filePath).FileVersionInfo.FileVersionWrite-Host “$computer The file version is $fileVersion”}  Read More
​