powershell循环语句:依次读取某文件名并赋给变量,然后将该变量带入一条命令进行执行;。变量:value。

2025-03-24 05:31:02
推荐回答(1个)
回答1:

给你写个例子:

$filelist=dir xxxx #获取文件列表
foreach($file in $filelist){
$filename=$file.fullname
Import-RecipientDataProperty -Identity $filename -Picture -FileData ([Byte[]]$(Get-Content-Path "D:\value.JPG" -Encoding Byte -ReadCount 0)) #做处理

xxxxx #表达式
}