[toc]
🧩 This guide is meant for Microsoft Windows, preferably Windows 10 or newer.
:construction: Under Construction - This page is a work in progress. It’s not complete.
root
since that’s where their home directory is.Since PowerShell is designed to behave like an UNIX or Linux Shell, many of the basic commands from Unix and Linux can be used here.
echo "string to print"
- Print a string to standard output. Variables (which start with $
) can be included.ls [path/to/directory]
- show what is in the current directory. If you include a path, show what is in that directory.mv old_file_name new_file_name
- Move or rename files. The mv
(move) command has two purposes:
cp original_file copy_of_file
- Copy files provided the original name an a new name for the copy. It is possible to make a copy of a directory using the cp
command. ( :reminder_ribbon: TODO: Explain. )rm file_name
- Delete a file. Be very careful with this! You cannot use this to delete directories…at least not without adding some attribute to force it to do so.mkdir new_directory
- Create a new directory.rmdir old_directory
- Delete a directory. Generally, it won’t let you do this unless the directory is empty.touch new_file
- create an empty fileEnvironment variables are common variables used to identify. Unlike in UNIX or Linux, variables in PowerShell do not appear to be case-sensitive.
$env:UserName
= Jason
- returns your username$env:UserProfile
= C:\Users\Jason
- returns the path to your user directory. This is equivalent to the $HOME
variable if you are familiar with UNIX or Linux.
$HOME
happens to be another name for $env:UserProfile
$env:AppData
= C:\Users\Jason\AppData\Roaming
$env:OneDrive
= C:\Users\Jason\OneDrive
- Path to your OneDrive directory where files are stored in the cloud (assuming you have Microsoft OneDrive)#PowerShell #Guides