Skip to content
This repository was archived by the owner on Apr 3, 2020. It is now read-only.

Commit 1bd4621

Browse files
authored
Merge pull request #13 from jhochwald/develop
1.0.8 - 2019-01-19
2 parents 447439b + ed4d473 commit 1bd4621

File tree

101 files changed

+12461
-388
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+12461
-388
lines changed

.vscode/tasks.json

Lines changed: 134 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,136 @@
1-
// Available variables which can be used inside of strings.
2-
// ${workspaceRoot}: the root folder of the team
3-
// ${file}: the current opened file
4-
// ${relativeFile}: the current opened file relative to workspaceRoot
5-
// ${fileBasename}: the current opened file's basename
6-
// ${fileDirname}: the current opened file's dirname
7-
// ${fileExtname}: the current opened file's extension
8-
// ${cwd}: the current working directory of the spawned process
1+
// A task runner that invokes Pester to run all Pester tests under the
2+
// current workspace folder.
3+
// NOTE: This Test task runner requires an updated version of Pester (>=4.0.3)
4+
// in order for the problemMatcher to find failed test information (message, line, file).
5+
// If you don't have that version, you can update Pester from the PowerShell Gallery
6+
// with this command:
7+
//
8+
// PS C:\> Update-Module Pester
9+
//
10+
// If that gives an error like:
11+
// "Module 'Pester' was not installed by using Install-Module, so it cannot be updated."
12+
// then execute:
13+
//
14+
// PS C:\> Install-Module Pester -Scope CurrentUser -Force
15+
//
16+
// NOTE: The Clean, Build and Publish tasks require PSake. PSake can be installed
17+
// from the PowerShell Gallery with this command:
18+
//
19+
// PS C:\> Install-Module PSake -Scope CurrentUser -Force
20+
//
21+
// Available variables which can be used inside of strings:
22+
// ${workspaceFolder} the path of the workspace folder that contains the tasks.json file
23+
// ${workspaceFolderBasename} the name of the workspace folder that contains the tasks.json file without any slashes (/)
24+
// ${file} the current opened file
25+
// ${relativeFile} the current opened file relative to the workspace folder containing the file
26+
// ${fileBasename} the current opened file's basename
27+
// ${fileBasenameNoExtension} the current opened file's basename without the extension
28+
// ${fileDirname} the current opened file's dirname
29+
// ${fileExtname} the current opened file's extension
30+
// ${cwd} the task runner's current working directory on startup
31+
// ${lineNumber} the current selected line number in the active file
932
{
10-
// See https://go.microsoft.com/fwlink/?LinkId=733558
11-
// for the documentation about the tasks.json format
12-
"version": "2.0.0",
13-
// Start PowerShell
14-
"windows": {
15-
"command": "powershell.exe",
16-
"args": [
17-
"-NoProfile",
18-
"-ExecutionPolicy",
19-
"Bypass"
20-
]
21-
},
22-
"linux": {
23-
"command": "/usr/bin/pwsh",
24-
"args": [
25-
"-NoProfile"
26-
]
27-
},
28-
"osx": {
29-
"command": "/usr/local/bin/pwsh",
30-
"args": [
31-
"-NoProfile"
32-
]
33-
}
33+
"version": "2.0.0",
34+
"windows": {
35+
"options": {
36+
"shell": {
37+
"executable": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
38+
"args": [
39+
"-NoProfile",
40+
"-ExecutionPolicy",
41+
"Bypass",
42+
"-Command"
43+
]
44+
}
45+
}
46+
},
47+
"linux": {
48+
"options": {
49+
"shell": {
50+
"executable": "/usr/bin/pwsh",
51+
"args": [
52+
"-NoProfile",
53+
"-Command"
54+
]
55+
}
56+
}
57+
},
58+
"osx": {
59+
"options": {
60+
"shell": {
61+
"executable": "/usr/local/bin/pwsh",
62+
"args": [
63+
"-NoProfile",
64+
"-Command"
65+
]
66+
}
67+
}
68+
},
69+
"tasks": [
70+
{
71+
"label": "Clean",
72+
"type": "shell",
73+
"command": "${cwd}/../build.ps1 -Project 'UniFiTooling' -Task 'Clean'",
74+
"presentation": {
75+
"reveal": "never",
76+
"panel": "shared",
77+
"clear": true,
78+
"focus": false
79+
}
80+
},
81+
{
82+
"label": "Build",
83+
"type": "shell",
84+
"command": "${cwd}/../build.ps1 -Project 'UniFiTooling' -Task 'Build'",
85+
"group": {
86+
"kind": "build",
87+
"isDefault": true
88+
},
89+
"presentation": {
90+
"reveal": "always",
91+
"panel": "never",
92+
"clear": true,
93+
"focus": false
94+
}
95+
},
96+
{
97+
"label": "Test",
98+
"type": "shell",
99+
"command": "${cwd}/../build.ps1 -Project 'UniFiTooling' -Task 'Build 'Test'",
100+
"group": {
101+
"kind": "test",
102+
"isDefault": true
103+
},
104+
"presentation": {
105+
"reveal": "silent",
106+
"panel": "shared",
107+
"clear": true,
108+
"focus": false
109+
},
110+
"problemMatcher": [
111+
"$pester"
112+
]
113+
},
114+
{
115+
"label": "Publish",
116+
"type": "shell",
117+
"command": "${cwd}/../build.ps1 -Project 'UniFiTooling' -Task 'Publish'",
118+
"presentation": {
119+
"reveal": "silent",
120+
"panel": "shared",
121+
"clear": true,
122+
"focus": false
123+
}
124+
},
125+
{
126+
"label": "Release",
127+
"type": "shell",
128+
"command": "${cwd}/../build.ps1 -Project 'UniFiTooling' -Task 'Release'",
129+
"presentation": {
130+
"reveal": "silent",
131+
"panel": "shared",
132+
"clear": true
133+
}
134+
}
135+
]
34136
}

