Please use below sample script to execute powershell scripts via python,
Note: Powershell scripts must be available in the endpoint.
import os;
setpolicy=os.popen('powershell "Set-ExecutionPolicy -ExecutionPolicy Unrestricted" ').read();
print(setpolicy);
run=os.popen('powershell "C:\\Users\\Max\\Desktop\\listlogfiles.ps1" ').read();
print(run)
powershell script listlogfiles.ps1
write-host "List of log files in the mentioned directory" ;
Get-Childitem C:\Windows\*.log
sample output would be as below,