I was looking for way to move multiple files from one directory into the other using powershell variables.
Lets say I have var $domain = test.test
and I have four files in directory $domain.csr $domain.crt $domain.pfx $domain.key"
. I can't seem to be able to do it this way Move-Items "$domain.csr $domain.crt $domain.pfx $domain.key" ../certs
Is there a one line comand to perform that?
Thanks.
You have to pass the source path as a <String[]>
, so try:
Move-Item -Path $domain.csr, $domain.crt, $domain.pfx, $domain.key -Destination ../certs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With