I tested the scripts, it works.
BTW, there is no Type of "Recovery", it is "Unknown", the "Unknown" is the "Recovery Partition from Windows Disk manager.
PS C:\WINDOWS\system32> Get-Partition
DiskPath: \\?\scsi#disk&ven_vmware&prod_virtual_disk#5&35015fb0&0&000000#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}
PartitionNumber DriveLetter Offset Size Type
--------------- ----------- ------ ---- ----
1 1048576 350 MB IFS
2 C 368050176 74.22 GB IFS
3 80056680448 450 MB Unknown
PS C:\WINDOWS\system32> Get-Partition | Where-Object -FilterScript {$_.Type -eq 'Unknown'}
DiskPath: \\?\scsi#disk&ven_vmware&prod_virtual_disk#5&35015fb0&0&000000#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}
PartitionNumber DriveLetter Offset Size Type
--------------- ----------- ------ ---- ----
3 80056680448 450 MB Unknown
S C:\WINDOWS\system32> Get-Partition | Where-Object -FilterScript {$_.Type -eq 'Unknown'} | Remove-Partition -PassThru -Confirm:$false
DiskPath: \\?\scsi#disk&ven_vmware&prod_virtual_disk#5&35015fb0&0&000000#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}
PartitionNumber DriveLetter Offset Size Type
--------------- ----------- ------ ---- ----
3 80056680448 450 MB Unknown
PS C:\WINDOWS\system32> Get-Partition | Where-Object -FilterScript {$_.Type -eq 'Unknown'}
PS C:\WINDOWS\system32>