I am trying to run this ps command within a python script :
subprocess.call('powershell.exe $username = "[email protected]";$password = Get-Content "C:/Scripts/user.txt" | ConvertTo-SecureString;$cred = new-object -typename System.Management.Automation.PSCredential ` -argumentlist $username, $password;Connect-MsolService -Credential $cred;Get-MsolUser -UserPrincipalName user@example, shell=TRUE)
So basically as you can understand I call this command within the script and autologin in azure and get the user. My problem is that I am getting this error :
'ConvertTo-SecureString' is not recognized as an internal or external command, operable program or batch file.
Any ideas? Thank you so much in advance everybody.