powershell - Powershell scrip forloop gettings errors
问题描述
Trying to automate a task using PowerShell. The command that I am using is New-NpsRadiusClient
. I have a CSV file with four columns:
- Name
- IPAddress
- SharedSecret
- Vendor
I'm new to PowerShell. I have no experience at all. How do I get this to work? Thanks.
$csv = Import-Csv .\npsDevices.csv
foreach ($line in $csv) {
New-NpsRadiusClient -Name $ClientName -Address $IPAddress -VendorName $Vendor -SharedSecret $strSharedSecret
}
解决方案
推荐阅读
- python - 抓取图片链接的问题
- amazon-web-services - 如何在 AWS EMR 笔记本中加载库/ Maven 依赖项
- swift - 自定义 NSAlert 复选框和按钮的外观
- java - 将 APK 移动到 /system/priv-app/ 时出现 java.lang.UnsatisfiedLinkError
- c++ - 为什么使用“++value”会导致 -842150449?
- asp.net-core - 在 .ThenInclude 中为模型添加过滤器到剃刀视图
- android - SocketServer.accept() 使应用程序崩溃或有时无法正常工作
- bash - 检查字符串日期(mm/dd/yyyy)是否是周末 - bash
- javascript - 如何使用 POST 请求实现 http-equiv/refresh?
- javascript - 使用 Node JS 从 MySQL 数据库中删除一行