Skip to content
This repository was archived by the owner on Dec 8, 2021. It is now read-only.

Commit 35cf0a2

Browse files
jeremymcgee73Tiberriver256
authored andcommitted
Fix #148: Added git attributes for Line Endings (#142)
* Add git attributes * Fix Line Endings * Looks good to me! Co-Authored-By: jeremymcgee73 <jeremymcgee6@gmail.com>
1 parent d7a0bdd commit 35cf0a2

File tree

3 files changed

+199
-194
lines changed

3 files changed

+199
-194
lines changed

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
* text=auto
2+
3+
*.ps1 text eol=lf
4+
*.psd1 text eol=lf
5+
*.psm1 text eol=lf

Polaris.psd1

Lines changed: 136 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -1,136 +1,136 @@
1-
#
2-
# Module manifest for module 'Polaris'
3-
#
4-
# Generated by: tylerleonhardt
5-
#
6-
# Generated on: 9/8/17
7-
#
8-
9-
@{
10-
11-
# Script module or binary module file associated with this manifest.
12-
RootModule = "Polaris.psm1"
13-
14-
# Version number of this module.
15-
ModuleVersion = '0.1.0'
16-
17-
# Supported PSEditions
18-
CompatiblePSEditions = @('Desktop', 'Core')
19-
20-
# ID used to uniquely identify this module
21-
GUID = 'd9c86d71-cda6-431e-b297-34e0560f8e30'
22-
23-
# Author of this module
24-
Author = 'Microsoft Corporation'
25-
26-
# Company or vendor of this module
27-
CompanyName = 'Microsoft Corporation'
28-
29-
# Copyright statement for this module
30-
Copyright = '© Microsoft Corporation. All rights reserved'
31-
32-
# Description of the functionality provided by this module
33-
Description = 'A cross-platform, minimalist web framework for PowerShell'
34-
35-
# Minimum version of the Windows PowerShell engine required by this module
36-
PowerShellVersion = '5.1'
37-
38-
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
39-
# CLRVersion = ''
40-
41-
# Processor architecture (None, X86, Amd64) required by this module
42-
# ProcessorArchitecture = ''
43-
44-
# Modules that must be imported into the global environment prior to importing this module
45-
# RequiredModules = @()
46-
47-
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
48-
ScriptsToProcess = @(
49-
"Public\New-ScriptblockCallback.ps1",
50-
"lib\MimeTypes.Class.ps1",
51-
"lib\PolarisRequest.Class.ps1",
52-
"lib\PolarisResponse.Class.ps1",
53-
"lib\PolarisMiddleware.Class.ps1",
54-
"lib\Polaris.Class.ps1"
55-
)
56-
57-
# Type files (.ps1xml) to be loaded when importing this module
58-
# TypesToProcess = @()
59-
60-
# Format files (.ps1xml) to be loaded when importing this module
61-
# FormatsToProcess = @()
62-
63-
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
64-
# NestedModules = @()
65-
66-
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
67-
FunctionsToExport = @(
68-
'Get-Polaris'
69-
'Clear-Polaris'
70-
'New-PolarisRoute'
71-
'Remove-PolarisRoute'
72-
'Get-PolarisRoute'
73-
'New-PolarisGetRoute'
74-
'New-PolarisPostRoute'
75-
'New-PolarisPutRoute'
76-
'New-PolarisDeleteRoute'
77-
'New-PolarisStaticRoute'
78-
'New-PolarisRouteMiddleware'
79-
'New-ScriptblockCallback'
80-
'Remove-PolarisRouteMiddleware'
81-
'Get-PolarisRouteMiddleware'
82-
'Use-PolarisJsonBodyParserMiddleware'
83-
'New-DirectoryBrowser'
84-
'Start-Polaris'
85-
'Stop-Polaris' )
86-
87-
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
88-
CmdletsToExport = @()
89-
90-
# Variables to export from this module
91-
VariablesToExport = '*'
92-
93-
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
94-
AliasesToExport = '*'
95-
96-
# List of all modules packaged with this module
97-
# ModuleList = @()
98-
99-
# List of all files packaged with this module
100-
# FileList = @()
101-
102-
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
103-
PrivateData = @{
104-
105-
PSData = @{
106-
107-
# Tags applied to this module. These help with module discovery in online galleries.
108-
Tags = @('web','core','framework','REST')
109-
110-
# A URL to the license for this module.
111-
LicenseUri = 'https://github.com/PowerShell/Polaris/blob/master/LICENSE.txt'
112-
113-
# A URL to the main website for this project.
114-
ProjectUri = 'https://github.com/PowerShell/Polaris'
115-
116-
# A URL to an icon representing this module.
117-
# IconUri = ''
118-
119-
# ReleaseNotes of this module
120-
ReleaseNotes = @'
121-
# 0.1.0
122-
123-
Initial Release.
124-
'@
125-
126-
} # End of PSData hashtable
127-
128-
} # End of PrivateData hashtable
129-
130-
# HelpInfo URI of this module
131-
# HelpInfoURI = ''
132-
133-
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
134-
# DefaultCommandPrefix = ''
135-
136-
}
1+
#
2+
# Module manifest for module 'Polaris'
3+
#
4+
# Generated by: tylerleonhardt
5+
#
6+
# Generated on: 9/8/17
7+
#
8+
9+
@{
10+
11+
# Script module or binary module file associated with this manifest.
12+
RootModule = "Polaris.psm1"
13+
14+
# Version number of this module.
15+
ModuleVersion = '0.1.0'
16+
17+
# Supported PSEditions
18+
CompatiblePSEditions = @('Desktop', 'Core')
19+
20+
# ID used to uniquely identify this module
21+
GUID = 'd9c86d71-cda6-431e-b297-34e0560f8e30'
22+
23+
# Author of this module
24+
Author = 'Microsoft Corporation'
25+
26+
# Company or vendor of this module
27+
CompanyName = 'Microsoft Corporation'
28+
29+
# Copyright statement for this module
30+
Copyright = '© Microsoft Corporation. All rights reserved'
31+
32+
# Description of the functionality provided by this module
33+
Description = 'A cross-platform, minimalist web framework for PowerShell'
34+
35+
# Minimum version of the Windows PowerShell engine required by this module
36+
PowerShellVersion = '5.1'
37+
38+
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
39+
# CLRVersion = ''
40+
41+
# Processor architecture (None, X86, Amd64) required by this module
42+
# ProcessorArchitecture = ''
43+
44+
# Modules that must be imported into the global environment prior to importing this module
45+
# RequiredModules = @()
46+
47+
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
48+
ScriptsToProcess = @(
49+
"Public\New-ScriptblockCallback.ps1",
50+
"lib\MimeTypes.Class.ps1",
51+
"lib\PolarisRequest.Class.ps1",
52+
"lib\PolarisResponse.Class.ps1",
53+
"lib\PolarisMiddleware.Class.ps1",
54+
"lib\Polaris.Class.ps1"
55+
)
56+
57+
# Type files (.ps1xml) to be loaded when importing this module
58+
# TypesToProcess = @()
59+
60+
# Format files (.ps1xml) to be loaded when importing this module
61+
# FormatsToProcess = @()
62+
63+
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
64+
# NestedModules = @()
65+
66+
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
67+
FunctionsToExport = @(
68+
'Get-Polaris'
69+
'Clear-Polaris'
70+
'New-PolarisRoute'
71+
'Remove-PolarisRoute'
72+
'Get-PolarisRoute'
73+
'New-PolarisGetRoute'
74+
'New-PolarisPostRoute'
75+
'New-PolarisPutRoute'
76+
'New-PolarisDeleteRoute'
77+
'New-PolarisStaticRoute'
78+
'New-PolarisRouteMiddleware'
79+
'New-ScriptblockCallback'
80+
'Remove-PolarisRouteMiddleware'
81+
'Get-PolarisRouteMiddleware'
82+
'Use-PolarisJsonBodyParserMiddleware'
83+
'New-DirectoryBrowser'
84+
'Start-Polaris'
85+
'Stop-Polaris' )
86+
87+
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
88+
CmdletsToExport = @()
89+
90+
# Variables to export from this module
91+
VariablesToExport = '*'
92+
93+
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
94+
AliasesToExport = '*'
95+
96+
# List of all modules packaged with this module
97+
# ModuleList = @()
98+
99+
# List of all files packaged with this module
100+
# FileList = @()
101+
102+
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
103+
PrivateData = @{
104+
105+
PSData = @{
106+
107+
# Tags applied to this module. These help with module discovery in online galleries.
108+
Tags = @('web','core','framework','REST')
109+
110+
# A URL to the license for this module.
111+
LicenseUri = 'https://github.com/PowerShell/Polaris/blob/master/LICENSE.txt'
112+
113+
# A URL to the main website for this project.
114+
ProjectUri = 'https://github.com/PowerShell/Polaris'
115+
116+
# A URL to an icon representing this module.
117+
# IconUri = ''
118+
119+
# ReleaseNotes of this module
120+
ReleaseNotes = @'
121+
# 0.1.0
122+
123+
Initial Release.
124+
'@
125+
126+
} # End of PSData hashtable
127+
128+
} # End of PrivateData hashtable
129+
130+
# HelpInfo URI of this module
131+
# HelpInfoURI = ''
132+
133+
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
134+
# DefaultCommandPrefix = ''
135+
136+
}

