PSKoans | interactive way to learn the PowerShell language | Command Line Interface library
kandi X-RAY | PSKoans Summary
kandi X-RAY | PSKoans Summary
A simple, fun, and interactive way to learn the PowerShell language through Pester unit testing.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of PSKoans
PSKoans Key Features
PSKoans Examples and Code Snippets
Community Discussions
Trending Discussions on PSKoans
QUESTION
I am using powershell for some time now, and just stumbled upon the PSKoan Project:
https://github.com/vexx32/PSKoans
On one of the very first koans I found some strange behaviour, I cant explain to my self. The koan about number types try to teach how powershell will convert variable types dynamically from int to long and from int to double on certain operations.
So I filled out the blanks (as expected during the course) of this specific pester test:
...ANSWER
Answered 2020-Jun-19 at 09:38Indeed, in the context of expressions (calculations), PowerShell indeed automatically widens anything that exceeds the max. value of [int]
/ [uint]
(32-bit signed / unsigned integers) or [long]
/ [ulong]
(64-bit) to [double]
, which is easy to verify[1]:
QUESTION
For starters, I'm on Fedora 30 using PSCore version 6.2.1. I've encountered this issue in GNOME Terminal and the vscode snap.
I'm on the first challenge of the PSKoans module and I'm stuck when trying to use a for loop. I am given an array of strings, each of which is a collection of strings separated by commas.
...ANSWER
Answered 2019-Jun-04 at 06:00ConvertFrom-Json in PowerShell Core has the coolest switch - AsHashTable. Try this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install PSKoans
From a normal powershell session run Get-ChildItem -Recurse | Unblock-File in that directory to remove the "downloaded from internet" flag that blocks them from running.
Check Get-ExecutionPolicy: if it says 'Restricted' or 'Undefined', you need to also run Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser in order to allow the scripts to run.
Add the repository folder to $env:PSModulePath so that PowerShell can see it. From the repository main folder, run: $env:PSModulePath = "$(Get-Location)$([IO.Path]::PathSeparator)${env:PSModulePath}"
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page