PowerShell command substitution

Unix-like OS users are often familiar with using shell command substition. PowerShell command substitution works similarly. On any of these systems, command substitution works by enclosing the first command in “$()” like:

echo $(whoami)

To use additional strings adjacent to the command output, like when wanting to change directory relative to command output, enclose in quotes like:

cd "$(my_command)/rel/to/"