Link to home
Start Free TrialLog in
Avatar of CaussyR
CaussyR

asked on

Create a Folder in Powershell using a variable

Does anyone know how I can create a folder on a remote server using a variable ?

The script below does create a folder on the remote server but does not add the $NewFTPUser as a folder.

$NewFTPUser = Test
Invoke-Command -ComputerName dc03.domain.com -scriptBlock {
        $Folder = "\\dc03\c$\temp\DC01" + $NewFTPUser
        New-Item -ItemType directory -Force -path $Folder        
        }
ASKER CERTIFIED SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CaussyR
CaussyR

ASKER

That's GREAT  -thank you very much