none
passing an array or read from txt file into a parameter RRS feed

  • Question

  • I got a txt file that has a bunch of computers

    pc1

    pc2

    pc3

    etc..

    I want to pass all these into a function

    function getinfo {

    param(

    int[]$array

    write-host $array

    )

    $computers = get-content computer.txt

    getinfo.ps1 -array $computers

    but getting error

    any idea how to fix this?

    Sunday, May 19, 2019 6:49 PM

All replies