none
invoke-command diskpart RRS feed

All replies

  • You've posted here before, so you should know this already. But in case you've forgotten, please read the following post. It is right at the top of this forum:

    This forum is for scripting questions rather than script requests


    -- Bill Stewart [Bill_Stewart]

    Thursday, December 5, 2019 3:34 PM
    Moderator
  • ok got it working

    incase anyone interested

    get-content "c:\temp\vms.txt" | % { copy-item -path "c:\temp\diskpart.txt" -destination "\\$_\c$\temp" }

    $scriptblock = {diskpart /s "c:\temp\diskpart.txt"}

    foreach ($vm in (get-content "c:\temp\vms.txt")) {

    invoke-command -computername $vm -scriptblock $scriptblock

    }

    diskpart.txt is 

    ---------

    rescan

    select volume c

    extend

    Thursday, December 5, 2019 8:58 PM