-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dramatic.NZBIndex.psm1
45 lines (32 loc) · 1.33 KB
/
Dramatic.NZBIndex.psm1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Dramatic.NZBIndex.psm1
# Scraping the NZBIndex site
# Dec 2014
# If this works, this was written by Victor Vogelpoel ([email protected])
# If it doesn't work, I don't know who wrote this.
#requires -version 3.0
Set-PSDebug -Strict
Set-StrictMode -Version Latest
# Always stop at an error
$global:ErrorActionPreference = "Stop"
Add-Type -AssemblyName 'System.Web'
#----------------------------------------------------------------------------------------------------------------------
# Set variables
$script:thisModuleDirectory = $PSScriptRoot # Directory path\Dramatic.NZBIndex\
# Load the HtmlAgility Pack DLL (for easily scraping an HTML page)
Add-Type -path (Join-Path $PSScriptRoot 'bin\HtmlAgilityPack.dll')
#----------------------------------------------------------------------------------------------------------------------
# Dot source any related scripts and functions in the same directory as this module
$ignoreCommandsForDotSourcing = @(
'install.ps1'
)
Get-ChildItem $script:thisModuleDirectory\*.ps1 | foreach {
if ($ignoreCommandsForDotSourcing -notcontains $_.Name)
{
Write-Verbose "Importing functions from file '$($_.Name)' by dotsourcing `"$($_.Fullname)`""
. $_.Fullname
}
else
{
Write-Verbose "Ignoring file '$($_.Name)'"
}
}