Logging Target (New-PSULoggingTarget usage)

Product: PowerShell Universal
Version: 4.0.2

What is the correct syntax for creating new logging targets in 4.0.2? Ive tried what I found in a blog post:

New-PSULoggingTarget -Type 'file' -FilePath 'C:\ProgramData\PowerShellUniversal\Debug\log-System.txt' -Scope System

but -FilePath is not an accepted parameter. Ive also tried setting it in the -Properties parameter like this:

New-PSULoggingTarget -Type 'file' -Properties @{"Path = "'C:\ProgramData\PowerShellUniversal\Debug\log-System.txt' } -Scope System

and I just get an error stating that the property “Path” is not accepted (I also tried this with different property names, “file path”, “filepath”, “file” etc.) Im unable to create one inside PowerShell universal as I just get the error “Object not set to an instance of an object”


The docs are really sparse on this subject.

Where do you define New-PSULoggingTarget ?

I created a logging.ps1 file in the repo. It seems to overwrite the default logging config thats there without it so i assumed that was correct.

One of my servers has no logging targets at all anymore :partying_face:

The instructions have not really helped me so far either.

One of two server is missing default logging targets - PowerShell Universal - Ironman Software Forums

If any of you know more about this in the meantime I would be happy if someone could share his experiences with me :heart: