Duplicate the tab and keep the same working directory

edit the following profile:

1
$Home\Documents\WindowsPowerShell\profile.ps1
1
2
3
4
5
6
7
8
9
function prompt {
  $loc = $executionContext.SessionState.Path.CurrentLocation;

  $out = "PS $loc$('>' * ($nestedPromptLevel + 1)) ";
  if ($loc.Provider.Name -eq "FileSystem") {
    $out += "$([char]27)]9;9;`"$($loc.ProviderPath)`"$([char]27)\"
  }
  return $out
}

Use alias to change location

edit the following profile:

1
$Home\Documents\WindowsPowerShell\profile.ps1
1
2
3
4
5
Function CDBlogPost {Set-Location -Path D:\documents\personal\blog\content\post}
Function CDCodePersonal {Set-Location -Path D:\code\personal}

Set-Alias -Name blogpost -Value CDBlogPost
Set-Alias -Name code.personal -Value CDCodePersonal

Run exe from any command line in Windows:

  1. From start menu > Type “Environment Variables” and press Enter

  2. System Properties > Advanced > Environment Variables

  3. Find “Path” and double click on it

  4. Click on New and enter the Path of the .exe file without adding the .exe file at the end

    1
    
    C:\Program Files\Typora\
    
    1
    
    C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2022.3.2\bin
    
    1
    
    C:\Program Files\JetBrains\CLion 2021.2.2\bin
    
  5. Click Ok on all Windows and you should be good to go