none
Get-PartitionSupportedSize' is not recognized as the name of a cmdlet, function

    Question

  • Not sure why I am gettting this error. I ran checked th ecmdlets in ISE and they are all available. Any idea?

    $ScriptBlock = {

    $MaxSize = (Get-PartitionSupportedSize -DriveLetter C).Sizemax

    Resize-Partition -DriveLetter C -Size $MaxSize

    }

    Invoke-Command -ComputerName xxxxxxx-ScriptBlock $ScriptBlock -Credential $cred

    The term 'Get-PartitionSupportedSize' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, 

    verify that the path is correct and try again.

        + CategoryInfo          : ObjectNotFound: (Get-PartitionSupportedSize:String) [], CommandNotFoundException

        + FullyQualifiedErrorId : CommandNotFoundException

        + PSComputerName        : Vxxxxxxx

    The term 'Resize-Partition' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the 

    path is correct and try again.

        + CategoryInfo          : ObjectNotFound: (Resize-Partition:String) [], CommandNotFoundException

        + FullyQualifiedErrorId : CommandNotFoundException

        + PSComputerName        : xxxxxxxx

    Tuesday, May 28, 2019 8:50 PM

All replies

  • any idea why I am getting this error when doing a expand on E drive for multiple machines? It works only for first one

    Friday, May 24, 2019 3:11 PM
  • An image of your code is not helpful.

    Please post your code correctly using the code posting tool provided on the incon bar of the post editor (second to last icon). Thanks


    Live long and prosper!

    (79,108,97,102|%{[char]$_})-join''

    Friday, May 24, 2019 5:02 PM
  • $Svr = Get-Content 'C:\scripts\servers.txt' $ScriptBlock = { $MaxSize = (Get-PartitionSupportedSize -DriveLetter E).Sizemax Resize-Partition -DriveLetter E -Size $MaxSize } get-vm -name ($svr) | Get-HardDisk -Name 'Hard disk 2' | ForEach-Object -Process { Set-HardDisk -HardDisk $_ -CapacityGB (1 + $_.CapacityGB) -Confirm:$false Invoke-Command -ComputerName $Svr -ScriptBlock $ScriptBlock -Credential $creds }

    getting error

    Size Not Supported
        + CategoryInfo          : NotSpecified: (StorageWMI:ROOT/Microsoft/.../MSFT_Partition) [Resize-Partition], CimException
        + FullyQualifiedErrorId : StorageWMI 4097,Resize-Partition
        + PSComputerName        :


    Friday, May 24, 2019 9:58 PM
  • You cannot set a disk beyond the available maximum size.  You are adding 1Gb to the current capacity which can exceed the available free space.

    VM hard disks are not all expandable.


    \_(ツ)_/

    Friday, May 24, 2019 10:06 PM
  • This command is not supported on older systems.  Always look up the command to see where it is supported.

     help Get-PartitionSupportedSize  -online


    \_(ツ)_/

    Tuesday, May 28, 2019 9:54 PM