Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 41
  1. #16
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,970
    Thanks
    424
    Thanked 1,600 Times in 1,450 Posts
    Rick,

    I'm not using WMI but a PowerShell cmdlet Get-Drives. Could you try that and see what it returns?

    line 289 - Working (why capitalised?) - I want it to standout in the Balloon Tip.
    line 819 - SPeed/RPMs - Fixed (mostly because of my fat fingers! )

    FYI: I've squashed some more bugs and I'm also getting rid of some leftover fat (unnecessary code) from the networked version. May have new version before I hit the hay. Didn't do much this afternoon as I got ambitious on my walk and did 7 miles in 1:40!

    Thanks again for testing.

    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  2. #17
    Administrator Rick Corbett's Avatar
    Join Date
    Dec 2009
    Location
    South Glos., UK
    Posts
    3,462
    Thanks
    153
    Thanked 942 Times in 757 Posts
    Quote Originally Posted by RetiredGeek
    I'm not using WMI but a PowerShell cmdlet Get-Drives. Could you try that and see what it returns?
    I switched off the external drives to leave me with just the base unit which has 1 x 256GB SSD used for boot/Windows and 1 x 500GB spinner used solely for data.

    It appears that after many years of meditation (okay... minutes) I have finally achieved that zen state of being able to boot Windows from a non-bootable disk. Please don't burst that bubble with a logical explanation.

    get-drives.png

    Running PowerShell 5 in x64 ISE (as Administrator) in Win 7 Pro SP1 x64.
    Last edited by Rick Corbett; 2017-03-10 at 06:00.

  3. #18
    WS Lounge VIP access-mdb's Avatar
    Join Date
    Dec 2009
    Location
    Oxfordshire, UK
    Posts
    2,055
    Thanks
    164
    Thanked 194 Times in 187 Posts
    Hmmm, Get-Drives doesn't work in my Powershell and isn't listed in Get-Command - what am I doing wrong?
    What do you mean nothing is impossible? I've been doing nothing for years.

  4. #19
    Administrator Rick Corbett's Avatar
    Join Date
    Dec 2009
    Location
    South Glos., UK
    Posts
    3,462
    Thanks
    153
    Thanked 942 Times in 757 Posts
    Quote Originally Posted by access-mdb View Post
    Hmmm, Get-Drives doesn't work in my Powershell and isn't listed in Get-Command - what am I doing wrong?
    What version of PowerShell do you have installed?

  5. #20
    WS Lounge VIP access-mdb's Avatar
    Join Date
    Dec 2009
    Location
    Oxfordshire, UK
    Posts
    2,055
    Thanks
    164
    Thanked 194 Times in 187 Posts
    I've used $PSVersionTable.PSVersion to see what it says and it seems to be 5.1 build 14393, revision 693
    What do you mean nothing is impossible? I've been doing nothing for years.

  6. #21
    Administrator Rick Corbett's Avatar
    Join Date
    Dec 2009
    Location
    South Glos., UK
    Posts
    3,462
    Thanks
    153
    Thanked 942 Times in 757 Posts
    Quote Originally Posted by access-mdb
    I've used $PSVersionTable.PSVersion to see what it says and it seems to be 5.1 build 14393, revision 693
    And you're running PowerShell as admin?

  7. #22
    WS Lounge VIP access-mdb's Avatar
    Join Date
    Dec 2009
    Location
    Oxfordshire, UK
    Posts
    2,055
    Thanks
    164
    Thanked 194 Times in 187 Posts
    Yup! I've googled powershell and get-drive and it only comes up with get-psdrive - not the same thing.
    What do you mean nothing is impossible? I've been doing nothing for years.

  8. #23
    Administrator Rick Corbett's Avatar
    Join Date
    Dec 2009
    Location
    South Glos., UK
    Posts
    3,462
    Thanks
    153
    Thanked 942 Times in 757 Posts
    Strange... I'm running PS5 and, in the ISE, I get:

    get-drives1.png
    Click to expand

    Perhaps RetiredGuru can explain... 'cos I'm way out of my depth with PowerShell.

  9. #24
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,970
    Thanks
    424
    Thanked 1,600 Times in 1,450 Posts
    Rick,

    Ok, let's tackle these one at a time.

    Boot Partition:

    Perhaps this excerpt from the latest version (not yet posted) which gives a little more data on storage for Win 7 will help.

    Code:
    Disk Partition Information:
    
    
       Diskindex: 0
    
    Part Partition Part                         Boot   
      No   Size/GB Alignment Primary Bootable Partition
    ---- --------- --------- ------- -------- ---------
       0    000.10 Aligned     Yes     Yes       Yes   
       1    103.70 Aligned     Yes                     
       2    074.12 Aligned     Yes                     
       3    060.55 UnAligned                           
    
    
    [ ---> Trim is Enabled <--- ]
    
    Logical Disk Information:
    
    Drive  Volume     File   Drive                Disk Size Free Space  Drv      
    Letter Name       System Type      Compressed      / GB       / GB   No Boot 
    ------ ---------- ------ --------- ---------- --------- ---------- ---- -----
    C:     Win7Off... NTFS   Fixed     False         074.12     031.42    0      
    E:                       Fixed                   000.00     000.00    0      
    G:     Data       NTFS   Fixed     False         060.55     024.91    0
    You'll notice that there is one more partition than drive letters and it is marked as Boot! Even though the Windows 7 files are on C: the boot process starts with partition 0.

    Get-Drives vs Get-PSDrive:

    Get-Drives (Win 8.1+) returns information about logical drives:
    Code:
    PS> get-drives | ft
    
    Name VolumeName FileSystem DriveType         Size Compressed   FreeSpace DiskIn
                                                                                dex
    ---- ---------- ---------- ---------         ---- ----------   --------- ------
    S:   Swap       NTFS               3  17590906880      False 15596711936      1
    G:   Data       NTFS               3 130223697920      False 86620069888      1
    N:   MR-Images  NTFS               3 812243742720      False ...72962816      1
    C:   OS         NTFS               3 238366486528      False ...88218112      0
    Where as Get-PSDrive returns information about not only logical drives but also special data stores that PowerShell has defined in a way that they can be accessed as a drive, i.e. using a Path specification:
    Code:
    PS> Get-PSDrive
    
    Name           Used (GB)     Free (GB) Provider      Root                      
    ----           ---------     --------- --------      ----                      
    Alias                                  Alias                                   
    C                  70.85        151.14 FileSystem    C:\                       
    Cert                                   Certificate   \                         
    D                                      FileSystem    D:\                       
    Env                                    Environment                             
    Function                               Function                                
    G                  40.61         80.67 FileSystem    G:\                       
    HKCU                                   Registry      HKEY_CURRENT_USER         
    HKLM                                   Registry      HKEY_LOCAL_MACHINE        
    N                 205.33        551.13 FileSystem    N:\                       
    S                   1.86         14.53 FileSystem    S:\                       
    Variable                               Variable                                
    WSMan
    Thus I can access registry keys in HKLM (Local Machine) via a path specification.
    Code:
    PS> $HB = Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Power' -Name 'HiberbootEnabled'
    
    PS> $HB
    
    HiberbootEnabled : 0
    PSPath           : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTE
                       M\CurrentControlSet\Control\Session Manager\Power
    PSParentPath     : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTE
                       M\CurrentControlSet\Control\Session Manager
    PSChildName      : Power
    PSDrive          : HKLM
    PSProvider       : Microsoft.PowerShell.Core\Registry
    You'll notice that the PSDrives also encompass the logical drives! Since accessing them all works via a Path parameter.

    HTH
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  10. #25
    Administrator Rick Corbett's Avatar
    Join Date
    Dec 2009
    Location
    South Glos., UK
    Posts
    3,462
    Thanks
    153
    Thanked 942 Times in 757 Posts
    Thanks RG. Whilst I know the difference between a system partition and a boot partition, I'm just unfamiliar with PowerShell.

  11. #26
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,970
    Thanks
    424
    Thanked 1,600 Times in 1,450 Posts
    Quote Originally Posted by Rick Corbett View Post
    Thanks RG. Whilst I know the difference between a system partition and a boot partition, I'm just unfamiliar with PowerShell.
    Just trying to answer your question in post #17 as to why none of the logical drives show as boot.

    HTH
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  12. #27
    WS Lounge VIP Browni's Avatar
    Join Date
    Dec 2009
    Location
    Rochdale, UK
    Posts
    1,752
    Thanks
    39
    Thanked 178 Times in 155 Posts
    Get-Drives doesn't work for me either but I did find it as a user defined function in the PS script

  13. #28
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,970
    Thanks
    424
    Thanked 1,600 Times in 1,450 Posts
    Hey Y'all,

    I've been slaving over this code for days now and I think I've squashed most of the bugs and eliminated code that is not necessary for just processing the local machine.

    You can run the program with either a User or Admin PS session. If you do it as a user several items will me marked as only available if running as Administrator.

    Note: I've set the time format to "HH:mm" however you can remove that and the code to retrieve the local settings is in a comment following that. Located near the bottom of the code $LocalTMFmt variable.
    Code:
    #To get times in local format delete "HH:mm" # below!
    $LocalTMFmt = "HH:mm" #(Get-Culture).DateTimeFormat.ShortTimePattern
    With Rick's help I think I've fixed all the spelling and fat finger mistakes, but no promises!

    I'd really appreciate if someone out there could test this on Win 8.0 and/or 8.1. The other test I can't do is on a machine that has only HDDs no SDDs. Specifically what happens to the reporting of the Trim status.

    Revised CMsLocalPCInfo: Code removed latest code at the bottom of thread.

    Thanks again to all the testers.

    I'm off to have lunch and hull a gallon of fresh strawberries from a local farm. It's great to live in the South!

    HTH
    Last edited by RetiredGeek; 2017-03-10 at 22:36. Reason: Removed old code
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  14. #29
    Administrator Rick Corbett's Avatar
    Join Date
    Dec 2009
    Location
    South Glos., UK
    Posts
    3,462
    Thanks
    153
    Thanked 942 Times in 757 Posts
    Quote Originally Posted by RetiredGeek
    Just trying to answer your question in post #17 as to why none of the logical drives show as boot.
    It did. Surely it can't be just me that keeps having to remember that these days Windows devices boot from a system partition (i.e. active, no drive letter), not the boot partition... or can it?

    I may be wrong but... how many other OS' 'boot' from a 'system' partition yet have 'the system' on the 'boot' partition?

    Thank you Microsoft for redefining English.

  15. #30
    WS Lounge VIP access-mdb's Avatar
    Join Date
    Dec 2009
    Location
    Oxfordshire, UK
    Posts
    2,055
    Thanks
    164
    Thanked 194 Times in 187 Posts
    One possible problem:

    These are my two monitors

    Code:
    Monitor Information:
    
    Monitor                             Serial       Registry Size
    Name                Manufacturer    Number       ID           
    ------------        -------------   ------------ -------- ----
    ACER S271HL         ACER            LUWEE0098535 ACR02CA  20" 
    Generic PnP Monitor (Standard mo... LFK080114200 ACR0097  27" 
    
    Device Name  Effective Effective Primary
                     Width    Height Monitor
    -----------  --------- --------- -------
    \\.\DISPLAY6      1920      1080 True   
    \\.\DISPLAY7      1600       900 False
    The S271HL is a 27" one, the generic (actually an Acer X203H) is a 20" one, so these values appear swapped above. Display 6 and 7's resolution are correct though.
    What do you mean nothing is impossible? I've been doing nothing for years.

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •