I have a powershell script which im trying to read in and do some analysis on it. I'm able to read it only as bytes and not as plain text.
f=open('~/Data/3 - Get-Services - Jobs Version 1.0.ps1','r')
txt=f.read()
When i try the above code, im thrown an error.
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
So, I tried reading it as bytes and then decode it to plain text but but i'm still thrown the error.
f=open('~/Data/3 - Get-Services - Jobs Version 1.0.ps1','rb')
txt=f.read()
txt.decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
I looked up the data on command line and i noticed that all the files start with "��". I feel this charachter is causing the problem but i do not know how to solve this issue.
Could you please help