Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Powershell Partition Information

13 Oct 2016   #1
Nasty7

Windows 7 Home Premium 64bit
 
 
Powershell Partition Information

Hey guys, I was looking for an alternative to "diskpart" in Powershell, but all that I tried did not even work, can't imagine what I'm doing wrong. Just trying to learn, not super important if folks are busy. Here is one of the things I tried from Technet, along with many others:
Get-Partition

1. Get-Partition
And tried it many different ways, get-partition, get-partition-0 etc, etc. many different ways.

2. I also used diskpart as regular user, but it would not allow me to "Select All" CTRL + C to Copy the Partition info. I had to Open CMD as Administrator in order to do this, is that Normal? Just want to make sure my system is working properly.

I was hoping for something simple, I saw some rather complicated Commands that I avoided for now but open to anything I guess. Seems like diskpart works very well, the output is very nice, but I find the CMD a little quirky compared to say Linux Terminal.

Thanks, Nasty7


My System SpecsSystem Spec
.
14 Oct 2016   #2
Tira96

Win7
 
 

Have you been read this article? It's can help you.
My System SpecsSystem Spec
14 Oct 2016   #3
Nasty7

Windows 7 Home Premium 64bit
 
 

Haha, that is way over my head. I need something more simple, and don't know why the commands I linked to don't work. Thanks though, that looks interesting.
My System SpecsSystem Spec
.

14 Oct 2016   #4
Tira96

Win7
 
 

Quote   Quote: Originally Posted by Nasty7 View Post
Haha, that is way over my head. I need something more simple, and don't know why the commands I linked to don't work. Thanks though, that looks interesting.
Sorry, I've tried
My System SpecsSystem Spec
14 Oct 2016   #5
Nasty7

Windows 7 Home Premium 64bit
 
 

I think I'm just not understanding this article, and the process it is describing. Probably because there are no good expamples.
Get-Partition
My System SpecsSystem Spec
14 Oct 2016   #6
Nasty7

Windows 7 Home Premium 64bit
 
 

Looks like Powershell is not going to do the same as dispart as well or as easily.
My System SpecsSystem Spec
14 Oct 2016   #7
Pyprohly

Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
 
 

Hi,

Get-Partition is part of a big module of neat cmdlets that deal with partitions, disks, etc., which can very well replace Diskpart if preferred.

This is the extent of the Storage module as of PowerShell v5 (Windows 10). As you can probably infer, it has quite a bit more capability on offer over Diskpart, about 140 cmdlets to play around with.

Get-Command -Module Storage
 
