November 2018
Intermediate to advanced
566 pages
17h 15m
English
This is another simple recipe. The concept, though, is a very important one when dealing with files. Let's look at solving the situation we are presented with.
Here is the script that would address the problem in question:
#region Copy files to a backup directory before proceeding:New-Item $HOME/random/backup/ -it Directory -f# Verbose version New-Item -Path $HOME/random/backup -ItemType Directory -Force # -Force to avoid errors in case when the directory already exists Copy-Item $HOME/random/message.txt, $HOME/random/file-list.txt, $HOME/random/error.txt $HOME/random/backup/ # Verbose version: Copy-Item -Path $HOME/random/message.txt, $HOME/random/file-list.txt, $HOME/random/error.txt -Destination $HOME/random/backup/ #endregion ...
Read now
Unlock full access