none
Export-Clixml : The given path's format is not supported. RRS feed

  • Question

  • I am currently trying to export to xml and my script looks like this

    $xml = $reportBuilder.GetMyReport()
    
    $fileDestination = $filepath + "\" + $fileName + ".xml"
    
    $xml | Export-Clixml -Path $fileDestination
    

    when I debug this code, $fileDestiniation hold the value c:\folder\filename.xml

    However, I keep getting the error that states "Export-Clixml : The given path's format is not supported". At this point am lost of ideas, cause I do not know why its saying that. Especially since the value for $fileDestination is a valid one. Please help.

    Wednesday, April 2, 2014 6:35 PM

Answers

  • I just found out what the issue was. The syntax was right, but I just had a special character within the file name. So that does prevent the export from happening.
    • Marked as answer by Spawn10 Wednesday, April 2, 2014 6:46 PM
    Wednesday, April 2, 2014 6:46 PM

All replies

  • I just found out what the issue was. The syntax was right, but I just had a special character within the file name. So that does prevent the export from happening.
    • Marked as answer by Spawn10 Wednesday, April 2, 2014 6:46 PM
    Wednesday, April 2, 2014 6:46 PM
  • Try this to see what is wrong:

    $fileDestination="$filepath\$fileName.clixml"
    
    if(Test-Path $fileDestination){
    	$xml | Export-Clixml -Path $fileDestination
    }else{
           Write-Host "$fileDestination NOT found" -fore red
    }


    ¯\_(ツ)_/¯



    • Edited by jrv Wednesday, April 2, 2014 6:48 PM
    Wednesday, April 2, 2014 6:46 PM