Load the CSV globally. Place it outside of any event or function.
You should put the header in the CSV file. You don't need to specify the delimiter if it is a comma.
You can also do this in the "Load" event:
$global:csv = Import-Csv '\\remotepath\Get-AppsModelSwitch.csv'
Switch statement
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
- apowershelluser
- Posts: 194
- Last visit: Fri Mar 22, 2024 4:38 am
Re: Switch statement
So I just looked into this mxtrinidad
and two different models did not retrieve SystemFamily, SystemSKUNumber whereas the regkeys are created based off of SCCM ( which is what I've been told )
So using the regkey works perfectly for me
Unless there is some reason to use gwmi over remote registry
and two different models did not retrieve SystemFamily, SystemSKUNumber whereas the regkeys are created based off of SCCM ( which is what I've been told )
So using the regkey works perfectly for me
Unless there is some reason to use gwmi over remote registry