This works in Powershell ise but not in Powershell Studio 2019 ?
$FilePath = "C:\test\mcc"
$rmtcomp = '192.168.1.4'
$rmtdst = 'C$'
$rmtdest = '\\$rmtcomp\$rmtdst'
Robocopy $FilePath \\$rmtcomp\$rmtdst\mcc /MIR
Robocopy in PS 2019
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
- Alexander Riedel
- Posts: 8488
- Last visit: Tue Apr 16, 2024 8:42 am
- Been upvoted: 37 times
Re: Robocopy in PS 2019
Define "not work". If you get an error message, please post the message.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Robocopy in PS 2019
Does "not work" meaning it does not copy. I'm looking at which offer best performance for large files Robocopy or Copy-Item. Just curious why PS 2019 does not perform Robocopy to a remote system while the PS ISE does.
- apowershelluser
- Posts: 194
- Last visit: Mon Apr 15, 2024 3:21 pm
Re: Robocopy in PS 2019
It absolutely works , it even works in WindowsPE
remove the variables and just type it out to ensure you're getting the results in PSS that you expect and then create the variables
remove the variables and just type it out to ensure you're getting the results in PSS that you expect and then create the variables
- Alexander Riedel
- Posts: 8488
- Last visit: Tue Apr 16, 2024 8:42 am
- Been upvoted: 37 times
Re: Robocopy in PS 2019
The usually suspects when something is 'not working' are
- Permissions. Is the ISE running elevated but you are not running the script elevated from PowerShell Studio
- Runspace contamination. The ISE, as well as the console, keep variables around until you exit. In PowerShell Studio a script always runs in a new process.
- Firewalls. If you have a corporate firewall, the ISE may have an exception, Scriptdriver64.exe may not.
Robocopy displays an error message when it cannot copy as instructed. It doesn't simply not copy and is quiet about it.
Please always post any error message you get, saying 'not working' only leads to guesswork.
- Permissions. Is the ISE running elevated but you are not running the script elevated from PowerShell Studio
- Runspace contamination. The ISE, as well as the console, keep variables around until you exit. In PowerShell Studio a script always runs in a new process.
- Firewalls. If you have a corporate firewall, the ISE may have an exception, Scriptdriver64.exe may not.
Robocopy displays an error message when it cannot copy as instructed. It doesn't simply not copy and is quiet about it.
Please always post any error message you get, saying 'not working' only leads to guesswork.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.