Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/sharepoint/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Windows 10 PowerShell批量调整目录中所有图像的大小_Powershell - Fatal编程技术网

使用Windows 10 PowerShell批量调整目录中所有图像的大小

使用Windows 10 PowerShell批量调整目录中所有图像的大小,powershell,Powershell,是否可以使用Windows 10 PowerShell命令批量调整文件夹中所有图像的大小 $path = "D:/imgs/Nature" #target directory [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") Get-ChildItem -Recurse ($path) -Include @("*.png", "*.jpg&

是否可以使用Windows 10 PowerShell命令批量调整文件夹中所有图像的大小

$path = "D:/imgs/Nature" #target directory

[System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
Get-ChildItem -Recurse ($path) -Include @("*.png", "*.jpg") | ForEach-Object {
    $image = [System.Drawing.Image]::FromFile($_)
}

为什么不改用呢?脚本库中有几个脚本可以执行此操作。试着去做,然后把不起作用的贴出来。哇!这很有帮助!为什么不改用呢?脚本库中有几个脚本可以执行此操作。试着去做,然后把不起作用的贴出来。哇!这很有帮助!