Tuesday, August 6, 2024

Windows: Setting a shortcut to a launch a java jar file

Create a shortcut and edit the properties -> Target to; javaw.exe -jar yourjava.jar 

In the example below I'm using fakeSMTP , an smtp server emulator I've mentioned in a previous post.





Friday, August 2, 2024

A couple of PowerShell scripts for IIS I've found handy

 A couple of handy IIS Dumps of sites and virtual directories.

Sites

Import-Module Webadministration
Get-ChildItem -Path IIS:\Sites > d:\allsites.txt

 Virtual Directories

$SiteVirtualDirectories = @()
$Sites = gci IIS:\Sites
foreach($Site in $Sites)
    {
    $VirtualDirectories = gci "IIS:\Sites\$($Site.Name)" | ?{$_.NodeType -match "virtualDirectory"}
    foreach($VirtualDirectory in $VirtualDirectories)
        {
        $SiteVirtualDirectories += @([pscustomobject]@{Site=$Site.Name;VirtualDirectory=$VirtualDirectory.Name;PhysicalPath=$VirtualDirectory.PhysicalPath})
        }
    }

Out-File -FilePath D:\VirtualDirectories.txt -InputObject $SiteVirtualDirectories -Encoding ASCII