Powershell: Stress your CPU with some Prime Numbers

#get number of cores
$cpu = Get-WmiObject win32_processor | Select-Object Numberoflogicalprocessors
$cores = [convert]::ToInt32($cpu.Numberoflogicalprocessors, 10)

#define functions
function get-prime($i){
     for ($a=3; $a -lt $i; $a++){
        if ($i % $a -eq 0){
            return "no"
#create a task for each core
foreach ($core in 1..$cores){
    start-job -ScriptBlock {
        for ($i=1000000; $i -le 10000000; $i++){
            $prime = get-prime($i)
            if ($prime -ne "no"){
                write-output "$i"
            else {}


Wait-job *
Receive-Job *

Snoverisms: POSH – Like programming with hand grenades Sticker

I stumbled upon a post in /r/powershell which linked to this site: http://snoverisms.com/
I liked the first quote so much that I made a sticker with a Silhouette printer!
Here’s the PNG (In Silhouette you have to insert PNG’s and later convert them to svg like files … whatever): powershell

The stickers look like this
here’s the positive:

and here’s the negative (already on my notebook sorry!):

MOTD for Powershell (Using the fortune-mod (linux) Package files)

I downloaded and altered the fortune-mod fortune files so that there’s one fortune per line. This can be downloaded here:

Next step is to add the following thing to your $Profile

function get-motd{
$fortunes = get-content \path\to\fortunes.txt
get-random -InputObject $fortunes

It’s virtually important that you run the function after the clear-host. Otherwise the quote will not appear / will be erradicated before it even had time to present itself to you)