1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
"lucas" | Out-File .\usuarios.txt -Append foreach($usuario in gc .\usuarios.txt) { $ruta = "c:\"+$usuario+".vhdx" $vhdpath = $ruta $vhdsize = 1GB New-VHD -Path $vhdpath -Dynamic -SizeBytes $vhdsize | Mount-VHD -Passthru |Initialize-Disk -Passthru | New-Partition -AssignDriveLetter -UseMaximumSize |Format-Volume -FileSystem NTFS -Confirm:$false -Force } foreach($unidad in (Get-Partition).DriveLetter) { Get-Process | select name, Threads | Out-File ($unidad+":\informacion.txt") } |