Powershell calls
2 posts
• Page 1 of 1
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
$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
2 posts
• Page 1 of 1
Return to Third-party tools integration
Who is online
Users browsing this forum: Google [Bot] and 8 guests