Hi People,
I need to ask your help in modifying the script below so that it can take input from a list of servers from a text file.
like:
Get-Content -Path C:\Temp\computers.txt | ForEach-Object { $computerName = $_ Write-Host "Processing $($computerName)" # insert the code from https://www.powershelladmin.com/wiki/Get_Linux_disk_space_report_in_PowerShell } | Export-Csv -Path C:\Temp\Freespace.csv
Get-SshSession | Select -Exp ComputerName | %{ $c = $_; ConvertFrom-LinuxDfOutput -Text (Invoke-SshCommand -Comp $_ -Command 'df --portability' -q) } | Select @{n='ComputerName';e={$c}}, * | ft -AutoSize
Note: this is from: Get Linux disk space report in PowerShell - Svendsen Tech
Thank you in advance.