[int]$int = 7
$int.ToString('000')
The number of leading zeros can be controled by the value in the ToString()
PS C:\> [int]$int = 7 >> $int.ToString('000') 007
[int]$int = 7
$int.ToString('000')
DetailsPS C:\> [int]$int = 7 >> $int.ToString('000') 007