Home » Questions » Computers [ Ask a new question ]

Equivalent of bash's `source` command in Powershell?

Equivalent of bash's `source` command in Powershell?

To run a bash script line-by-line (so as to preserve environment variables, for instance), one does the following:

Asked by: Guest | Views: 150
Total answers/comments: 1
Guest [Entry]

"You can ""dot source"" in PowerShell as well. You just need to make sure that you specify the full path. So, if the script you want to load is in the local directory you would do:

PS C:\>. .\myscript.ps1"