Write-Progress -Status span mulitple lines

Is it possible for Write-Progress -Status to span multiple lines? The status is showing the file being copied and to the location it is being copied to, which can get very long and runs off the console window. I have tried adding `r`n but that doesn't
work, so I am thinking it is a no, but figured I would ask.
If you find that my post has answered your question, please mark it as the answer. If you find my post to be helpful in anyway, please click vote as helpful.
Don't Retire Technet

The progress bar in Write-Progress is based on the width buffer size of the console window. If the width buffer is greater than the actual console window width, then it will spill off of the console.
There is no way to my knowledge to make this span multiple lines other than to write your own type of progress bar or to make a proxy function for Write-Progress.
Boe Prox
Blog |
Twitter
PoshWSUS |
PoshPAIG | PoshChat |
PoshEventUI
PowerShell Deep Dives Book

Similar Messages

  • Write Progress through Whole Script (instead of Timer or through per function)

    Hello Team,
    Is it possible to use the write-progress to begin a the top of a script and run through each function of the script (instead of a timer or per function) and at the end of the script complete?
    For example, here I use a timer:
    for ($i =1;$i = le 100; $i++)
    function sWriteLogInformation
    out-file
    -FilePath $strLog
    -Input Object
    -Append: $true
    -Confirm:$false
    -encoding "Unicode"
    Write-Host -Object $strText
    Get-Process $ProcessName -ErrorAction SilentlyContinue
    If (-not $?)
    strText = "Application is not running."
    Write-Host $strText
    Else
    Stop-Process -processname $processName
    write-Host "Application Closed"
    Write Progress -Activity "Please wait..$strText" -status "$i% Complete" -percentComplete $i;
    start-sleep milliseconds 50
    But I would rather it go through each of the steps/function in the script and close when finished.
    Any input appreciated.
    Thanks!

    Two suggestions:  
    Move the function outside of the for loop, there's no reason to define the same function 100 times.  It may not be a problem with this script, but with a large data set it will affect performance.  And it's just plain bad practice.
    Move the Write-Progress command to follow the initial for statement so it is displayed immediately instead of after processing the first item.
    As jrv suggested, you can have multiple write-progress statements that provide more information for each step, perhaps like this:
    function sWriteLogInformation ($strText) {
    out-file
    -FilePath $strLog
    -Input $strText
    -Append: $true
    -Confirm:$false
    -encoding "Unicode"
    Write-Host -Object $strText
    for ($i =1;$i = le 100; $i++) {
    Write Progress -Activity "Please wait.." -status "Checking $ProcessName" -percentComplete $i
    If (Get-Process $ProcessName -ErrorAction SilentlyContinue) {
    Write Progress -Activity "Please wait.." -status "Stopping $ProcessName" -percentComplete $i
    Stop-Process -processname $processName
    sWriteLogInformation "$processName stopped at $(get-date)"
    } Else {
    sWriteLogInformation "$processName not running."
    Write Progress -Activity "Please wait.." -status "Inserting artificial delay" -percentComplete $i
    start-sleep milliseconds 50
    Not sure where $ProcessName or $strLog are being defined.  I modified your script to clean it up a bit and remove some unnecessary code.
    I hope this post has helped!

  • Write-Progress in PowerShell script for installing Missing Updates

    Hi, I had a previous question here
    https://social.technet.microsoft.com/Forums/windowsserver/en-US/88931488-3b2c-4c08-9ad3-6651ba9bbcef/action?threadDisplayName=progress-indicator-for-installing-missing-sccm-2012-r2-updates
    But that method is not working as expected.  The progress bar displays then continues to increment past 100 throwing an error each time.
    I'm thinking I could use a foreach loop for the missing updates but I'm just lost when it comes to Powershell syntax.
    For example:
    # Get the number of missing updates
    [System.Management.ManagementObject[]] $CMMissingUpdates = @(GWMI -ComputerName $server -query "SELECT * FROM CCM_SoftwareUpdate WHERE ComplianceState = '0'" -namespace "ROOT\ccm\ClientSDK") #End Get update count.
    $result.UpdateCountBefore = "The number of missing updates is $($CMMissingUpdates.count)"
    #Install missing updates.
    #Begin example code, not tested.
    Foreach ($update in $CMMissingUpdates)
    $i++
    If ($CMMissingUpdates.count) {
    $CMInstallMissingUpdates = (GWMI -ComputerName $server -Namespace "root\ccm\clientsdk" -Class "CCM_SoftwareUpdatesManager" -List).InstallUpdates($CMMissingUpdates)
    Do {
    Start-Sleep -Seconds 15
    [array]$CMInstallPendingUpdates = @(GWMI -ComputerName $server -query "SELECT * FROM CCM_SoftwareUpdate WHERE EvaluationState = 6 or EvaluationState = 7" -namespace "ROOT\ccm\ClientSDK")
    #end my example code.
    #The code below is working to install updates but Write-Progress isn't.
    If ($CMMissingUpdates.count) {
    #$result.UpdateCountBefore = "The number of missing updates is $($CMMissingUpdates.count)"
    $CMInstallMissingUpdates = (GWMI -ComputerName $server -Namespace "root\ccm\clientsdk" -Class "CCM_SoftwareUpdatesManager" -List).InstallUpdates($CMMissingUpdates)
    #Set the missing updates to variable for progress indicator.
    $updates = $CMMissingUpdates.Count
    $Increment = 100 / $updates
    $Percent = 0
    Do {
    Start-Sleep -Seconds 15
    [array]$CMInstallPendingUpdates = @(GWMI -ComputerName $server -query "SELECT * FROM CCM_SoftwareUpdate WHERE EvaluationState = 6 or EvaluationState = 7" -namespace "ROOT\ccm\ClientSDK")
    #Not 100% sure $result.UpdateCountBefore is needed below.
    $result.UpdateCountBefore = "The number of pending updates for installation is: $($CMInstallPendingUpdates.count)"
    Write-Progress -Activity "Updates are installing..." -PercentComplete $Percent -Status "Working..."
    $Percent = $Percent + $Increment
    } While (($CMInstallPendingUpdates.count -ne 0) -and ((New-TimeSpan -Start $StartTime -End $(Get-Date)) -lt "00:45:00"))
    Write-Progress -Activity "Updates Installed" -Status "Done" -Completed
    } ELSE {
    $result.UpdateCountAfter = "There are no missing updates."}
    $result

    The increment should be 100  / (max number of items)
    That will not exceed 100 through (max number of items ) iterations in a loop
    Mathematically that can be written as 
    100 / (Max Number of items) * (max number of items ) iterations in a loop
    = 100 * ( (Max Number of Item) / (Number Iterations in a loop) )
    = 100 * 1 = 100
    The (max number of items) and (Number of Iterations in a loop ) need to be based on the same number.
    In the script, it is not based on the same number.
    The maximum number of items is $CMMissingUpdates.Count
    The number of iterations in the loop  is based on the condition 
    ($CMInstallPendingUpdates.count -ne 0)
    Which causes the iterations of the loop to exceed $CMMissingUpdates.Count
    Assuming the $CMInstallPendingUpdates.count is going down (is decremented) through the loop, then
    $Increment = 100 /
    $CMInstallPendingUpdates.count

  • Mass Progression of Sales Order Lines

    Hi
    We are on 11.5.10.2.
    we are entering multiple model lines on Sales Order.
    To create * Item, we have to manually progress each line.
    Also, for Back 2 Back orders, users are entering around 50 -100 lines, selecting and progressing each line individually to next stage is not feasible.
    Is there any feature in Oracle which can do the mass progression of sales order lines i.e. model lines to create * Item and progressing the status of B2B cycles to next stage
    Thanks in Advance!
    Regards

    You can use Autocreate Configuration Items to batch-create the star items without having to manually progress.
    For back-to-back lines you can use Autocreate Purchase Requisitions.
    Both of these requests are 'owned' by Bills of Material. Just add them into your request group.
    Regards,
    Jon

  • Write-Progress display - How to get rid of it when complete?

    This seems straight forward, but I haven't seen/found the answer...
    My progress bars hang around too long.  I would like them to go away when complete, but they don't always.
    Typically the Write-Progress is within a loop, and it works.  Then imediately after the loop I add "Write-Progress -Complete", but that doesn't seem to do it.
    What am I missing?

    Not sure, but I don't think so...
    There is only one instance of the write-progress cmdlet.  It executes many times within the loop.
    Another question comes to mind... what is the -Completed argument for?  Should write-progress be called with that argument to close the display?  Or, when is that argument appropriate?
    I see Write-Progress twice:
    While( -NOT $Script:RecordSetG.EoF )
    { #...Some code
    $intCounterL ++
    If( $intRecordCountL -gt 0 )
    { $dblPercentageL = 100*( $intCounterL / $intRecordCountL )
    $intPercentageL = [int]$dblPercentageL
    $intSecondsLeftL = ( $intRecordCountL - $intCounterL ) / 24
    <em><strong>Write-Progress</strong></em> `
    -Activity "Building mailbox objects..." `
    -PercentComplete $intPercentageL `
    -SecondsRemaining $intSecondsLeftL `
    -CurrentOperation "$intPercentageL% complete" `
    -Status "Please wait."
    }#End If
    }#WEnd
    <em><strong>Write-Progress -Completed</strong></em>
    I was suggesting eliminating the second one.

  • Delivery Status at Schedule Line level.

    Hi All,
    I have to retrieve some data on the basis of Schedule line for which delivery is not complete. Please find below the requirement.
    I am having one sales order with one line item which having two schedule line. For one schedule line confirmed qty is 1K and for other 2k. For first line item deliver qty is also 1k.
    I want to know how to check the delivery status for schedule line counter so I will get the idea that for first schedule line qty is delivered and for second not.
    Thanks
    Piyush

    Use the function module
      CALL FUNCTION 'RV_SCHEDULE_CHECK_DELIVERIES'
        EXPORTING
          fbeleg                        = wa_vbap-vbeln
          fposnr                        = wa_vbap-posnr
      FVERRECHNUNG                  = ' '
      FS073_ALT                     = ' '
      IF_NO_SORT                    = ' '
        TABLES
       fvbfa                         = fvbfa
       fvbup                         = fvbup
       fxvbep                        = it_vbepvb
      FVBLB                        =
        fvbap                        = fvbap
    EXCEPTIONS
      FEHLER_BEI_LESEN_FVBUP        = 1
      FEHLER_BEI_LESEN_FXVBEP       = 2
      OTHERS                        = 3
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    loop the internal table it_vbepvb.
    get the open qty in that schedule line
        MOVE wa_vbepvb-olfmng_flt TO wa_itab-openqty.
        IF  wa_vbepvb-bmeng EQ wa_itab-openqty.
    check that with the schedule line confirmed qty wa_vbepvb-bmeng
    If delivery is avaliable the open qty will not be equal to confirmed qty.

  • Status of Schedule Line in Sales Order

    Which field in which of the tables shows the status of a schedule line for an item in the Sales Order?

    Hi pooja,
       In sales order schedule line table is vbep, vbeh and vbag.
    might be these are suitable table and field for u r requirement.
    VBEP-WEPOS ( Confirmation status of schedule line )
    VBAG-ABSTA ( Release Status ; current & old release )

  • Definition of  parked status in vendor line item display

    Hi All,
    What is the definition of parked status in vendor line item display?
    Thanks
    Pauline

    Hi,
    1.Please check the WHT config has been done properly.
    2.Check the vendor master and varify tax fields are filled up.
    Regards

  • LCM import of Planning Application Hangs with "In Progress Status"

    Hi,
    LCM import of Planning Application Hangs with "In Progress Status" . its already couple of hours. Earlier it was always within 10 mins.
    Any advise is appreciated.
    Regards,
    Vineet

    It is probably worth trying again, may be useful to first bounce the services.
    If it happens again after bouncing the services then investigate at what staging it is getting stuck at.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How to maintain Status at the line item level

    Hi Folks,
    How to maintain the status at the line item level. I could able to find the path in the IMG for Header level. I will be looking forward for the path or the procedure for maintaining the status at the Line item level. Do the needful. Thank you.
    Regards,
    Amrita

    Hi Amrita,
    Goto SPRO>Customer Relationship Management>Transactions>Basic Settings>Define Item Categories, Select your Item category and click on Details. Witin profiles set type Assign Status profile you created against field Status profile.
    Hope this helps.
    Regards,
    Chandrakant

  • JApplet / application init / start progress status feedback

    We used to put up a separate JFrame during the initization/startup of our applets/applications for status messages. While o.k. for Java Webstart / application modes (& maybe standalone applet mode), this was not pretty for customers embedding our apps in portals.
    So, the goal became to show custom progress/status on the "gray screen" initial applet contentpane until our app desktop is ready to show. Known threading / painting issues during applet startup made this task somewhat non-trival.
    Searched around here on the jdc & found a nice little Moving Ball class & used that as a base for the play app below. Thought I'd post this back to jdc in case anyone else finds it useful. The JApplet code has a main, so same code should work for the app whether deployed as a (plug-in) applet, application JAR or Web Start app.
    The code should show a RED moving ball during init, a YELLOW one during start and a GREEN one after start method is done (w/ball x position update in scrolling pane)....
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.WindowListener;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
        cforster: Uses Ball painting code (from jdc) & separate status area to simulate JApplet
        startup msgs to be shown to user during applet init...
        Point is to show status during applet/application initialization (init / start) methods...
        Can JAR this up & try in appletviewer or using 1.4.2+ plugin, etc.
        With main() also usable in application / Webstart mode....
        If going the application route (or double-click JAR route), need JAR manifest.mf like:
        Manifest-Version: 1.0
        Main-Class: Today
        Created-By: 1.4.2 (Sun Microsystems Inc.)
    public class Today extends JApplet {
        private static Today inst;
        //  Ball color will change from RED (init) -> YELLOW (start) -> RED (start done)
        Color ballColor = Color.RED;
        final int colorSleep = 3000;    // Time to waste in init & start methods
        final int pauseSleep = 25;      // Time between Ball moves/draws
        JTextArea jta = new JTextArea("===  Status  ===" + "\n", 50, 132);
        MovingBall movingBall = new MovingBall(jta);
        public static Today getInstance() {
            if (inst == null) inst = new Today();
            return inst;
        public Today() {
            super();
        public void init() {
            setVisible(true);
            getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));
            movingBall.setPreferredSize(new Dimension(400, 100));
            movingBall.setBackground(Color.lightGray);
            getContentPane().add(movingBall);
            jta.setEditable(false);
            jta.setBackground(Color.lightGray);
            getContentPane().add(new JScrollPane(jta));
            movingBall.start();
            validate();
            try {
                Thread.sleep(colorSleep);
            catch (InterruptedException ie) {      }
        public void start() {
            ballColor = Color.YELLOW;
            validate();
            try {
                Thread.sleep(colorSleep);
            catch (InterruptedException ie) {       }
            ballColor = Color.GREEN;
        public void stop() {
            movingBall.stop();
        public static void main(String args[]) {
            final Today CallingApplet = Today.getInstance();
            JFrame frame = new JFrame("Moving Ball / Load status");
            frame.getContentPane().setLayout(new BorderLayout());
            frame.getContentPane().add("Center", CallingApplet);
            // Use an adapter to close the window
            WindowListener listener = new WindowAdapter() {
                public void windowClosing(WindowEvent e) {
                    System.exit(0);
            frame.addWindowListener(listener);
            frame.setBackground(Color.lightGray);
            frame.pack();
            frame.setSize(400, 400);
            frame.show();
            CallingApplet.init();
            CallingApplet.start();
        class MovingBall extends JPanel implements Runnable {
            final int xPos_Start = 8;
            int xPos = xPos_Start, yPos = 100, rad = 10;
            boolean moveForward = true;
            Thread thread;
            Graphics dbg;
            Image dblImage;
            JTextArea jta = null;
            MovingBall ball = this;
            // Takes in JTestArea that is supposed to be the status msg area...
            // In practice, the staus area & updates are elsewhere...
            public MovingBall(JTextArea jta) {
                this.jta = jta;
            public void start() {
                Thread ballThread = new Thread(this);
                ballThread.start();
            public void run() {
                Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
                yPos = getHeight() / 2 + (rad / 2) + rad;
                while (true) {
                    if (moveForward)
                        xPos++;
                    else
                        xPos--;
                    if (xPos > getWidth() - (2 * rad))
                        moveForward = false;
                    else if (xPos < xPos_Start + (2 * rad)) moveForward = true;
                    SwingUtilities.invokeLater(new Runnable() {
                        public void run() {
                            if (xPos % 20 == 0) {
                                jta.append("xPos = " + xPos + "\n");
                                jta.setCaretPosition(jta.getText().length());
                            ball.paintImmediately(ball.getBounds());
                    try {
                        Thread.sleep(pauseSleep);
                    catch (InterruptedException ie) {
                        break;
            public synchronized void stop() {
                thread = null;
    /*  Not needed for Swing Component (only AWT ?)
              public void update(Graphics g)
                   if(dblImage == null)
                        dblImage = createImage(this.getSize().width, this.getSize().height);
                        dbg = dblImage.getGraphics();
                   dbg.setColor(getBackground());
                   dbg.fillRect(0, 0, this.getSize().width, this.getSize().height);
                   dbg.setColor(getForeground());
                   paintComponent(dbg);
                   g.drawImage(dblImage, 0, 0, this);
            public void paintComponent(Graphics g) {
                g.setColor(getBackground());
                g.fillRect(0, 0, getWidth(), getHeight());
                g.setColor(ballColor);
                g.fillOval(xPos - rad, yPos - rad, 2 * rad, 2 * rad);
    }If anyone plays with this & finds issues/problems or makes improvements to its mechanism, would be nice to post back to this thread.

    hello,
    I found that while configuration of AM there was an warning
    Command deploy executed successfully with following warning messages: Error occurred during application loading phase. The application will not run properly. Please fix your application and redeploy.
    WARNING: com.sun.enterprise.deployment.backend.IASDeploymentException: ContainerBase.addChild: start: LifecycleException:  java.lang.NoClassDefFoundError
    Successfully deployed /amserverthis might help in resolving the issue.
    regards,
    sumant

  • After a new update to Facebook, I cannot write a status from my iPad anymore.  status window pops up and bounces me off FB back to my iPad home page

    after doing the latest update to Facebook, I can no longer write a status on my iPad.  The status window pops up for a second then bounces me off FB back to my iPad home page.  all other Facebook functions are in tact, just can't post a new status.  I deleted fB app and installed it new, but still same status problem.  How can I undo the latest update?

    If you sync with iTunes and if you still have the old app version in iTunes on your computer, you can delete the updated app on the iPad and then sync with iTunes again in order to place the old version back onto the iPad.

  • Forms in PowerShell: putting write-progress onto a pre-made form

    Hello all,
    What I'm wanting to do is use the "Write-Progress" cmdlet and put it onto a form that I've made, instead of having a separate dialogue box for it. Is this possible? Here is the (very simple) form:
    [void][system.reflection.assembly]::LoadWithPartialName("System.Drawing")
    [void][System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
    $objForm = New-Object System.Windows.Forms.Form
    $objForm.Text = "Test"
    $objForm.Size = New-Object System.Drawing.Size(700,300)
    $objForm.StartPosition = "CenterScreen"
    $Form = $objForm.ShowDialog()

    What exactly are you trying to do?  Write-Progress creates it's own form in the ISE, or just displays text based progress in the console, it doesn't have output that you can manipulate that I'm aware of.
    If you want to create your own form for displaying progress, you most likely need to use this method:
    http://learn-powershell.net/2012/10/14/powershell-and-wpf-writing-data-to-a-ui-from-a-different-runspace/
    Because launching a form from Powershell otherwise runs in a single thread and as long as you're interacting with the form, the script won't be doing anything but waiting for input from the form.
    I hope this post has helped!

  • Hi Im using os 10.7.5 and i can't see the progress status in the launch pad and in purchase tab in mac app store. PLEASSSSSEEEE HELP!

    Hi Im using os 10.7.5 and i can't see the progress status in the launch pad and in purchase tab in mac app store. PLEASSSSSEEEE HELP!

    HI guys! can anyone help me with this?!?

  • Pause slide vs. TOC progress status

    Hi again,
    this project gives me hell! I almost finished but there is some ****... trouble again :-/
    Whole project is just demo of set-up and some basics for MS Outlook.
    For navigation im using only TOC. Progressbar below is included in SWF animation on each slide. (its not project progressbar).
    Problem is that project continues to next slide afrer video(animation) ends. But i need it to stop after viewing whole video.
    So i placed some transparent click box in slides with "no action" option and that solved my problem with project continuity,
    unfortunately progress status in TOC isn´t working now because of that click box.
    I would be grateful for some advice.
    Thanks
    Martin

    Hello,
    How is the Success Action for your Click box? Is it set to Continue so that the whole timeline of each slide is played?
    Another possibility is acquiring the TickTOC widget of InfoSemantics.
    Lilybiri

Maybe you are looking for

  • Nokia c5-03 problems!please help

    hello everyone, please somebody can provide me some valuable suggestions for these problems i m having with my newly bought nokia c5-03, i will be gratefull 2 u all. prob 1:GPS is not working ,it always gives error "WAITING FOR GPS". prob 2:some game

  • Profit center derivation in sales order with New GL

    Dear Gurus, We are using the New GL, so EC-PCA is not activated. We would like to set-up a substitution rule in order to derive the profit center in the sales order and customer invoice (we don't want the profit center to always be derived from the c

  • Error [Microsoft][ODBC Excel Driver]Optional feature not implemented...

    Hi All, when i add setAutoCommit(false), i got run error [Microsoft][ODBC Excel Driver]Optional feature not implemented. i just want to insert data into excel using db. can anyone give suggestion?? here my code: public void insertDatabase( ){        

  • Creating a NEW Oracle APPS EUL , How to get Oracle BI Objects in new brand

    Hi there We upgraded Oracle Discoverer 4i to Discoverer 10g and during the upgrade process DBA upgrade the EUL5 in the same schema. Now That schema is corrupt. I have to create a new Brand EUL for Oracle APPS Business Intelligence Views 11.5.10.2. Wh

  • Batch processing for Enabling Usage Rights for Reader

    Hello, We have a lot of documents that we are converting to fillable pdfs using Acorbat 9 which will then be sent out via email to be filled by users. Since there are 50-100 different files, is there a way to use Batch Processing to enable usage righ