-
Notifications
You must be signed in to change notification settings - Fork 0
/
IISRFBaseline-allowHighBitCharacters-FS.psm1
82 lines (66 loc) · 2.31 KB
/
IISRFBaseline-allowHighBitCharacters-FS.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
function Get-RFLpQueryAllowHighBitCharactersFS
{
<#
.SYNOPSIS
Creates Logparser query for RF allowHighBitCharacters baseline using website content directory.
.EXAMPLE
Get-RFLpQueryAllowHighBitCharacters -ContentDir \\server.domain.com\website -OutputDir D:\WorkingFolder\
#>
[CmdletBinding()]
param(
[parameter(Mandatory=$true)]
[System.String]
# Website content directory.
$ContentDir
,
[parameter(Mandatory=$true)]
[System.String]
# Outut directory for writing files.
$OutputDir
)
$ResultFile = Join-Path -Path $OutputDir -ChildPath 'lp_results_allowHighBitCharacters_FS.csv'
return @"
--lp_query_allowHighBitCharacters_FS.sql--
SELECT
Path,
Name,
URLESCAPE(Name) AS EncodedName
INTO $ResultFile
FROM $ContentDir
WHERE
EncodedName LIKE '%\%8%' OR
EncodedName LIKE '%\%9%' OR
EncodedName LIKE '%\%a%' OR
EncodedName LIKE '%\%b%' OR
EncodedName LIKE '%\%c%' OR
EncodedName LIKE '%\%d%' OR
EncodedName LIKE '%\%e%' OR
EncodedName LIKE '%\%f%'
--lp_query_allowHighBitCharacters_FS.sql--
"@
} # End function Get-RFLpQueryAllowHighBitCharactersFS
function New-RFLpFileAllowHighBitCharactersFS
{
<#
.SYNOPSIS
Creates Logparser file for RF allowHighBitCharacters baseline using website content directory.
.EXAMPLE
New-RFLpFileAllowHighBitCharactersFS -ContentDir \\server.domain.com\website -OutputDir D:\WorkingFolder\
#>
[CmdletBinding()]
param(
[parameter(Mandatory=$true)]
[System.String]
# Website content directory.
$ContentDir
,
[parameter(Mandatory=$true)]
[System.String]
# Outut directory for writing files.
$OutputDir
)
$FileLocation = Join-Path -Path $OutputDir -ChildPath 'lp_query_allowHighBitCharacters_FS.sql'
Get-RFLpQueryAllowHighBitCharactersFS -ContentDir $ContentDir -OutputDir $OutputDir | Out-File -LiteralPath $FileLocation -Force -Encoding ascii
return $FileLocation
} # End function New-RFLpFileAllowHighBitCharactersFS
Export-ModuleMember -Function 'Get-RFLpQueryAllowHighBitCharactersFS','New-RFLpFileAllowHighBitCharactersFS'