<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:11pt; color:#000000; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>It's baked right in to CMD.exe, and they've provided no PowerShell alternative, so if you're pushing at the PowerShell layer, you could use something like this. Yes, the /S /Q syntax on the second function looks odd, but it achieves the desired behavior
 of only taking out the link.</p>
<p><br>
</p>
<p></p>
<div>function New-Symlink<br>
{<br>
    [CmdletBinding()]<br>
    param([string]$Link, [string]$Target);<br>
    Start-Process-Custom -FilePath "cmd.exe" -ArgumentList "/C mklink /D `"$Link`" `"$Target`"";<br>
}<br>
<br>
function Remove-Symlink<br>
{<br>
    [CmdletBinding()]<br>
    param([string]$Link);<br>
    Start-Process-Custom -FilePath "cmd.exe" -ArgumentList "/C rmdir /S /Q `"$Link`"";<br>
}</div>
<p></p>
<p><br>
</p>
<p>Also relevant for those trying to automate (or at least script) their Oracle Java installs on Windows is a way to programatically check the Oracle License Agreement:</p>
<p><br>
</p>
<p></p>
<div>function Get-OracleDownload<br>
{<br>
    param([URI]$URI, [string]$OutFile);<br>
<br>
    $session = New-Object Microsoft.PowerShell.Commands.WebRequestSession;<br>
<br>
    $oracle_cookie = New-Object System.Net.Cookie ;<br>
    <br>
    $oracle_cookie.Name = "oraclelicense";<br>
    $oracle_cookie.Value = "accept-securebackup-cookie";<br>
    $oracle_cookie.Domain = ".oracle.com";<br>
<br>
    $session.Cookies.Add($oracle_cookie);<br>
<br>
    Invoke-WebRequest -Uri $URI -WebSession $session -TimeoutSec 900 -OutFile $OutFile -ErrorAction Stop;<br>
<br>
    return $OutFile;<br>
}</div>
<p></p>
<p><br>
</p>
<p>Michael<br>
</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> users <users-bounces@shibboleth.net> on behalf of Cantor, Scott <cantor.2@osu.edu><br>
<b>Sent:</b> Friday, December 2, 2016 3:59:58 PM<br>
<b>To:</b> Shib Users<br>
<b>Subject:</b> Re: Windows server and Oracle Java updates</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">On 12/2/16, 4:57 PM, "users on behalf of Dave Bartholomew" <users-bounces@shibboleth.net on behalf of Dave.Bartholomew@csueastbay.edu> wrote:<br>
<br>
>> to expect people to maintain a symlinked folder to the "latest" jre/jdk<br>
>>    and use that explicitly.<br>
>    Yes, I would do that too - if I were still running on Linux...<br>
<br>
Windows supports symlinks too.<br>
<br>
-- Scott<br>
 <br>
<br>
-- <br>
To unsubscribe from this list send an email to users-unsubscribe@shibboleth.net<br>
</div>
</span></font>
</body>
</html>