PowerShell for Windows Admins:

Powershell


May 26, 2017  8:53 AM

Diskpart and PowerShell – part 6: Multiple partitions on a disk

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Disk storage, Powershell

So far we’ve looked at creating a single partition on a disk. This time we’ll look at how you can create multiple partitions on a disk. The are good reasons not to do this but its something I’ve seen done on a frequent basis. Lets create a 20GB disk as an example and mount it

New-VHD...

May 23, 2017  11:35 AM

PowerShell in Azure Cloud Shell

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Azure, Powershell

if you are an Azure user see this post from the PowerShell team about the Azure Cloud Shell - 0 Comments     RSS Feed     Email a friend


May 22, 2017  1:11 PM

Diskpart and PowerShell – part4: Remove a partition

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Disk storage, Powershell

So far you’ve seen how to create and modify partitions and volumes. Its now time to look at how you remove a partition. Mount the test VHD

Get-VHD -Path C:\test\Test1.vhdx | Mount-VHD
You can’t remove a volume – you have to remove the partition. Identifying the CORRECT...


May 21, 2017  1:50 PM

Diskpart and PowerShell–part 4: Expand a volume

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Disk storage, Powershell

You've seen how to create a volume but how do you expand a volume? Let’s create a new disk and mount it

New-VHD -Path C:\test\Test1.vhdx -Dynamic -SizeBytes 20GB
Get-VHD -Path C:\test\Test1.vhdx | Mount-VHD
Initialize-Disk -Number 1
This time we’ll create a volume that...


May 18, 2017  2:24 PM

Table or List

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

A question on the forum asked why a object is displayed in a table if it has 4 or fewer properties and as  a list if it  has more than 4 properties:

PS> [PSCustomObject]@{P1=1; P2=2; P3=3; P4=4}

P1 P2 P3 P4
-- -- -- --
 1  2  3  4


PS> [PSCustomObject]@{P1=1; P2=2;...


May 10, 2017  3:39 AM

PowerShell v6 beta

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

PowerShell v6 has reached a significant milestone – the release of the first PowerShell v6 beta version. There have been 18 releases of alpha code since August 2016 when the open source PowerShell v6 project started. There is no indication of how many beta releases there will be before...


May 9, 2017  3:23 AM

Are your domain controllers real?

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Active Directory, CIM, Powershell

A question on the forum asked about discovering if domain controllers are physical or virtual machines. In other words Are your domain controllers real? This will do the job:

foreach ($domain in (Get-ADForest).domains) {
 Get-ADDomainController -filter * -server $domain |
 sort hostname...


May 1, 2017  3:33 PM

Positional parameters

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

Positional parameters have been around since the beginning of PowerShell. Positional parameters assume the parameter you mean from the position of the value in the command you supply. For instance you can do this:

Get-ChildItem -Path C:\test\ -Filter *.xml
Path and filter are the 2...


April 30, 2017  1:26 PM

ISE or VS code?

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

When PowerShell v2 shipped with the ISE it was seen as a great step forward. We now had a decent editor for creating PowerShell code and running that code. You could also invoke the debugger. Some extensions to ISE have occurred, most notably  Show-Command, but its essentially the same editor as...


April 28, 2017  2:22 PM

Mass dismount VHDs

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell, Virtual Disk

I’m going to be creating, using and discarding a number of VHDs for my diskpart and PowerShell series. When I have a number of them mounted I want a quick way to dismount them. Assuming I consistently keep them in the same folder then this very nicely does the job Get-ChildItem -Path C:\test\...


Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: