I run this code to execute PowerShell code from an react native application:

Solved by :
- Run powershell as adminstrator
- Check excecution policy by running:
Get-ExecutionPolicy
- Then u will see ‘Restricted’, means the main reason to run ur script been restricted
- To change this policy, can run :
Set-ExecutionPolicy Unrestricted
- Then fixed, u can run ur script again