Hi all,
Sorry for the very vague topic title, but i wanted a title that sort of referenced what i was going to ask for without it being too long.
So “How does more experienced PowerShell scripter’s do this” ??
I would like to ask how does more experienced scripters work with the PowerShell console when running scripts and some script depends on other scripts etc etc.
So to give a short background. I tend to have a PowerShell profile that more or less just say:
Set-Location -Path C:\Scripts
I do that because i like to land in my script folder. where i keep subfolders for other scripts or able to keep function ps1 files etc for easier use.
So i know that i can . source ps1 files in either a another script file or in my PowerShell Profile script file so that i can take advantage of calling functions easier like Connect-EXhangeOnPrem without the need of doing "Set-Location -Path “C:\Scripts\Connect-ExchangeOnPrem” after which now i can run .\Connect-ExchangeOnPrem.
So yes i can . source in my profile or in a script to easier get functions from another ps1 file. but today i learned that if you have a script named Get-Link.PS1 and you put in in a folder that is in your environment PATH then you can be in C:\ location and still run .\Get-Link which i thought ok that is neat.
So how do more experienced scripters do this? I guess we will never get away from . sourcing files into scripts as they needs dependencies as they run. But if you are just wanting to open your console and be able to work easier with functions and other scripts that are in your script repo, what do people do?