【发布时间】:2016-04-01 18:57:03
【问题描述】:
我需要使用 PowerShell 脚本从 SVN 位置而不是 windows 位置导航文件,如果我用 SVN 路径替换 windows 路径它不起作用,我有以下 windows 位置的工作代码:
function CheckPath($path)
{
Test-Path $path -PathType Container
}
function Navigate()
{
$directory = "C:\Test"
#Instead of above windows path I want to give SVN path as below:
#https://svn.test.local/svn/Files/
$qscomponent="SomeValue"
if (CheckPath -path $directory)
{
Write-Host "Executing scripts from $directory"
Get-ChildItem $directory -Filter LTR*.sql | Foreach-Object -Process { RunScript -comp $component -file $_.FullName }
}
else
{
Write-Host "Invalid component: the path does not exist!"
}
}
【问题讨论】:
-
AFAIK,文件系统提供程序不支持通过 HTTP 浏览目录。
-
好的,那我如何从 SVN 中挑选和执行文件。我不想在 Windows 位置/目录上查看它们。
-
先下载,然后本地执行
标签: powershell powershell-2.0 powershell-3.0