9to5it / pslogging Goto Github PK
View Code? Open in Web Editor NEWEasily create and manage logging of events for all of your PowerShell scripts
License: GNU General Public License v2.0
Easily create and manage logging of events for all of your PowerShell scripts
License: GNU General Public License v2.0
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
Issue
PS > update-help
update-help : Failed to update Help for the module(s) 'PSLogging' with UI culture(s) {en-US} : Unable to retrieve the
HelpInfo XML file for UI culture en-US. Make sure the HelpInfoUri property in the module manifest is valid or check
your network connection and then try the command again.
At line:1 char:1
- CategoryInfo : ResourceUnavailable: (:) [Update-Help], Exception
- FullyQualifiedErrorId : UnableToRetrieveHelpInfoXml,Microsoft.PowerShell.Commands.UpdateHelpCommand
Workaround
Remove value for HelpInfoURI in the file PSLogging.psd1
Resolution
Transform comment based help to xml-based (?)
Thanks for the great logging package! With Powershell 2.0, when I call:
PS > Import-Module pslogging
I get the following error the following error:
Import-Module : The '~\Documents\WindowsPowerShell\Modules\pslogging\pslogging.psd1'
module cannot be imported because its manifest contains one or more members
that are not valid. The valid manifest members are (--list-of-members--).
Remove the members that are not valid ('RootModule', 'HelpInfoURI'), then try
to import the module again.
In powershell 2.0 the equivalent of "RootModule" is "ModuleToProcess", and there is no equivalent to "HelpInfoURI". Fortunately, renaming "RootModule" as "ModuleToProcess" and commenting out "HelpInfoURI" did the trick.
This issue could be resolved by mentioning these changes that are required for PS 2.0 in your README.md
Also, in case it's useful for identifying versions of PS to which these changes apply, here is my $PSVersionTable
:
Name Value
CLRVersion 2.0.50727.5485
BuildVersion 6.1.7601.17514
PSVersion 2.0
WSManStackVersion 2.0
PSCompatibleVersions {1.0, 2.0}
SerializationVersion 1.1.0.1
PSRemotingProtocolVersion 2.1
PSLogging.psm1
line#91
Before:
New-Item -Path $sFullPath –ItemType File
After:
New-Item -Path $sFullPath **-**ItemType File
I happen to run this function under Korean Windows 10 and it failed to create a new-item.
First of all, thank you for this wonderful logging module
....imho the timestamp should be at the beginning of a line....
I think the log file will be easier to read
or even better, use the full cmtrace format (with a parameter) ;-)
http://blogs.msdn.com/b/rslaten/archive/2014/07/28/logging-in-cmtrace-format-from-powershell.aspx
or
https://gallery.technet.microsoft.com/scriptcenter/Log-ScriptEvent-Function-ea238b85
We need an extra paramter to log to the eventviewer
The new standard way is to split all the functions in the module to seperate files in the folders private or public
And export the log to csv, xml and json would be a nice feature too
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.