Search notes:

Script: pc.ps1

pc.ps1 copies the path of the current directory into the clipboard.
In order to copy the path with forward slashes, the -forwardSlashes (or -f) switch can be used:
PS C:\users\rene> pc
PS C:\users\rene> pc -f
#
# V.2: set-clipboard can be run in PS Core and Desktop, no need for set-clipboardText anymore.
#      Note, PS Desktop would have a `set-clipboard -path .` commant
#
#
param (
   [switch] $forwardSlashes
);

$dir = (get-item .).ToString()

if ($forwardSlashes) {
   $dir = $dir -replace '\\', '/'
}

set-clipboard $dir
Github repository scripts-and-utilities, path: /pc.ps1

History

V.2 set-clipboard can be run in PS Core and Desktop, no need for set-clipboardText anymore.

See also

pc pc.pl
Scripts

Index