Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

whether I can Import-csv to Set-ItemProperty for MDTDeploymentShare

$
0
0
Hi Scripting Guys!

  When i Managing MDT Using Windows PowerShelli to config the  Property of  MDT Deployment Shares

i wondered if exit another way like looping  a structured csv file and pipeline  command  to Set-ItemProperty to accomplish this task 

although it departure the object itself and deal with someone  like a text file  but i want a try And it's  similar to other scene

Here is my code and screenshot 
Get-ItemProperty "DeploymentShare1:"
Get-ItemProperty  "DeploymentShare1:" | Out-File $env:HOMEPATH\DeploymentShare1_ItemProperty.csv
Get-Content $env:HOMEPATH\DeploymentShare1_ItemProperty.csv | % {Write-Host  ($_).Split(':')[0]  ($_).Split(':')[1]  }
Get-Content C:\Users\Administrator\DeploymentShare1_ItemProperty.csv | % {Set-ItemProperty "DeploymentShare1:" -Name "($_).Split(':')[0]" -Value "($_).Split(':')[1]" -Verbose }


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>