我有2个powershell脚本。第一个脚本是GUI,第二个脚本是我要考虑进度条的进程。我想在我的GUI表单中添加进度条。
Add-Type -AssemblyName System.Windows.Forms
[System.Windows.Forms.Application]::EnableVisualStyles()
Add-Type -Assembly System.Windows.Forms
$form = New-Object Windows.Forms.Form
$Form.WindowState = 'Maximized'
$Form.ControlBox = $false
$img = [Drawing.Image]::FromFile(".\CP.png")
$form.BackgroundImage = $img
$form.BackgroundImageLayout = 'Center'
$Form.BackColor = "#ffffff"
[void]$Form.ShowDialog()
# clean up when done
$Form.Dispose()
....Some Pocess....
# Call GUI Capturing
Start-Process powershell.exe -WindowStyle Hidden ".\GUI.ps1"
#Process that need to add progress bar to GUI
& DISM.exe /capture-ffu /imagefile=E:\Folder\Image.ffu /capturedrive=\\.\PhysicalDrive0 /name:disk0 /description:"Capture"
我的期望结果,我可以在GUI表单中显示进度栏。
任何人都可以帮助我。非常感谢。谢谢