Forum Discussion
dmarquesgn
Sep 05, 2022Iron Contributor
Powershell parse csv file to store some values to variable
Hi, I'm working with PSWindowsUpdate module to automate some tasks related to Windows Servers Updates. I've already created some scripting to go to each server, check which updates are available an...
- Sep 05, 2022If I understood your request correctly you already have the necessary code for the actual execution, what you need to know is how to put values in a variable, correct?
Do you require a string, array or hashtable variable?
See here for examples on the use of each: https://docs.microsoft.com/en-us/powershell/scripting/lang-spec/chapter-05?view=powershell-7.2
dmarquesgn
Sep 05, 2022Iron Contributor
One more thing. In the end my goal is to prepare a command like:
Get-WindowsUpdate -ComputerName $server -MicrosoftUpdate -NotCategory "Drivers" -Verbose -Download -AcceptAll -ScheduleReboot "Date" -KBArticleID $KBS (This is the KBs extracted from the CSV for each server)
Get-WindowsUpdate -ComputerName $server -MicrosoftUpdate -NotCategory "Drivers" -Verbose -Download -AcceptAll -ScheduleReboot "Date" -KBArticleID $KBS (This is the KBs extracted from the CSV for each server)