Public/Start-Polaris.ps1

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,58 @@
1-
<#
2-
.SYNOPSIS
3-
Start Polaris web server.
4-
.DESCRIPTION
5-
Start Polaris web server.
6-
.PARAMETER Port
7-
Port number to listen on.
8-
Defaults to 8080.
9-
.PARAMETER MinRunspaces
10-
Minimum number of PowerShell runspaces for web server to use.
11-
Defaults to 1.
12-
.PARAMETER MaxRunspaces
13-
Maximum number of PowerShell runspaces for web server to use.
14-
Defaults to 1.
15-
.PARAMETER UseJsonBodyParserMiddleware
16-
When present, JSONBodyParser middleware will be created, if needed.
17-
.PARAMETER Polaris
18-
A Polaris object
19-
Defaults to the script scoped Polaris
20-
.EXAMPLE
21-
Start-Polaris
22-
.EXAMPLE
23-
Start-Polaris -Port 8081 -MinRunspaces 2 -MaxRunspaces 10 -UseJsonBodyParserMiddleware
24-
#>
25-
function Start-Polaris {
26-
[CmdletBinding()]
27-
param(
28-
[Int32]
29-
$Port = 8080,
30-
31-
[Int32]
32-
$MinRunspaces = 1,
33-
34-
[Int32]
35-
$MaxRunspaces = 1,
36-
37-
[switch]
38-
$UseJsonBodyParserMiddleware = $False,
39-
40-
[switch]
41-
$Https = $False,
42-
43-
$Polaris = $Script:Polaris
44-
)
45-
46-
if ( -not $Polaris) {
47-
CreateNewPolarisIfNeeded
48-
$Polaris = $Script:Polaris
49-
}
50-
51-
if ( $UseJsonBodyParserMiddleware ) {
52-
Use-PolarisJsonBodyParserMiddleware -Polaris $Polaris
53-
}
54-
55-
$Polaris.Start( $Port, $Https.IsPresent )
56-
57-
return $Polaris
58-
}
1+
<#
2+
.SYNOPSIS
3+
Start Polaris web server.
4+
.DESCRIPTION
5+
Start Polaris web server.
6+
.PARAMETER Port
7+
Port number to listen on.
8+
Defaults to 8080.
9+
.PARAMETER MinRunspaces
10+
Minimum number of PowerShell runspaces for web server to use.
11+
Defaults to 1.
12+
.PARAMETER MaxRunspaces
13+
Maximum number of PowerShell runspaces for web server to use.
14+
Defaults to 1.
15+
.PARAMETER UseJsonBodyParserMiddleware
16+
When present, JSONBodyParser middleware will be created, if needed.
17+
.PARAMETER Polaris
18+
A Polaris object
19+
Defaults to the script scoped Polaris
20+
.EXAMPLE
21+
Start-Polaris
22+
.EXAMPLE
23+
Start-Polaris -Port 8081 -MinRunspaces 2 -MaxRunspaces 10 -UseJsonBodyParserMiddleware
24+
#>
25+
function Start-Polaris {
26+
[CmdletBinding()]
27+
param(
28+
[Int32]
29+
$Port = 8080,
30+
31+
[Int32]
32+
$MinRunspaces = 1,
33+
34+
[Int32]
35+
$MaxRunspaces = 1,
36+
37+
[switch]
38+
$UseJsonBodyParserMiddleware = $False,
39+
40+
[switch]
41+
$Https = $False,
42+
43+
$Polaris = $Script:Polaris
44+
)
45+
46+
if ( -not $Polaris) {
47+
CreateNewPolarisIfNeeded
48+
$Polaris = $Script:Polaris
49+
}
50+
51+
if ( $UseJsonBodyParserMiddleware ) {
52+
Use-PolarisJsonBodyParserMiddleware -Polaris $Polaris
53+
}
54+
55+
$Polaris.Start( $Port, $Https.IsPresent )
56+
57+
return $Polaris
58+
}

0 commit comments

Comments
 (0)