Code:
PS C:\Users\Pyprohly> Get-Command -Module Storage

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Alias           Disable-PhysicalDiskIndication                     2.0.0.0    Storage
Alias           Disable-StorageDiagnosticLog                       2.0.0.0    Storage
Alias           Enable-PhysicalDiskIndication                      2.0.0.0    Storage
Alias           Enable-StorageDiagnosticLog                        2.0.0.0    Storage
Alias           Flush-Volume                                       2.0.0.0    Storage
Alias           Get-DiskSNV                                        2.0.0.0    Storage
Alias           Get-PhysicalDiskSNV                                2.0.0.0    Storage
Alias           Get-StorageEnclosureSNV                            2.0.0.0    Storage
Alias           Initialize-Volume                                  2.0.0.0    Storage
Alias           Write-FileSystemCache                              2.0.0.0    Storage
Function        Add-InitiatorIdToMaskingSet                        2.0.0.0    Storage
Function        Add-PartitionAccessPath                            2.0.0.0    Storage
Function        Add-PhysicalDisk                                   2.0.0.0    Storage
Function        Add-TargetPortToMaskingSet                         2.0.0.0    Storage
Function        Add-VirtualDiskToMaskingSet                        2.0.0.0    Storage
Function        Block-FileShareAccess                              2.0.0.0    Storage
Function        Clear-Disk                                         2.0.0.0    Storage
Function        Clear-FileStorageTier                              2.0.0.0    Storage
Function        Clear-StorageDiagnosticInfo                        2.0.0.0    Storage
Function        Connect-VirtualDisk                                2.0.0.0    Storage
Function        Debug-FileShare                                    2.0.0.0    Storage
Function        Debug-StorageSubSystem                             2.0.0.0    Storage
Function        Debug-Volume                                       2.0.0.0    Storage
Function        Disable-PhysicalDiskIdentification                 2.0.0.0    Storage
Function        Disable-StorageEnclosureIdentification             2.0.0.0    Storage
Function        Disable-StorageHighAvailability                    2.0.0.0    Storage
Function        Disconnect-VirtualDisk                             2.0.0.0    Storage
Function        Dismount-DiskImage                                 2.0.0.0    Storage
Function        Enable-PhysicalDiskIdentification                  2.0.0.0    Storage
Function        Enable-StorageEnclosureIdentification              2.0.0.0    Storage
Function        Enable-StorageHighAvailability                     2.0.0.0    Storage
Function        Format-Volume                                      2.0.0.0    Storage
Function        Get-DedupProperties                                2.0.0.0    Storage
Function        Get-Disk                                           2.0.0.0    Storage
Function        Get-DiskImage                                      2.0.0.0    Storage
Function        Get-DiskStorageNodeView                            2.0.0.0    Storage
Function        Get-FileIntegrity                                  2.0.0.0    Storage
Function        Get-FileShare                                      2.0.0.0    Storage
Function        Get-FileShareAccessControlEntry                    2.0.0.0    Storage
Function        Get-FileStorageTier                                2.0.0.0    Storage
Function        Get-InitiatorId                                    2.0.0.0    Storage
Function        Get-InitiatorPort                                  2.0.0.0    Storage
Function        Get-MaskingSet                                     2.0.0.0    Storage
Function        Get-OffloadDataTransferSetting                     2.0.0.0    Storage
Function        Get-Partition                                      2.0.0.0    Storage
Function        Get-PartitionSupportedSize                         2.0.0.0    Storage
Function        Get-PhysicalDisk                                   2.0.0.0    Storage
Function        Get-PhysicalDiskStorageNodeView                    2.0.0.0    Storage
Function        Get-ResiliencySetting                              2.0.0.0    Storage
Function        Get-StorageAdvancedProperty                        2.0.0.0    Storage
Function        Get-StorageDiagnosticInfo                          2.0.0.0    Storage
Function        Get-StorageEnclosure                               2.0.0.0    Storage
Function        Get-StorageEnclosureStorageNodeView                2.0.0.0    Storage
Function        Get-StorageEnclosureVendorData                     2.0.0.0    Storage
Function        Get-StorageFaultDomain                             2.0.0.0    Storage
Function        Get-StorageFileServer                              2.0.0.0    Storage
Function        Get-StorageFirmwareInformation                     2.0.0.0    Storage
Function        Get-StorageHealthAction                            2.0.0.0    Storage
Function        Get-StorageHealthReport                            2.0.0.0    Storage
Function        Get-StorageHealthSetting                           2.0.0.0    Storage
Function        Get-StorageJob                                     2.0.0.0    Storage
Function        Get-StorageNode                                    2.0.0.0    Storage
Function        Get-StoragePool                                    2.0.0.0    Storage
Function        Get-StorageProvider                                2.0.0.0    Storage
Function        Get-StorageReliabilityCounter                      2.0.0.0    Storage
Function        Get-StorageSetting                                 2.0.0.0    Storage
Function        Get-StorageSubSystem                               2.0.0.0    Storage
Function        Get-StorageTier                                    2.0.0.0    Storage
Function        Get-StorageTierSupportedSize                       2.0.0.0    Storage
Function        Get-SupportedClusterSizes                          2.0.0.0    Storage
Function        Get-SupportedFileSystems                           2.0.0.0    Storage
Function        Get-TargetPort                                     2.0.0.0    Storage
Function        Get-TargetPortal                                   2.0.0.0    Storage
Function        Get-VirtualDisk                                    2.0.0.0    Storage
Function        Get-VirtualDiskSupportedSize                       2.0.0.0    Storage
Function        Get-Volume                                         2.0.0.0    Storage
Function        Get-VolumeCorruptionCount                          2.0.0.0    Storage
Function        Get-VolumeScrubPolicy                              2.0.0.0    Storage
Function        Grant-FileShareAccess                              2.0.0.0    Storage
Function        Hide-VirtualDisk                                   2.0.0.0    Storage
Function        Initialize-Disk                                    2.0.0.0    Storage
Function        Mount-DiskImage                                    2.0.0.0    Storage
Function        New-FileShare                                      2.0.0.0    Storage
Function        New-MaskingSet                                     2.0.0.0    Storage
Function        New-Partition                                      2.0.0.0    Storage
Function        New-StorageFileServer                              2.0.0.0    Storage
Function        New-StoragePool                                    2.0.0.0    Storage
Function        New-StorageSubsystemVirtualDisk                    2.0.0.0    Storage
Function        New-StorageTier                                    2.0.0.0    Storage
Function        New-VirtualDisk                                    2.0.0.0    Storage
Function        New-VirtualDiskClone                               2.0.0.0    Storage
Function        New-VirtualDiskSnapshot                            2.0.0.0    Storage
Function        New-Volume                                         2.0.0.0    Storage
Function        Optimize-StoragePool                               2.0.0.0    Storage
Function        Optimize-Volume                                    2.0.0.0    Storage
Function        Register-StorageSubsystem                          2.0.0.0    Storage
Function        Remove-FileShare                                   2.0.0.0    Storage
Function        Remove-InitiatorId                                 2.0.0.0    Storage
Function        Remove-InitiatorIdFromMaskingSet                   2.0.0.0    Storage
Function        Remove-MaskingSet                                  2.0.0.0    Storage
Function        Remove-Partition                                   2.0.0.0    Storage
Function        Remove-PartitionAccessPath                         2.0.0.0    Storage
Function        Remove-PhysicalDisk                                2.0.0.0    Storage
Function        Remove-StorageFileServer                           2.0.0.0    Storage
Function        Remove-StorageHealthSetting                        2.0.0.0    Storage
Function        Remove-StoragePool                                 2.0.0.0    Storage
Function        Remove-StorageTier                                 2.0.0.0    Storage
Function        Remove-TargetPortFromMaskingSet                    2.0.0.0    Storage
Function        Remove-VirtualDisk                                 2.0.0.0    Storage
Function        Remove-VirtualDiskFromMaskingSet                   2.0.0.0    Storage
Function        Rename-MaskingSet                                  2.0.0.0    Storage
Function        Repair-FileIntegrity                               2.0.0.0    Storage
Function        Repair-VirtualDisk                                 2.0.0.0    Storage
Function        Repair-Volume                                      2.0.0.0    Storage
Function        Reset-PhysicalDisk                                 2.0.0.0    Storage
Function        Reset-StorageReliabilityCounter                    2.0.0.0    Storage
Function        Resize-Partition                                   2.0.0.0    Storage
Function        Resize-StorageTier                                 2.0.0.0    Storage
Function        Resize-VirtualDisk                                 2.0.0.0    Storage
Function        Revoke-FileShareAccess                             2.0.0.0    Storage
Function        Set-Disk                                           2.0.0.0    Storage
Function        Set-FileIntegrity                                  2.0.0.0    Storage
Function        Set-FileShare                                      2.0.0.0    Storage
Function        Set-FileStorageTier                                2.0.0.0    Storage
Function        Set-InitiatorPort                                  2.0.0.0    Storage
Function        Set-Partition                                      2.0.0.0    Storage
Function        Set-PhysicalDisk                                   2.0.0.0    Storage
Function        Set-ResiliencySetting                              2.0.0.0    Storage
Function        Set-StorageFileServer                              2.0.0.0    Storage
Function        Set-StorageHealthSetting                           2.0.0.0    Storage
Function        Set-StoragePool                                    2.0.0.0    Storage
Function        Set-StorageProvider                                2.0.0.0    Storage
Function        Set-StorageSetting                                 2.0.0.0    Storage
Function        Set-StorageSubSystem                               2.0.0.0    Storage
Function        Set-StorageTier                                    2.0.0.0    Storage
Function        Set-VirtualDisk                                    2.0.0.0    Storage
Function        Set-Volume                                         2.0.0.0    Storage
Function        Set-VolumeScrubPolicy                              2.0.0.0    Storage
Function        Show-VirtualDisk                                   2.0.0.0    Storage
Function        Start-StorageDiagnosticLog                         2.0.0.0    Storage
Function        Stop-StorageDiagnosticLog                          2.0.0.0    Storage
Function        Stop-StorageJob                                    2.0.0.0    Storage
Function        Unblock-FileShareAccess                            2.0.0.0    Storage
Function        Unregister-StorageSubsystem                        2.0.0.0    Storage
Function        Update-Disk                                        2.0.0.0    Storage
Function        Update-HostStorageCache                            2.0.0.0    Storage
Function        Update-StorageFirmware                             2.0.0.0    Storage
Function        Update-StoragePool                                 2.0.0.0    Storage
Function        Update-StorageProviderCache                        2.0.0.0    Storage
Function        Write-VolumeCache                                  2.0.0.0    Storage

