PS via SCCM Cannot find drive... RRS feed

  • Question

  • I created a copy-item script which worked for another program but changing the path now for another program comes up with this error (Copy-Item : Cannot find drive. A drive with the name '$scriptpath = Split-Path -Path $MyInvocation.Mycommand.Definition $strFileName="C' does not exist)


    Here it is:

    $scriptpath = Split-Path -Path $MyInvocation.MyCommand.Definition
    $strFileName="C:\Program Files (x86)\Common Files\Intergraph\Ingr_licenses\"
    If (Test-Path $strFileName){
    Copy-Item -Path "$scriptpath\" -Destination "$env:public\public desktop\"

    Any know why it would work on another package but not this one??


    Wednesday, April 16, 2014 9:00 PM