Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PowerShell 7 - Enable-LogFile: Object reference not set to an instance of an object. #9

Open
mlueckert opened this issue Mar 11, 2020 · 11 comments

Comments

@mlueckert
Copy link

Dear All

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
@bm3n
Copy link

bm3n commented 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:

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.

@Jaykul
Copy link

Jaykul commented Aug 7, 2021

This has been fixed in source for a long time. You'll just have to build your own copy 😕

@acr-varonis
Copy link

@Jaykul it would be nice to have a new version in the gallery.

@DennisL68
Copy link

@dlwyatt, @rbernardino
When will a new version be released to PS Gallery?

@Jaykul
Copy link

Jaykul commented 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
Copy link
Owner

dlwyatt commented 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
Copy link

Jaykul commented 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
Copy link
Owner

dlwyatt commented 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
Copy link
Owner

dlwyatt commented 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
Copy link

Jaykul commented 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
Copy link

DennisL68 commented Jan 16, 2024

@Jaykul and @dlwyatt, any updates on the Source Code transfer and publication update on PS Gallery?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants