Please when you post code format it as code using the preformatted text button ( </> ). Simply place the cursor on an empty line, click the button and paste your code.
**Error:**
Get-Partition: Could not validate argument on parameter 'DiskNumber'. The argument is null. Provide value valid for the argument and reissue the command.
In riga:1 car:27
+ Get-Partition -DiskNumber $($DiskNumber.Number) | Set-Partition - new ...
+ ~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Get-Partition], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,Get-Partition
P.S.
if I execute the command Get-Volume the disk with FriendlyName “XXXXX” is seen:
Windows PowerShell
Copyright (C) Microsoft Corporation. Tutti i diritti riservati.
Prova la nuova PowerShell multipiattaforma https://aka.ms/pscore6
PS C:\Users\utente> Get-Disk | Where-Object { $_.FriendlyName -eq 'XXXXX' }
PS C:\Users\utente>