Forum Discussion

dmarquesgn's avatar
dmarquesgn
Iron Contributor
Sep 23, 2021
Solved

Get the output of a command into a string

Hi,   I'm new to Powershell and trying to automate some simple tasks. So basically I need to create a script to check for newly added users on my AD for the last x days (this is already done), and...
  • yuzoyox's avatar
    Sep 23, 2021

    dmarquesgn 

     

    Hello, write the output of first step to external file, examplae text.csv
    with these file you can read each line and add the variable with content of the file.

     

    Get-Content .\test.csv | ForEach-Object {
        if($_ -match $temp){
           #I add write-output to show the content of the file test.csv[n]
           Write-Output  $_
        } 
    }

Resources