You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PowerShell 7 - Enable-LogFile: Object reference not set to an instance of an object. #9
When trying to use the module in PowerShell 7 I get the following error.
C:\> import-module PowerShellLogging
C:\> Enable-LogFile -Path "c:\temp\test.txt"
ErrorCallback Path Streams DateTimeFormat
------------- ---- ------- --------------
C:\temp\test.txt All r
Enable-LogFile: Object reference not set to an instance of an object.
Thank you very much.
Marc
$PSVersionTable
Name Value
---- -----
PSVersion 7.0.0
PSEdition Core
GitCommitId 7.0.0
OS Microsoft Windows 10.0.18363
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
get-module -Name PowerShellLogging
ModuleType Version PreRelease Name ExportedCom
---------- ------- ---------- ---- -----------
Script 1.3.0 PowerShellLogging {Disable-Lo
After upgrading from PS 5.1 to 7.0.3 logging stopped working with the same error reported above.
Here's the stack trace:
Object reference not set to an instance of an object.
at PSLogging.HostIOInterceptor.AttachToHost(PSHost host)
at PSLogging.Commands.EnableLogFileCommand.EndProcessing()
at System.Management.Automation.CommandProcessorBase.Complete()
$PSVersionTable
Name Value
---- -----
PSVersion 7.0.3
PSEdition Core
GitCommitId 7.0.3
OS Microsoft Windows 6.3.9600
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0.}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Get-Module -Name PowerShellLogging
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Script 1.3.0 PowerShellLogging {Disable-LogFile, Disable-OutputSubscriber, Enabl.
Can you transfer the project to the PoshCode and add me there too, so I can deal with issues?
Oh, and yes -- and the account is connected to my email at huddledmasses.org still.
feel free to update the links on psgallery to point to a new location for the project site, but I'd rather keep my old projects here. Might need the resume material someday lol.
@Jaykul Good to see that you've got the shared ownership over at PS Gallery 👍
Now, you actually don't need to fork this repo. You could do a "dirty hijack" by starting a clean project instead (maybe with another name) here at GitHub with an uninitialized repo, and then just push a local git clone of this repo to that remote instead.
Then this repo would just have to be marked abandoned and a manual link entered in this ReadMe to the new project.
Activity
bm3n commentedon Nov 10, 2020
After upgrading from PS 5.1 to 7.0.3 logging stopped working with the same error reported above.
Here's the stack trace:
Jaykul commentedon Aug 7, 2021
This has been fixed in source for a long time. You'll just have to build your own copy 😕
acr-varonis commentedon Jan 22, 2023
@Jaykul it would be nice to have a new version in the gallery.
DennisL68 commentedon Dec 11, 2023
@dlwyatt, @rbernardino
When will a new version be released to PS Gallery?
Jaykul commentedon Dec 16, 2023
I'd have to fork it, I think. Not sure I can take over someone else's module in the gallery.
dlwyatt commentedon Dec 16, 2023
Is your username just @Jaykul in psgallery? I can add you as an owner there. I haven't used or tested this thing in ages :)
Jaykul commentedon Dec 16, 2023
Can you transfer the project to the PoshCode and add me there too, so I can deal with issues?
Oh, and yes -- and the account is connected to my email at huddledmasses.org still.
dlwyatt commentedon Dec 16, 2023
You can fork the git repo, no need to move that. I just added you as an owner in psgallery so you can publish new stuff :)
dlwyatt commentedon Dec 16, 2023
feel free to update the links on psgallery to point to a new location for the project site, but I'd rather keep my old projects here. Might need the resume material someday lol.
Jaykul commentedon Dec 16, 2023
Yeah, that's fine. I'll swap it. It's just that actual fork repos can't have issues. But I'll deal with it ;)
DennisL68 commentedon Jan 16, 2024
@Jaykul and @dlwyatt, any updates on the Source Code transfer and publication update on PS Gallery?
DennisL68 commentedon Feb 10, 2025
@Jaykul Good to see that you've got the shared ownership over at PS Gallery 👍
Now, you actually don't need to fork this repo. You could do a "dirty hijack" by starting a clean project instead (maybe with another name) here at GitHub with an uninitialized repo, and then just push a local git clone of this repo to that remote instead.
Then this repo would just have to be marked abandoned and a manual link entered in this ReadMe to the new project.
DennisL68 commentedon Jun 2, 2025
@Jaykul Did we get a new repo of this project or how was this handled?
Jaykul commentedon Jun 2, 2025
Oh, yes. I put it in the PoshCode org:
https://github.com/PoshCode/PowerShellLogging
Spectrum1981 commentedon Sep 15, 2025
Hi!
I have the Same issue now. How can I build my own copy? Is there a manual?
Thank you!
Jaykul commentedon Sep 21, 2025
There are simple directions in the readme