cwstad2
asked on
Script not running correctly
Hi all, i have the following script that interrogates the .txt file for the computer names and create a c:\utils folder on each. I think im almost there. any suggestions. Thanks
$servers =Get-Content "C:\server.txt"
foreach ( $servers1 in $servers ) {
@"
Displaying for $servers1
"@
$copy = New-Item -ItemType directory -Path "\\$servers1\c$\utils"
}
$servers =Get-Content "C:\server.txt"
foreach ( $servers1 in $servers ) {
@"
Displaying for $servers1
"@
$copy = New-Item -ItemType directory -Path "\\$servers1\c$\utils"
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Almost there. Thanks for your help
"\\$servers1\c$\utils"
is New-Item the utils locally? If you're copyign the whole directory wouldn't it just be "\\$servers1\c$\"?