Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to call PowerShell script from WSL?

In my Windows directory

C:\Users\jholmes\pichak\analytics

I have run1.ps1 code. I run wsl.exe, now my pwd is

   /mnt/c/WINDOWS/system32

How to point to the first path and execute the script?

like image 310
MikiBelavista Avatar asked Nov 29 '25 05:11

MikiBelavista


1 Answers

In WSL2, using the -File option worked for me:

powershell.exe -File path/to/script.ps1
like image 85
Abdull Avatar answered Nov 30 '25 23:11

Abdull



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!