Monthly Archives: February 2019

PowerShell interviews

Following my last post about sample questions for PowerShell interviews that I’d stumbled across I’ve been asked what sort of questions I’d ask – given my statement that many of the question sets were out of date. I’ve thought about … Continue reading

Posted in Powershell | Leave a comment

PowerShell interview questions

For some bizarre reason I ended up looking at various sets of PowerShell interview questions and answers. For the most part they scared me – due to their outdated nature. Many, if not most,  of  the question sets hadn’t been … Continue reading

Posted in Powershell | 1 Comment

Execution policy

PowerShell gives you a number of options regarding execution policy. You use one of the following options with Set-Execution policy: Restricted – won’t run scripts or profiles. This is the default execution policy Allsigned – only scripts (and profiles) signed … Continue reading

Posted in Powershell | 1 Comment

Processing files with switch

The switch statement has a –file parameter that can be used to give the path to a file. The file is read one line at a time and processed through the switch statement. The example from last time can be … Continue reading

Posted in Powershell | 1 Comment

Splitting a file

Saw a question about splitting a file that had repeating data blocks.  Each block starts with HOST so the code to split becomes: $fnum = 1 Get-Content -Path C:\test\Data.txt | ForEach-Object -Process {   if ($_ -like ‘HOST*’) {      $file = … Continue reading

Posted in Powershell | Leave a comment

PowerShell operators

PowerShell has operators – lots of operators. This is a quick overview of the PowerShell Operators. The obvious place to start is the arithmetic operators –  see about_Arithmetic_Operators +, –, *, / perform the four arithmetic operations % is for … Continue reading

Posted in Powershell | Leave a comment

Summing multiples

Came across the project Euler web site – https://projecteuler.net. It has literally hundreds of problems – mainly mathematical – that’ll illustrate some useful PowerShell techniques. The first problem is summing multiples. You need to sum all of the multiples of … Continue reading

Posted in Powershell | 1 Comment

The source of PowerShell cmdlets

The source of PowerShell cmdlets seems to cause a lot of confusion. The first point is that the PowerShell team, and now the open source project, are only responsible for the PowerShell engine and the core modules – basically most … Continue reading

Posted in Powershell | Leave a comment

PowerShell v6.1.3 install problem

PowerShell v6.1.3 install problem prevented my from changing the working directory. The introduction of the –WorkingDirectory parameter pwsh.exe has caused problems – usually forcing PowerShell to ignore any directives in your profile to set a working folder.  In previous versions … Continue reading

Posted in PowerShell v6 | Leave a comment

PowerShell v6.1.3

PowerShell v6.1.3 has been released – https://github.com/PowerShell/PowerShell/releases It primarily fixes the security issues from CVE-2019-0627 CVE-2019-0631 CVE-2019-0632 which are to do with User Mode Code Integrity policy bypasses and CVE-2019-0657 which is to do with domain spoofing I expect the … Continue reading

Posted in PowerShell v6 | Leave a comment