Donnerstag, 3. Juli 2014

Test-Path in PowerShell Workflow Problem

Hello PowerShell World.
I'm back an my current focus is PowerShell WorkFlows.

And I just found a strange example I can't explain.

Workflow Strange

    if (Test-Path -path $folder)
        "Folder $folder exists"
    if (!(Test-Path -path $folder))
        "Folder $folder seenms not exists"
        "But Get-Item shows it is there"
        Get-item -path $folder


    $a = (Test-Path -path $folder)
    ! $a

Strange -folder 'C:\temp' -PSComputerName  MAGV-2012AKTDE
And here is its output

Folder C:\temp exists
Folder C:\temp seenms not exists
But Get-Item shows it is there

    Verzeichnis: C:\

Mode                LastWriteTime     Length Name                                                                          PSComputerName                                                             
----                -------------     ------ ----                                                                          --------------                                                             
d----        22.08.2013     10:53            temp                                                                          MAGV-2012AKTDE                                                             

All involved machines running PowerShell V3.0.

Keine Kommentare:

Kommentar veröffentlichen