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 Code PsLogging file creation error #13

Open
DixonDalmeida opened this issue Mar 21, 2020 · 2 comments
Open

Powershell Code PsLogging file creation error #13

DixonDalmeida opened this issue Mar 21, 2020 · 2 comments

Comments

@DixonDalmeida
Copy link

I am getting below error while executing PSLlogging via powershell core.

New-Item: C:\Users\Dixon\Documents\PowerShell\Modules\PSLogging\2.5.2\PSLogging.psm1:91:5
Line |
  91 |      New-Item -Path $sFullPath �ItemType File
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | A positional parameter cannot be found that accepts argument '�ItemType'.

The script works fine, Except it shows above Warning or error

@natiT
Copy link

natiT commented Jun 10, 2021

I get the same error within a try and catch block.
psm1. seems looking fine and it works fine in Windows Powershell 5.
image

Might be a encoding problem? Not using Englisch Version of Windows instead the German Version.

PSVersion Output:

Name Value


PSVersion 7.1.3
PSEdition Core
GitCommitId 7.1.3
OS Microsoft Windows 10.0.19042
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

@natiT
Copy link

natiT commented Jun 10, 2021

Just looking a little bit further and Downloaded the "manuel download" file from PowershellGallery and there seems to be a Problem in the File.
image

I just Removed everything again. Installed the Module via Powershell and then comment line 91 out and write it exactly the same in 92. Saved. Import-Module. And it works well now.

natiT added a commit to natiT/PSLogging that referenced this issue Jun 10, 2021
Fixed Importing Bug where in Powershell 6 and above the character - was not recognized (9to5IT#13)
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

2 participants