CHANGELOG.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,26 @@ All notable changes to the **UniFiTooling** project will be documented in this f
44

55
---
66

7-
### 1.0.7 - [Unreleased]
7+
### 1.0.8 - 2019-01-19
88

99
Mainly a bugfix and refactoring release
1010

11+
#### Added
12+
13+
- `Get-UniFiIsAlive` - Use a simple API call to see if the session is alive (internal not exported function)
14+
- `ConvertTo-UnixTimeStamp` - ConvertTo-UnixTimeStamp (Helper)
15+
- `ConvertFrom-UnixTimeStamp` - Converts a Timestamp (Epochdate) into Datetime (Helper)
16+
- `Get-HostsFile` - Print the HOSTS File in a more clean format (Helper)
17+
- `Remove-HostsEntry` - Removes a single Hosts Entry from the HOSTS File (Helper)
18+
- `Add-HostsEntry` - Add a single Hosts Entry to the HOSTS File (Helper)
19+
- `Get-UnifiSpeedTestResult` - Get the UniFi Security Gateway (USG) Speed Test results
20+
21+
#### Changed
22+
23+
- `Get-UnifiSpeedTestResult` has now filtering and returns values human readable
24+
- All commands now use `Get-UniFiIsAlive` internally. That should make it easier for new users.
25+
- Refactored some of the code that handles all errors.
26+
1127
### 1.0.7 - 2019-01-14
1228

1329
Mainly a bugfix and refactoring release

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND AN
7171

7272
#### BSD-3-Clause
7373

