回复 8# 5i365
官方文档里什么都有呀- https://docs.microsoft.com/zh-cn/powershell/module/microsoft.powershell.core/about/about_automatic_variables#pwd
复制代码
- [void][Reflection.Assembly]::LoadWithPartialName('System.Drawing')
- $a="C:\Users\Administrator\Desktop\新建文件夹"
- [System.Environment]::CurrentDirectory=$a
- cd $a
- dir *.bmp |
- foreach{
- $image = [Drawing.Image]::FromFile($_.FullName)
- #$image.Save($($_.BaseName + '.jpg'), [Drawing.Imaging.ImageFormat]::Jpeg)
- $s=$_.BaseName
- $image.Save("$s.jpg", [Drawing.Imaging.ImageFormat]::Jpeg)
- $image.Dispose()
- }
复制代码
|