@@ -372,7 +372,7 @@ function Set-TargetResource
372372 # Check if existing partition already has file system on it
373373 if ($null -eq $assignedPartition )
374374 {
375- # There is no partiton with this drive letter
375+ # There is no partition with this drive letter
376376 Write-Verbose - Message ( @ (
377377 " $ ( $MyInvocation.MyCommand ) : "
378378 $ ($script :localizedData.DriveNotFoundOnPartitionMessage `
@@ -631,11 +631,12 @@ function Set-TargetResource
631631
632632 <#
633633 After creating the partition it can take a few seconds for it to become writeable
634- Wait for up to 30 seconds for the parition to become writeable
634+ Wait for up to 30 seconds for the partition to become writeable
635635 #>
636636 $timeAtStart = Get-Date
637- $minimumTimeToWait = $timeAtStart + (New-Timespan - Second 3 )
638- $maximumTimeToWait = $timeAtStart + (New-Timespan - Second 30 )
637+ $minimumTimeToWait = $timeAtStart + (New-TimeSpan - Second 3 )
638+ $maximumTimeToWait = $timeAtStart + (New-TimeSpan - Second 30 )
639+ $partitionstate = $null
639640
640641 while (($partitionstate.IsReadOnly -and (Get-Date ) -lt $maximumTimeToWait ) `
641642 -or ((Get-Date ) -lt $minimumTimeToWait ))
@@ -657,7 +658,7 @@ function Set-TargetResource
657658 {
658659 # The partition is still readonly - throw an exception
659660 New-InvalidOperationException `
660- - Message ($script :localizedData.NewParitionIsReadOnlyError `
661+ - Message ($script :localizedData.NewPartitionIsReadOnlyError `
661662 -f $DiskIdType , $DiskId , $partition.PartitionNumber )
662663 } # if
663664
@@ -709,7 +710,7 @@ function Set-TargetResource
709710
710711 if ($Size -gt $supportedSize.SizeMax )
711712 {
712- New-InvalidArgumentException - Message ( @ (
713+ New-ArgumentException - Message ( @ (
713714 " $ ( $MyInvocation.MyCommand ) : "
714715 $ ($script :localizedData.FreeSpaceViolationError `
715716 -f $DriveLetter , $assignedPartition.Size , $Size , $supportedSize.SizeMax )
@@ -837,7 +838,7 @@ function Set-TargetResource
837838 # The volume should have a label assigned
838839 if ($volume.FileSystemLabel -ne $FSLabel )
839840 {
840- # The volume lable needs to be changed because it is different.
841+ # The volume label needs to be changed because it is different.
841842 Write-Verbose - Message ( @ (
842843 " $ ( $MyInvocation.MyCommand ) : "
843844 $ ($script :localizedData.ChangingVolumeLabelMessage `
@@ -891,7 +892,7 @@ function Set-TargetResource
891892
892893<#
893894 . SYNOPSIS
894- Tests if the disk is initialized, the partion exists and the drive letter is assigned.
895+ Tests if the disk is initialized, the partition exists and the drive letter is assigned.
895896
896897 . PARAMETER DriveLetter
897898 Specifies the preferred letter to assign to the disk volume.
@@ -1074,7 +1075,7 @@ function Test-TargetResource
10741075 If the difference in size between the supported partition size
10751076 and the current partition size is less than 1MB then set the
10761077 desired partition size to the current size. This will prevent
1077- any size difference less than 1MB from trying to contiuously
1078+ any size difference less than 1MB from trying to continuously
10781079 resize. See https://github.com/dsccommunity/StorageDsc/issues/181
10791080 #>
10801081 if (($supportedSize.SizeMax - $partition.Size ) -lt 1 MB )
@@ -1114,7 +1115,7 @@ function Test-TargetResource
11141115 https://learn.microsoft.com/en-us/windows-hardware/drivers/storage/createpartition-msft-disk
11151116 for more information. But to some it up, what the user enters and what the New-Partition
11161117 cmdlet is able to allocate can be different in bytes. So to keep idempotence, we only
1117- return false when they arent the same in GB. Also if the volume already is formatted as
1118+ return false when they are not the same in GB. Also if the volume already is formatted as
11181119 a ReFS, there is no point in returning false for size mismatches since they can't be
11191120 resized with resize-partition.
11201121 #>
0 commit comments