Quantcast
Channel: Brainteaser – PowerShell Magazine
Browsing all 12 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Reverse text line

  Advanced Reverse a line of text without the use of Array’s Reverse method, Array indices, Array notation, pipelines or loop statements. Click the icons below for answer and explanation. .  <span...

View Article



Image may be NSFW.
Clik here to view.

Format elements

  Advanced Given an Array of at least 2 elements, return a new Array of formatted elements without using array indices, pipelines or loop statements. Click the icons below for answer and explanation. ....

View Article

Image may be NSFW.
Clik here to view.

Private variable

  Advanced Attain the value of a private variable declared in a child scope from that scope’s own child scope. Click the icons below for answer and explanation. .  <span style="color:...

View Article

Image may be NSFW.
Clik here to view.

Enum’s numeric values

  Advanced Without any loop statements or pipelines, get the numeric values of an Enum (such as IO.FileAttributes) in 1 statement. Click the icons below for answer and explanation. .  <span...

View Article

Image may be NSFW.
Clik here to view.

Find an unused drive letter

Your task is to write the shortest code to find one of the unused drive letters (excluding a,b and c). PowerShell’s default aliases are allowed. You have one week.  Answers should be posted as a...

View Article


Image may be NSFW.
Clik here to view.

Convert a string to a character array

Hello everyone! We are back with a series of Brain Teasers. In the next 3 weeks we will publish one teaser per week. It will run until Friday and the winner will be announced on the next Monday, taking...

View Article

Assign a list of processes to a variable and output it to the console

Hello everyone! The Brain Teaser series continues. First, we need to announce the winner of the previous brain teaser. We got a lot of answers, but only three of them fulfilled all requirements ( the...

View Article

Find a list of all IP addresses assigned to the local system

Hello everyone! The Brain Teaser series continues. First, we would like to announce the winner of the previous brain teaser. We got a few answers in which many of them have a command length of 8. The...

View Article


Output only the palindromic words

Hello everyone! The Brain Teaser series continues. First, we would like to announce the winner of the previous brain teaser. We got a number of very interesting and creative solutions. The shortest...

View Article


Image may be NSFW.
Clik here to view.

Get the last modified date and time

Before we dive into this week’s teaser we would like to announce the winner of last week’s challenge. Ioan Corcodel, congratulations! You take with you a copy of Microsoft Windows PowerShell 3.0 First...

View Article

Image may be NSFW.
Clik here to view.

Brain teaser – one way to solve it

This is the command I had initially in mind when writing the last modified time teaser: ls $pshome\powershell.exe|date I also had this one, which is shorter: ps -id $pid|gi|date But I specifically...

View Article

Image may be NSFW.
Clik here to view.

Converting to size units – our solution and the winner

The task was to convert a number to the size units without using the built-in multipliers. Thank you all for taking the time to participate in this teaser. Now, let’s present the solution we had in...

View Article
Browsing all 12 articles
Browse latest View live




Latest Images