powershell - Find a particular file name existence and execute batch command -
i looking ps script search particular file name , check existence. if file exists should execute batch command.
$version = "1.1.0" $packagename = "example.dto.$version" get-childitem "d:\test" | where-object { $_.name -match "$packagename.nupkg" }
and batch command
c:\nugetrestore\nuget.exe push "d:\test\$packagename.nupkg" saranuget -source "http://123.456.78.90/myget" -timeout 120
i unable integrate both this.
this covers test matches multiple files:
$version = "1.1.0" $packagename = "example.dto.$version" $filecheck = get-childitem "d:\test" | where-object { $_.name -match "$packagename.nupkg" } $filecheck | foreach-object { c:\nugetrestore\nuget.exe push "$($_.fullname)" saranuget -source "http://123.456.78.90/myget" -timeout 120 }
Comments
Post a Comment