Advertisement
rahlquist

Untitled

Sep 25th, 2023
970
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # script to overcome pgadmins obsession with installing in a new folder with each major version
  2. # pgpath should be working out to the full path to the exectuable in the newest subfolder in the pgadmin 4 subdirectory.
  3.  
  4. $pgpath = Join-Path 'C:\Users\'$Env:UserName'\AppData\Local\Programs\pgAdmin 4\' $(Get-ChildItem 'C:\Users\'$Env:UserName'\AppData\Local\Programs\pgAdmin 4\' -Directory -Name | sort CreationTime -desc | select -f 1) '\runtime\pgAdmin4.exe'
  5.  
  6. # echo out the resulting path to the exe so if the script is launched from powershell you can see the result
  7.  
  8. $pgpath
  9.  
  10. #launch the exe, note the format is due to the spaces in the path, dont change it!
  11. # & "$pgpath" # copy incase of oops....
  12. & "$pgpath"
  13.  
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement