Quantcast
Channel: /r/powershell – How to Code .NET
Viewing all articles
Browse latest Browse all 8793

Basic powershell script question.

$
0
0

I am trying to learn a bit about powershell scripts and have been trying to logically breakdown a script which includes this snippet.

$destFolders | Foreach-Object { Copy-Item -Path $Source -dest (Join-Path $_ $destFileName) }

If i was writing this from scratch i think i would write it as follows – why am I wrong?

$destFolders | Foreach-Object { Copy-Item -Path $Source -dest ($_) }

submitted by /u/noblud
[link] [comments]

The post Basic powershell script question. appeared first on How to Code .NET.


Viewing all articles
Browse latest Browse all 8793