Out-file error "The given path's format is not supported" RRS feed

  • Question

  • Hello,

    So I'm trying to retrieve software information from remote machines. The problem I'm facing is that when I try output the data, it does not work, generating an error that says the given path's format is not supported.

    $softwareData = Invoke-Command -ComputerName (Get-Content C:\Users\jimmy.trinh\Documents\Workspace\Software-Audit\cpuList2.txt) -ScriptBlock {gp HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*,
    HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* |
    Select DisplayName, DisplayVersion, Publisher, InstallDate}
    $date = Get-Date -UFormat "%x_%T"
    $outpath1 = '\softwareAudit_'
    $fileType = '.txt'
    $outpath = $PSScriptRoot+$outpath1+$date+$fileType
    $sofwareData | Out-File -FilePath ($PSScriptRoot+$outpath1+$date+$fileType)

    • Edited by jtentus Friday, May 8, 2015 9:38 PM
    Friday, May 8, 2015 9:35 PM


All replies