<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="http://www.de12werken.nl/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="http://www.de12werken.nl/feed.php">
        <title>Notes - microsoft:scripting:powershell:snippets</title>
        <description></description>
        <link>http://www.de12werken.nl/</link>
        <image rdf:resource="http://www.de12werken.nl/lib/exe/fetch.php?media=wiki:dokuwiki.svg" />
       <dc:date>2026-04-05T17:11:27+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="http://www.de12werken.nl/doku.php?id=microsoft:scripting:powershell:snippets:disableenablellmnr&amp;rev=1518075969&amp;do=diff"/>
                <rdf:li rdf:resource="http://www.de12werken.nl/doku.php?id=microsoft:scripting:powershell:snippets:importmodule&amp;rev=1518081787&amp;do=diff"/>
                <rdf:li rdf:resource="http://www.de12werken.nl/doku.php?id=microsoft:scripting:powershell:snippets:logging&amp;rev=1518075898&amp;do=diff"/>
                <rdf:li rdf:resource="http://www.de12werken.nl/doku.php?id=microsoft:scripting:powershell:snippets:winrmtrustedhosts&amp;rev=1518076813&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="http://www.de12werken.nl/lib/exe/fetch.php?media=wiki:dokuwiki.svg">
        <title>Notes</title>
        <link>http://www.de12werken.nl/</link>
        <url>http://www.de12werken.nl/lib/exe/fetch.php?media=wiki:dokuwiki.svg</url>
    </image>
    <item rdf:about="http://www.de12werken.nl/doku.php?id=microsoft:scripting:powershell:snippets:disableenablellmnr&amp;rev=1518075969&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2018-02-08T07:46:09+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>disableenablellmnr</title>
        <link>http://www.de12werken.nl/doku.php?id=microsoft:scripting:powershell:snippets:disableenablellmnr&amp;rev=1518075969&amp;do=diff</link>
        <description>Microsoft - Scripting - PowerShell - Snippets - Disable/Enable LLMNR

A snippet to disable LLMNR at the start of a script, so a DNS name resolution call would not get resolved with LLMNR [System.Net.Dns]::GetHostAddresses(“SERVERNAME”) , and re-enable LLMNR at the end of the script.</description>
    </item>
    <item rdf:about="http://www.de12werken.nl/doku.php?id=microsoft:scripting:powershell:snippets:importmodule&amp;rev=1518081787&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2018-02-08T09:23:07+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>importmodule</title>
        <link>http://www.de12werken.nl/doku.php?id=microsoft:scripting:powershell:snippets:importmodule&amp;rev=1518081787&amp;do=diff</link>
        <description>Microsoft - Scripting - PowerShell - Snippets - Import Module

Check if a particular module, in this case BitsTransfer, is loaded, and if not load it.


$objModuleLoaded = Get-Module BitsTransfer

if (-Not $objModuleLoaded) {

	$strMsg = &quot;Loading BitsTransfer module.&quot;

	Write-Host
	Write-Host $strMsg

	try {

		Import-Module BitsTransfer -ErrorAction Stop
		
	} catch {

		$strMsg = &quot;Could not load BitsTransfer PowerShell module. Ending script.&quot;
		
		Write-Host $strMsg -ForeGroundColor Red
		Writ…</description>
    </item>
    <item rdf:about="http://www.de12werken.nl/doku.php?id=microsoft:scripting:powershell:snippets:logging&amp;rev=1518075898&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2018-02-08T07:44:58+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>logging</title>
        <link>http://www.de12werken.nl/doku.php?id=microsoft:scripting:powershell:snippets:logging&amp;rev=1518075898&amp;do=diff</link>
        <description>Microsoft - Scripting - PowerShell - Snippets - Logging

Provides the following functions to log to a CSV file:

	*  InitLog: to start an empty log if not previous log exists.
	*  AppendToLog: to add a line to the CSV log.
	*  Log-Info: to log and show an informational message.</description>
    </item>
    <item rdf:about="http://www.de12werken.nl/doku.php?id=microsoft:scripting:powershell:snippets:winrmtrustedhosts&amp;rev=1518076813&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2018-02-08T08:00:13+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>winrmtrustedhosts</title>
        <link>http://www.de12werken.nl/doku.php?id=microsoft:scripting:powershell:snippets:winrmtrustedhosts&amp;rev=1518076813&amp;do=diff</link>
        <description>Microsoft - Scripting - PowerShell - Snippets - WinRM TrustedHosts

A snippet to store the current WinRM TrustedHosts in a avariable and set it to * at the start of a script, so that a New-PSSession command does not error on hosts not part of the same domain as the computer running the script, and restore the old TrustedHosts value at the end of the script.</description>
    </item>
</rdf:RDF>
