Are you able to use sendkeys?
PSH>[system.windows.forms.sendkeys]::sendwait("y"+{ENTER}")
Otherwise, maybe AutoIt:
PSH>$autoit=new-object -comobject autoitx3.control
PSH>$autoit.send("write-host `"test`"");$autoit.send("{ENTER}")
PSH> write-host "test"
test
PSH>
Or even Jaykul's WASP codeplex project (but perhaps you aren't looking
to add a snapin.
Marco
--
Microsoft MVP - Windows PowerShell
http://www.microsoft.com/mvp
PowerGadgets MVP
http://www.powergadgets.com/mvp
Greetings /\/\o\/\/
There was a question on remove-tape last week or so. I didn't see any
mention of a confirm request.
I could be wrong though... Can you post the relevant part of the script
where remove-tape is called?
This is the code the other person posted after I showed them how to loop:
$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
}
Maybe the confirm prompt has to do with whether the tape is ready for
"offsite"?
Marco
The problem is that the script should be able to run unattended,
relevant part :
# Bug, as Confirm parameter not available on Remove-Tape, can'ty
supress confirm prompt.
# remove-tape -tape $_ -DPMLibrary $DPMLib -Confirm:$false
remove-tape -tape $_ -DPMLibrary $DPMLib
I want to first option , but gives error as confirm is not imlemented
Gr /\/\o\/\/
I changed the $confirmPreference,
but at end of day I did see that I might have set $verbosepreference by
accident in script (As I did override both in script with parameters )
I don't think it did/will work but to make absolutely sure I checked all
preferences as I might have missed a setting by accident ( 'High' is default
so kinda sure about that one but need to check 'none' again.
I will ask to check this again tomorrow, as I can't test anymore no DPM
available here.
Greetings /\/\o\/\/
--
Mohit
"/\/\o\/\/ [MVP]" <oM...@discussions.microsoft.com> wrote in message
news:D5486B18-E85B-42FA...@microsoft.com...