NotePage, Inc. Forum Index

Powershell

 
Post new topic   Reply to topic    NotePage, Inc. Forum Index -> PageGate Support
View previous topic :: View next topic  
Author Message
MartinRoy



Joined: 28 May 2010
Posts: 2

PostPosted: Fri May 28, 2010 7:08 am    Post subject: Powershell Reply with quote

Hi,

I was a VBScript fan and I discover Powershell.

In a DOS prompt I was able to sent page with this command
\\paging-srv\pagegate\page\sendpage.exe -dir=\\paging-srv\share "pagenet 88888888" Test Test

It is working great in DOS/VBScript but when I tried this command in Powershell, the command executed succesfully, no warning but nothing appear in the \\paging-srv\share.

I have check the log file and nothing appear.

Thank you


Back to top
View user's profile
Tech Support



Joined: 25 Aug 2003
Posts: 4382

PostPosted: Fri May 28, 2010 8:07 am    Post subject: Reply with quote

Try running the command like this:


\\paging-srv\pagegate\page\sendpage.exe 88888888 pagenet Test Test

That should send a message to a recipient named 88888888 from the sender pagenet and the message itself is Test Test



_________________
Tech Support
support@notepage.com
http://www.notepage.net
Back to top
View user's profile
MartinRoy



Joined: 28 May 2010
Posts: 2

PostPosted: Mon May 31, 2010 7:06 am    Post subject: Reply with quote

The command work perfectly.

I use this code to check if the call is FAILED or SUCCESSFULL, is there another way to check this?

Code:

[int] $Rand = get-random -minimum 100000000 -maximum 999999999
\\paging-srv\pagegate\page\sendpage.exe "pagenet $Num" $Description $NewPassword"

$Etat = ""
$i = 1
while ($i -le 12)
{
   $Message = "Checking... ($i/12)"
   $Message
   get-childitem \\paging-srv\PageGate\Log\pagegate.log | select-string -pattern $NewPassword | foreach {$Etat = $_.line -match "SUCCESSFUL"}
   If ($Etat)    { break }
   ElseIf ($Etat -eq $False) { break }
   Else { Start-Sleep -s 10 }
   $i++
}
If ($Etat) { 'SUCCESS }
Else
{ 'FAILED' }



Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    NotePage, Inc. Forum Index -> PageGate Support All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
Theme created by Vjacheslav Trushkin