Forum Discussion

SteveDahlberg's avatar
2 days ago

New to LM: How do I refer to the local filesystem in an embedded PowerShell script of a DataSource?

How do I refer to the local filesystem in an embedded PowerShell script of a DataSource? The below works fine from a PowerShell session console on a Collector server, but fails when running embedded in LogicMonitor. The Active Directory LogicMonitor service account is in the local Administrators group on the Resource server (a LM Collector server in this), same as my admin account using the PowerShell session. It also has explicit NTFS "Full Control" rights on the folder in the path variable below. 

Do I have to use the Get-PSDrive cmndlet? Or is there a simple way to do it when running embedded in the LogicMonitor environment?

$textFilePath = 'C:\ps\LM-custom_list.txt' $localList = Get-Content -Path $textFilePath

-Steve

No RepliesBe the first to reply