But I’m taunting here: unfortunately for you, Nasty7, as a Windows 7 user, the Storage module is not available in PowerShell 2, so unless you consider looking into upgrading, Diskpart is the best tool you’ve got for now.


Quote   Quote: Originally Posted by Nasty7 View Post
I need something more simple, and don't know why the commands I linked to don't work.
PowerShell errors are always descriptive. Did you read the errors you received?
My System SpecsSystem Spec
15 Oct 2016   #8
Nasty7

Windows 7 Home Premium 64bit
 
 

Thanks Pyprohly, yes I did read the Error's but am a bit of a noob. My comprehension abilities an't so good either because my health is very bad.

Quote:
But Iím taunting here: unfortunately for you, Nasty7,

as a Windows 7 user, the Storage module is not available in PowerShell 2, so unless you consider looking into upgrading, Diskpart is the best tool youíve got for now.
Yes, lol...but I appreciate that you did so without being Arrogant or condescending.

I did notice that Powershell Version might be an issue, yes. I did my search on Windows 7, but did not realize at least that one page was for 8.1 only I believe.

Thanks for your knowledge, this clears things up for me. Now, this install I can't mess up, and only have a few Images on a USB Drive, so won't explore Updating/Installing a newer version of P.S. if that is even possible on W7 HomePremium.

Nasty7
My System SpecsSystem Spec
Reply

 Powershell Partition Information




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
Powershell
I was running a script on my 32bit OS that opened up IE and logged me onto my company's vpn. I am now using 64bit OS and My company's vpn does not like 64bit IE. (firefox and chrome are also iffy with our vpn, IE is the only 'official one they support'). When the script runs now on my 64bit os....
General Discussion
PowerShell 3.0 for Win 7 now available
Download: WMF 3.0 - Microsoft Download Center - Download Details You will notice in the requirements that Service Pack 1 must be installed. You will be downloading: Windows Management Framework 3.0 which includes: PowerShell 3.0, WMI & WinRM
News
powershell 1 or 2?
i thought windows 7 pro comes with powershell 2 installed.... when i look in sys32 folder it shows powershell 1... also when powershell is activated it is version 1.... is this correct or what is going on... system is fully updated... win 7 pro 64 bit thanks :(
General Discussion
do you use powershell?
do you use and/or have any cmdlets ?? such as: Get-counter Get-counter -Counter "\Processor(_Total)\% Processor Time" -SampleInterval 2 -MaxSamples 10
General Discussion


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd

All times are GMT -5. The time now is 07:44.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App