FAQ  •  Register  •  Login

Powershell calls

<<

fixitchris

Streaming enthusiast

Posts: 23

Joined: Fri Dec 17, 2010 1:44 pm

Post Thu Feb 17, 2011 4:18 am

Powershell calls

  Code:
$req = [System.Net.WebRequest]::Create("http://localhost:23423/rest/application");
$req.Method ="GET";
$req.ContentLength = 0;
$resp = $req.GetResponse();
$reader = new-object System.IO.StreamReader($resp.GetResponseStream());
$reader.ReadToEnd();
<<

PK500

Serviio newbie

Posts: 3

Joined: Sat Jul 30, 2011 11:15 am

Post Sat Jul 30, 2011 3:55 pm

Re: Powershell calls

FORCE REFRESH

$req = [System.Net.WebRequest]::Create("http://localhost:23423/rest/action");
$req.Method ="POST";
$req.ContentType = "text/xml";
$Params = "<action><name>forceLibraryRefresh</name></action>";
$req.ContentLength = $Params.Length;
$stOut = new-object System.IO.StreamWriter($req.GetRequestStream());
$stOut.Write($Params);
$stOut.Close();
$resp = $req.GetResponse();
$reader = new-object System.IO.StreamReader($resp.GetResponseStream());
$reader.ReadToEnd();

------------
Windows7
1. Save to script as C:/bat/Refresh.ps1 file
2. Start All programs, Accessorie - Power shell
3. set-executionpolicy remotesigned (I should setup low security)
4. close it
5. Create bat file
6. Insert line: cmd /c start powershell -noninteractive c:\\bat\\Refresh.ps1"
7. Close

Serviio is very nice! Thank you

Return to Third-party tools integration

Who is online

Users browsing this forum: No registered users and 21 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.