how to execute powershell ps1 scripts from package.json “scripts”?

Assuming powershell is in you PATH you can call it like this:

"scripts": {
    "test": "@powershell -NoProfile -ExecutionPolicy Unrestricted -Command ./test.ps1"
}

Tested on Windows 7 with Powershell v4.

Limitations are that you need Powershell installed and in your PATH. I didn’t test it with Powershell for Linux, so not sure if this solution will be portable to other platform for now.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)