Skip to content

Commit f521858

Browse files
authored
Merge pull request #1 from snazy2000/develop
Merge Changes in to Master
2 parents 13ec3a6 + ebb99a2 commit f521858

Some content is hidden

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

43 files changed

+1200
-830
lines changed

.vscode/launch.json

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
{
22
"version": "0.2.0",
3-
"configurations": [
4-
{
5-
"type": "PowerShell",
6-
"request": "launch",
7-
"name": "PowerShell Interactive Session",
8-
"cwd": "${workspaceRoot}"
9-
},
10-
{
3+
"configurations": [{
114
"type": "PowerShell",
125
"request": "launch",
136
"name": "PowerShell Pester Tests",
@@ -22,6 +15,19 @@
2215
"script": "${file}",
2316
"args": [],
2417
"cwd": "${file}"
18+
},
19+
{
20+
"type": "PowerShell",
21+
"request": "attach",
22+
"name": "PowerShell Attach to Host Process",
23+
"processId": "${command.PickPSHostProcess}",
24+
"runspaceId": 1
25+
},
26+
{
27+
"type": "PowerShell",
28+
"request": "launch",
29+
"name": "PowerShell Interactive Session",
30+
"cwd": "${workspaceRoot}"
2531
}
2632
]
27-
}
33+
}

.vscode/settings.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Place your settings in this file to overwrite default and user settings.
2+
{
3+
"files.encoding": "utf8",
4+
"files.eol": "\r\n",
5+
"files.trimTrailingWhitespace": true,
6+
"files.insertFinalNewline": true,
7+
"editor.tabSize": 4,
8+
"[markdown]": {
9+
"editor.wordwrap": "on",
10+
"editor.renderWhitespace": "all",
11+
"editor.acceptSuggestionOnEnter": false,
12+
"editor.rulers": [80],
13+
"editor.trimAutoWhitespace": false
14+
}
15+
}

.vscode/tasks.json

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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
9+
{
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": "${env:windir}\\sysnative\\windowspowershell\\v1.0\\PowerShell.exe",
16+
"args": [
17+
"-NoProfile",
18+
"-ExecutionPolicy",
19+
"Bypass"
20+
]
21+
},
22+
"linux": {
23+
"command": "/usr/bin/powershell",
24+
"args": [
25+
"-NoProfile"
26+
]
27+
},
28+
"osx": {
29+
"command": "/usr/local/bin/powershell",
30+
"args": [
31+
"-NoProfile"
32+
]
33+
},
34+
// Show the output window always
35+
"showOutput": "always",
36+
// Associate with test task runner
37+
"tasks": [{
38+
"taskName": "Build Help",
39+
"suppressTaskName": true,
40+
"args": [
41+
"Write-Host 'Invoking platyPS'; New-ExternalHelp -Path .\\docs\\en-US -OutputPath .\\ConfluencePS\\en-US -Force;",
42+
"Invoke-Command { Write-Host 'Completed Build task in task runner.' }"
43+
]
44+
},
45+
{
46+
"taskName": "Test",
47+
"suppressTaskName": true,
48+
"isTestCommand": true,
49+
"args": [
50+
"Write-Host 'Invoking Pester'; Invoke-Pester -PesterOption @{IncludeVSCodeMarker=$true};",
51+
"Invoke-Command { Write-Host 'Completed Test task in task runner.' }"
52+
],
53+
"problemMatcher": "$pester"
54+
}
55+
]
56+
}

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
[1.0]
1+
# Change Log
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](http://keepachangelog.com/),
6+
and this project adheres to [Semantic Versioning](http://semver.org/).
7+
8+
## [1.0] - 2017-11-18

README.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,30 @@
1-
[![Build status](https://ci.appveyor.com/api/projects/status/dvuw4ggx543nx3h7?svg=true)](https://ci.appveyor.com/project/snazy2000/snipeitps)
1+
[![GitHub release](https://img.shields.io/github/release/snazy2000/SnipeitPS.svg)](https://github.com/snazy2000/snipeitps/releases/latest) [![Build status](https://ci.appveyor.com/api/projects/status/dvuw4ggx543nx3h7/branch/master?svg=true)](https://ci.appveyor.com/project/snazy2000/snipeitps/branch/master) [![PowerShell Gallery](https://img.shields.io/powershellgallery/dt/snipeitps.svg)](https://www.powershellgallery.com/packages/snipeitps) ![License](https://img.shields.io/badge/license-MIT-blue.svg)
2+
3+
---
4+
5+
## Instructions
6+
7+
### Installation
8+
9+
Install SnipeitPS from the PowerShell Gallery `Install-Module` requires PowerShellGet (included in PS v5, or download for v3/v4 via the gallery link)
10+
11+
```powershell
12+
# One time only install: (requires an admin PowerShell window)
13+
Install-Module SnipeitPS
14+
15+
# Check for updates occasionally:
16+
Update-Module SnipeitPS
17+
18+
# To use each session:
19+
Import-Module SnipeitPS
20+
Set-Info -URL 'https://asset.example.com' -apiKey 'tokenKey'
21+
```
22+
23+
### Usage
24+
25+
```powershell
26+
# Review the help at any time!
27+
Get-Help about_SnipeitPS
28+
Get-Command -Module SnipeitPS
29+
Get-Help Get-Asset -Full # or any other command
30+
```

SnipeItPS.build.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ task PushRelease GitStatus, GetVersion, {
217217
}
218218
# endregion
219219

220+
220221
#region Cleaning tasks
221222
task Clean RemoveGeneratedFiles
222223

@@ -236,4 +237,4 @@ task RemoveMarkdownFiles {
236237
}
237238
# endregion
238239

239-
task . ShowDebug, Clean, Test, Build, Deploy
240+
task . ShowDebug, Clean, Test, Build, Deploy

SnipeitPS/Private/Invoke-Method.psm1 renamed to SnipeitPS/Private/Invoke-SnipeitMethod.ps1

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function Invoke-Method {
1+
function Invoke-SnipeitMethod {
22
<#
33
.SYNOPSIS
44
Extracted invokation of the REST method to own function.
@@ -42,7 +42,7 @@
4242
}
4343

4444
Process {
45-
if ($GetParameters -and ($URi -notlike "*\?*"))
45+
if ($GetParameters -and ($URi -notlike "*\?*"))
4646
{
4747
Write-Debug "Using `$GetParameters: $($GetParameters | Out-String)"
4848
[string]$URI += (ConvertTo-GetParameter $GetParameters)
@@ -86,7 +86,7 @@
8686

8787
# API returned a Content: lets work wit it
8888
$response = ConvertFrom-Json -InputObject $webResponse.Content
89-
89+
9090
if ($response.status -eq "error") {
9191
Write-Verbose "[$($MyInvocation.MyCommand.Name)] An error response was received from; resolving"
9292
# This could be handled nicely in an function such as:
@@ -95,14 +95,14 @@
9595
}
9696
else {
9797
$result = $response
98-
if (($response) -and ($response | Get-Member -Name payload))
98+
if (($response) -and ($response | Get-Member -Name payload))
9999
{
100100
$result = $response.payload
101101
}
102102
elseif (($response) -and ($response | Get-Member -Name rows)) {
103103
$result = $response.rows
104104
}
105-
105+
106106
$result
107107
}
108108
}
@@ -111,7 +111,7 @@
111111
# This could be wanted behavior of the API
112112
Write-Verbose "[$($MyInvocation.MyCommand.Name)] No content was returned from."
113113
}
114-
114+
115115
}
116116
else {
117117
Write-Verbose "[$($MyInvocation.MyCommand.Name)] No Web result object was returned from. This is unusual!"
@@ -121,4 +121,4 @@
121121
END {
122122
Write-Verbose "[$($MyInvocation.MyCommand.Name)] Function ended"
123123
}
124-
}
124+
}

0 commit comments

Comments
 (0)