Comments (12)
Woah, that is a weird one. Can you try Reset-PSKoan -Topic AboutXml
? And also please send over your local copies of the files for AboutClasses and AboutXml topics!
from pskoans.
I did find the Reset CmdLet
AboutClasses.Koans.ps1.txt
AboutXml.Koans.ps1.txt
The AboutXML
does not look right.
After Reset, it now is back to normal:
AboutXml.Koans.ps1.txt
Still contemplating, will report back once Show-Karma
provides output
from pskoans.
Looks OK now.
Describing "About XML" has damaged your karma.
:)
from pskoans.
Thanks!
@indented-automation have you seen that happen before, by any chance?
from pskoans.
❯ show-Karma -Contemplate
Resolve-Path : Cannot bind argument to parameter 'Path' because it is null.
At C:\Users\David\Documents\WindowsPowerShell\Modules\PSKoans\0.67.1\Public\Show-Karma.ps1:124 char:50
+ '"{0}":{1}' -f (Resolve-Path $FilePath), $LineNum ...
+ ~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Resolve-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.ResolvePath
Command
that still is there... and now the AboutXML.ps1 is broken again. weird.
from pskoans.
Any chance you can share your library?
Reset is quite difficult if the file it's attempting to reset has syntax errors. It's reliant on AST to parse, locate, and replace parts. Resetting the entire file should be more successful. Would need a sample to debug it though.
from pskoans.
Can do, what do you need and how/where should I upload it?
from pskoans.
Now that I have started to work on XMLs and read it, I think I might have a clue as to why it breaks, maybe even a hint to resolve it:
Show-Karma
is executing the code and post that the ps1 file content is this:
<documentRoot>
<element>This is still a short XML file</element>
</documentRoot>
This is present in the file here:
It 'is much faster to use the Load method of XmlDocument for large files' {
Set-Content -Path $path -Value @'
<documentRoot>
<element>This is still a short XML file</element>
</documentRoot>
'@
does $Path
here point to its own file instead of to the TestDrive?
The previous assertion (It 'can convert output from Get-Content to an XML document' {
) has a Join-Path
in front, is that missing in It 'is much faster to use the Load method of XmlDocument for large files'
It 'can convert output from Get-Content to an XML document' {
<#
It is often desirable to read an XML file to work with in PowerShell.
Get-Content is often used to read XML content in as text.
#>
$path = Join-Path -Path $TestDrive -ChildPath document.xml
Set-Content -Path $path -Value @'
<documentRoot>
<element>A short XML file</element>
</documentRoot>
'@
from pskoans.
ok. this works now for me
The current I think also would resolve this:
BeforeAll {
$path = Join-Path $TestDrive -ChildPath document.xml
}
Closing :)
from pskoans.
Glad you got it sorted! We should probably fix this as well, so reopening for now until we get it sorted. Feel free to unsubscribe from the issue if you don't wanna need to get notifs for it in future. 💖
from pskoans.
oh. I thought I close it, because I spotted that the fix (the BeforeAll
statement) you have already in the document (just not in the one I download by using the Reset)
from pskoans.
Ah, you're right, good point. Looks like we just need to get that into a release of the module at some point. Cheers! 😁
from pskoans.
Related Issues (20)
- Problem in koan AboutModules
- Koan AboutSelectObject has undesired error
- Problem with different PowerShell versions in koan AboutSortObject
- Topics solved before starting in koan AboutComparison
- Show-Karma failed on relatively fresh installation HOT 6
- AboutCmdletVerbs.Koans.ps1 - Forward slash in $Filename results in wrong string comparison at the end HOT 2
- AboutGetMember.Koans.ps1 does not return correct result HOT 4
- AboutPSProviders.Koans.ps1 - thows errors (may be unavoidable) HOT 8
- Recursion on $home throws UnauthorizedAccessException - Local Issue HOT 4
- Enumeration time is quite long the more you progress HOT 2
- AboutRedirection misses some spaces in output?
- Get-Unique is used on unsorted collections
- AboutAssignmentAndArithmetic: ExpectedMessage and implicit character ranges in Pester 5 HOT 1
- Show-Karma fails after repo-based installation HOT 2
- AboutBitwiseOperations - Error in description? HOT 1
- VScode error: Could not find the module 'PSKoans'. commands typed in console window work fine. HOT 2
- About XML addresses $RootElement but that changes with the next test HOT 1
- Regex: $matches[0] is empty within "It does not need to match the entire string" and "It is not just an array of text"
- AboutNumbers wrong types HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pskoans.