Closed ReneH-cnx closed 2 years ago
The util is mostly kept around for finding the ps1
files in the scripts folder. It uses the Python API to get the raw content of Python resources and isn't really designed for reading any file on the filesystem.
In reality it takes 2 lines to read any file locally on your file system
with open("/path/to/local/script.ps1", mode="r") as fd:
script = fd.read()
Considering the simple nature and extreme flexibility you have by reading the script yourself I'm not sure I see the benefit of doing this inside pypsrp. Appreciate the suggestion but at this point this is not something I plan on implementing sorry.
It seems like the function
get_pwsh_script()
in_utils.py
would be really useful for any locally available PowerShell script files that needs to be executed on the remote machine.Could it be added as a more generic method to one of the classes? I'm not quite sure which one would be best to add it to. Perhaps to
PowerShell
whereadd_script()
can be found?