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 it and decided I’ll run an occasional series of questions and the information I’d […]
Archive for February, 2019
PowerShell interviews
Posted by: richardsiddaway | February 28, 2019 Comments Off on PowerShell interviews |PowerShell interview questions
Posted by: richardsiddaway | February 27, 2019 Comments Off on 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 brought up to date for PowerShell v5.1 and very few even mentioned v6.x. […]
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 with a trusted certificate can run. This includes anything you create on local machine. RemoteSigned […]
Processing files with switch
Posted by: richardsiddaway | February 25, 2019 Comments Off on 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 used to demonstrate processing files with switch. $fnum = 1 switch -file C:\test\Data.txt { […]
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 = “C:\test\outdata{0:00}.txt” -f $fnum $fnum ++ } Add-Content -Path $file -Value $_ } Initialise a […]
PowerShell operators
Posted by: richardsiddaway | February 24, 2019 Comments Off on 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 modular arithmetic – get the remainder after division -shl and –shr perform shift left and […]
Summing multiples
Posted by: richardsiddaway | February 22, 2019 Comments Off on 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 3 or 5 below 1000. The first thing to do is to read the problem very […]
The source of PowerShell cmdlets
Posted by: richardsiddaway | February 21, 2019 Comments Off on 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 of what you’ll find in C:\Program Files\PowerShell\6\Modules\ CimCmdlets Microsoft.PowerShell.Archive Microsoft.PowerShell.Diagnostics Microsoft.PowerShell.Host Microsoft.PowerShell.Management Microsoft.PowerShell.Security Microsoft.PowerShell.Utility Microsoft.WSMan.Management […]
PowerShell v6.1.3 install problem
Posted by: richardsiddaway | February 19, 2019 Comments Off on 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 this was overcome by changing the –WorkingDirectory parameter on the icon. This only […]
PowerShell v6.1.3
Posted by: richardsiddaway | February 19, 2019 Comments Off on 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 fixes to appear in the next release of v6.2 preview
Categories
- .NET
- Active Directory
- Architecture
- Azure
- Bash
- BITS
- Books
- CDXML
- CIM
- Cloud
- COM
- Containers
- Deep Dive
- Desired State Configuration
- DevOps
- DHCP
- DNS
- DSC
- European Summit
- Events
- Exchange
- File System
- Firewall
- General
- General IT Matters
- Hyper-V
- IIS
- Infrastructure
- IT Community
- IT Security
- Learning PowerShell
- Linux
- Math
- Microsoft
- Modules
- Nano Server
- Networking
- Office 2010
- Office 2013
- Open Source
- Opinion
- Outlook
- Philosophy
- PowerShell
- PowerShell 7
- PowerShell and .NET
- PowerShell and Active Directory
- PowerShell and CIM
- PowerShell and Exchange 2007
- PowerShell and IIS
- PowerShell and SQL Server
- PowerShell and WMI
- PowerShell Basics
- PowerShell original
- PowerShell Summit
- PowerShell User Group
- PowerShell User Group 2
- PowerShell v2
- PowerShell V3
- PowerShell v4
- PowerShell v5
- PowerShell v6
- PowerShell.org
- PowerShellGet
- PowerShellV2
- PSAM
- Rant
- Registry
- Scripting
- Scripting Games
- Scripting Games 2104
- Security
- SQL Server
- Storage
- Strings
- Summit
- Technology
- Uncategorized
- Virtualization
- Windows 10
- Windows 2012 R2
- Windows 7
- Windows 8
- Windows 8 Server
- Windows 8.1
- Windows Server
- Windows server 1709
- Windows Server 2008
- Windows Server 2008 R2
- Windows Server 2012
- Windows Server 2012 R2
- Windows Server 2016
- Windows Server 2019
- WMFv5
- WPF
- WSUS