I am trying to write a powershell script that will create a folder called temp in c:\ if the folder doesn't already exist. It will then copy the file to the folder. Below is what I have so far:
$Servers = Get-Content '\\share\computers.txt
$Hotfixpath = '\\share\hotfix\hotfix.msi
foreach ($Server in $Servers){
if (!(Test-Path -path "\\$Server\c$\temp")){
New-Item "\\$Server\c$\temp" -type directory
Write-Host "Processing $Server..."
Copy-Item $Hotfix \\$Server\C$\temp