![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | Show output of steps of PS script Hi, I have been looking, but so far have not been able to find, a way to output the steps of a script, either to screen or to file. The exact purpose in this case has to do with System Center Data Protection Manager 2007. We have been able to create a basic script that will export tapes for the library to the I/E port so we can send them off-site. However, we would like a per-tape output so we can monitor (live, with output to screen) or later on (with the output sent to a logfile) the progress of the script. Write-Progress can only give me a progressbar, but surely it must be possible to show something like below? B00000002 B00000034 B00000067 B00000098 B00000107 As this is more of a general PS question I decided to post it here and cross-post it to the DPM group. Kind regards, LF |
My System Specs![]() |
| | #2 (permalink) | ||||||||||||
| Guest | Re: Show output of steps of PS script
Write-host "something" and add-content some_file "something" Are cmdlets that can write information to the screen/console and a file respectively. Can we see a copy of this script? Just to know what cmdlets are being used. Marco -- Microsoft MVP - Windows PowerShell http://www.microsoft.com/mvp PowerGadgets MVP http://www.powergadgets.com/mvp Blog: http://marcoshaw.blogspot.com | ||||||||||||
My System Specs![]() | |||||||||||||
| | #3 (permalink) | ||||||||||||||||||||||||||||||||||||
| Guest | Re: Show output of steps of PS script Marco, Below is the script. It is all still very basic with just doing what it needs to do - our first goal now is to get a set of working scripts to get the tape handling right. === BOS === $DPMLib = Get-DPMLibrary -DPMServerName "DPMServer1" $Tape = Get-Tape -DPMLibrary $DPMLib $export = $tape | where-object {$_.isoffsiteready -eq "True"} | where- object {$_.displaystring -like "*Offsite*"} remove-tape -tape $export -DPMLibrary $DPMLib === OES === Tnx, LF On 31 jan, 15:05, "Marco Shaw [MVP]" <marco.shaw@_NO_SPAM_gmail.com> wrote:
| ||||||||||||||||||||||||||||||||||||
My System Specs![]() | |||||||||||||||||||||||||||||||||||||
| | #4 (permalink) | ||||||||||||
| Guest | Re: Show output of steps of PS script
$DPMLib = Get-DPMLibrary -DPMServerName "DPMServer1" $Tape = Get-Tape -DPMLibrary $DPMLib $export = $tape | where-object {$_.isoffsiteready -eq "True"} | where- object {$_.displaystring -like "*Offsite*"} foreach($tape in $export){ write-host "Removing $tape..." remove-tape -tape $tape -DPMLibrary $DPMLib } | ||||||||||||
My System Specs![]() | |||||||||||||
| | #5 (permalink) | ||||||||||||
| Guest | Re: Show output of steps of PS script Try wrapping your script in calls to Start-Transcript and Stop-Transcript e.g.L Start-Transcript DPM.log $DPMLib = Get-DPMLibrary -DPMServerName "DPMServer1" $Tapes = Get-Tape -DPMLibrary $DPMLib $exports = $tape | where {$_.isoffsiteready -and ($_.displaystring -match "Offsite")} $exports | foreach { "output some info here"; remove-tape -tape $_ -DPMLibrary $DPMLib } Stop-Transcript Note: If the remove-tape has a -Verbose parameter you might want to use it. Also if you already have a transcript running for your shell sesssion you will need to stop it. There can only be one transcript started at any one time in a shell session. -- Keith "LordFox" <rick.harderwijk@xxxxxx> wrote in message news:0c730c30-f12b-450b-a932-f65879a4ee0b@xxxxxx
| ||||||||||||
My System Specs![]() | |||||||||||||
| | #6 (permalink) |
| Newbie Rep Power: 4 ![]() | Re: Show output of steps of PS script LordFox, Did you manage to get this script running. I too have been searching for a way to eject tapes that are offsite ready via the I/E port on our ADIC Scalar24 SCSI Tape Libray. I have tried the suggetsed scripts, but they always error on the remove-tape cmdlet section. If you have had any further success,could you please share it with me Thanks Michael |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Paging output in a Powershell Script | Kevin | PowerShell | 10 | 10-18-2007 03:44 AM |
| output .ps1 script to text file | Aaron | PowerShell | 2 | 07-11-2007 05:30 PM |
| Hide console and capture output from script? | Brian Vallelunga | PowerShell | 4 | 04-03-2007 01:43 PM |
| Send .ps1 script output as e-mail body | Stephen Merkel | PowerShell | 9 | 02-09-2007 08:59 AM |
| PS script prints output instead of executing commands | Andy Webster | PowerShell | 4 | 12-29-2006 10:52 AM |