我是powershell的新手。要成功运行以下powershell程序,我需要在何处定义$UNC,以及需要定义哪些内容?
$Source = "\\ahs-bind01\ftptest01\CRAR"
Get-ChildItem -Path $Source -recurse
$files = import-csv "C:\Users\us6205\Desktop\DatabaseNameConfigs\Test\CareMoveFileParentDestPaths.csv"
#loop to get values and store it
foreach ($UNC in $files)
{
$Path = Get-ChildItem -Path $UNC.path -recurse | Where-Object { ($_.PSIsContainer -eq $true) -and ( $_.FullName -match "$Source") }
$Dest = $path | New-Item -path $path -itemtype directory | Move-Item -Path $Source -Destination $dest -Force
}发布于 2016-04-28 23:18:54
如果我正确理解了您的问题,那么答案是您不必在其他地方定义$UNC。它是脚本在foreach循环中遍历文件时使用的临时变量
https://stackoverflow.com/questions/36918647
复制相似问题