74-
This is the **BSD-3-Clause** license.
74+
BSD 3-Clause "New" or "Revised" License. - [Online](https://github.com/jhochwald/UniFiTooling/wiki/License)
7575

7676
### Your Name
7777

Install.ps1

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<#
22
.SYNOPSIS
33
Basic Installer for the UniFiTooling PowerShell Module
4-
4+
55
.DESCRIPTION
66
Basic Installer for the enabling Technology UniFiTooling PowerShell Module
77
@@ -15,7 +15,7 @@
1515
1616
Install the module for the All Users with PowerShellGet directly from the Powershell Gallery, Preferred method.
1717
Run this in an administrative PowerShell prompt (Elevated).
18-
18+
1919
.EXAMPLE
2020
PS C:\> .\Install.ps1
2121
@@ -49,28 +49,28 @@ process
4949
# Download and install the module
5050
$webclient = (New-Object System.Net.WebClient)
5151
$file = "$($env:TEMP)\$($ModuleName).zip"
52-
52+
5353
Write-Output -InputObject ('Downloading latest version of {0} from {1}' -f $ModuleName, $DownloadURL)
54-
54+
5555
$webclient.DownloadFile($DownloadURL, $file)
56-
56+
5757
Write-Output -InputObject ('File saved to {0}' -f $file)
58-
58+
5959
$targetondisk = "$($env:USERPROFILE)\Documents\WindowsPowerShell\Modules\$($ModuleName)"
6060
$null = (New-Item -ItemType Directory -Force -Path $targetondisk)
6161
$shell_app = (New-Object -ComObject shell.application)
6262
$zip_file = $shell_app.namespace($file)
63-
63+
6464
Write-Output -InputObject ('Uncompressing the Zip file to {0}' -f $targetondisk)
65-
65+
6666
$destination = $shell_app.namespace($targetondisk)
6767
$destination.Copyhere($zip_file.items(), 0x10)
6868
}
6969
catch
7070
{
7171
# get error record
7272
[Management.Automation.ErrorRecord]$e = $_
73-
73+
7474
# retrieve information about runtime error
7575
$info = [PSCustomObject]@{
7676
Exception = $e.Exception.Message
@@ -80,10 +80,10 @@ process
8080
Line = $e.InvocationInfo.ScriptLineNumber
8181
Column = $e.InvocationInfo.OffsetInLine
8282
}
83-
83+
8484
# output information. Post-process collected info, and log info (optional)
8585
Write-Verbose -Message $info
86-
86+
8787
Write-Error -Message ($info.Exception) -TargetObject ($info.Target) -ErrorAction Stop
8888
break
8989
}
@@ -94,8 +94,3 @@ end
9494
Write-Output -InputObject 'Module has been installed!'
9595
Write-Output -InputObject ('You can now import the module with: Import-Module -Name {0}' -f $ModuleName)
9696
}
97-
98-
99-
100-
101-

PSScriptAnalyzerSettings.psd1

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@
66
77
SAMPLE:
88
Severity = @(
9-
'Error',
9+
'Error',
1010
'Warning'
1111
)
1212
1313
Use IncludeRules when you want to run only a subset of the default rule set.
1414
1515
SAMPLE:
1616
IncludeRules = @(
17-
'PSAvoidDefaultValueSwitchParameter',
18-
'PSMissingModuleManifestField',
19-
'PSReservedCmdletChar',
20-
'PSReservedParams',
21-
'PSShouldProcess',
22-
'PSUseApprovedVerbs',
23-
'PSUseDeclaredVarsMoreThanAssigments',
17+
'PSAvoidDefaultValueSwitchParameter',
18+
'PSMissingModuleManifestField',
19+
'PSReservedCmdletChar',
20+
'PSReservedParams',
21+
'PSShouldProcess',
22+
'PSUseApprovedVerbs',
23+
'PSUseDeclaredVarsMoreThanAssigments',
2424
'PSUseCompatibleCmdlets'
2525
)
2626
@@ -29,7 +29,7 @@
2929
3030
SAMPLE:
3131
ExcludeRules = @(
32-
'PSAvoidTrailingWhitespace',
32+
'PSAvoidTrailingWhitespace',
3333
'PSUseDeclaredVarsMoreThanAssignments'
3434
)
3535
@@ -49,23 +49,23 @@
4949

5050
@{
5151
Severity = @(
52-
'Error',
52+
'Error',
5353
'Warning'
5454
)
5555
ExcludeRules = @(
56-
'PSAvoidUsingUserNameAndPassWordParams',
57-
'PSAvoidUsingPlainTextForPassword',
58-
'PSAvoidTrailingWhitespace',
59-
'PSUseDeclaredVarsMoreThanAssignments',
60-
'PSUseSingularNouns',
56+
'PSAvoidUsingUserNameAndPassWordParams',
57+
'PSAvoidUsingPlainTextForPassword',
58+
'PSAvoidTrailingWhitespace',
59+
'PSUseDeclaredVarsMoreThanAssignments',
60+
'PSUseSingularNouns',
6161
'PSAvoidGlobalVars'
6262
)
6363
Rules = @{
6464
PSUseCompatibleCmdlets = @{
6565
Compatibility = @(
66-
'core-6.0.2-alpha-linux',
67-
'core-6.0.2-alpha-windows',
68-
'core-6.0.2-alpha-osx',
66+
'core-6.0.2-alpha-linux',
67+
'core-6.0.2-alpha-windows',
68+
'core-6.0.2-alpha-osx',
6969
'desktop-5.1.17763.134-windows'
7070
)
7171
}

0 commit comments

Comments
 (0)