-1
我試着做從PowerShell的腳本來讀取像這樣的文本文件:PowerShell腳本獲得變量文件
text1,data1,data2
text2,data1,data2
,並使用這些數據的命令文件中的每一行。
謝謝你的幫助。
編輯:
我認爲我可以使用命令
while read line do
if [[ $line =~ $regex ]]; then
(commands here for each row, but i cant find how to get the variable)
fi
done < file.txt
英里文本文件是這樣的:
prueba1,vSwitch0,10
prueba2,vSwitch0,20
prueba3,vSwitch0,30
,我必須把這些數據轉化爲這樣的代碼:
New-VirtualPortGroup -Name prueba1 -VirtualSwitch vSwitch0 -VlanId 10
請問您能介紹一下嗎? 「並將該數據用於文件每一行的命令中。」 –
你已經試過了什麼?請展示一些努力和代碼並指出具體問題。這不是一個代碼寫入服務。 –
編輯,感謝您的重新申請 – kaler26