Powershell 3.0을 사용하는 멀티 렙 서버에 대해 아래를 실행하려고하지만 웬일인지 경로가 존재하지 않는다는 사실을 알고 있습니다.경로를 찾을 수 없습니까?
아이디어가 있으십니까?
CODE :
clear
$computer = Get-Content -path c:\temp\servers.txt
foreach ($computer1 in $computer){
Write-Host $computer1
Get-Content -Path '\\$computer1\C$\Program Files\BMC Software\BladeLogic\RSCD\rscd.log' -Tail 10
}
ERROR :
SV191267 Get-Content : Cannot find path '\$computer1\C$\Program Files\BMC Software\BladeLogic\RSCD\rscd.log' because it does not exist. At C:\Users\gaachm5\AppData\Local\Temp\e4651274-dcab-4a87-95a6-0f11437a7187.ps1:7 char:1 + Get-Content -Path '\$computer1\C$\Program Files\BMC Software\BladeLogic\RSCD\rs ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (\$computer1\C$...c\RSCD\rscd.log:String) [Get-Content], ItemNotFoundException + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand
SV193936 Get-Content : Cannot find path '\$computer1\C$\Program Files\BMC Software\BladeLogic\RSCD\rscd.log' because it does not exist. At C:\Users\gaachm5\AppData\Local\Temp\e4651274-dcab-4a87-95a6-0f11437a7187.ps1:7 char:1 + Get-Content -Path '\$computer1\C$\Program Files\BMC Software\BladeLogic\RSCD\rs ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (\$computer1\C$...c\RSCD\rscd.log:String) [Get-Content], ItemNotFoundException + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand
당신도 오류를 읽으려고 했습니까? 그렇게했다면 질문은 "왜 내 변수가 확장되지 않습니까?"였을 것입니다. . 이것은 거의 또는 전혀 노력을 보여줍니다. –