Skip to content

Commit

Permalink
Merge pull request #8 from Akaizoku/develop
Browse files Browse the repository at this point in the history
1.2.5 release
  • Loading branch information
Akaizoku authored Nov 21, 2021
2 parents d4c57eb + 8c31172 commit 0e6b224
Show file tree
Hide file tree
Showing 12 changed files with 225 additions and 110 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/main.yml → .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Publish module to PowerShell Gallery
name: CI
name: Release

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
tags: "*"
# Triggers the workflow on release
release:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -20,10 +19,11 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Check-out
uses: actions/checkout@v2
with:
# Create subdirectory for publish-powershell-module-action
path: 'module'
# Create module sub-directory for publish-powershell-module-action
path: ${{ github.event.repository.name }}

# Publish module
- name: Publish PowerShell Module
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
#
# https://github.com/microsoft/action-psscriptanalyzer
# For more information on PSScriptAnalyzer in general, see
# https://github.com/PowerShell/PSScriptAnalyzer

name: PSScriptAnalyzer

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:
name: PSScriptAnalyzer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Run PSScriptAnalyzer
uses: microsoft/psscriptanalyzer-action@2044ae068e37d0161fa2127de04c19633882f061
with:
# Check https://github.com/microsoft/action-psscriptanalyzer for more info about the options.
# The below set up runs PSScriptAnalyzer to your entire repository and runs some basic security rules.
path: .\
recurse: true
# Include your own basic security rules. Removing this option will run all the rules
includeRule: '"PSAvoidGlobalAliases", "PSAvoidUsingConvertToSecureStringWithPlainText"'
output: results.sarif

# Upload the SARIF file generated in the previous step
- name: Upload SARIF results file
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: results.sarif
28 changes: 21 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,21 @@ All notable changes to the [PSTK](https://github.com/Akaizoku/PSTK) project will
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.2.4](https://github.com/Akaizoku/PSTK/releases/tag/1.2.4) - 2021-09-21
## [1.2.5](https://github.com/Akaizoku/PSTK/releases/1.2.5) - 2021-11-21

Maintenance automation and incremental update

### Added

- Package release automation
- Easily stop all transcripts for current session with `Stop-AllTranscript`

### Changed

- Use `-UseBasicParsing` in `Get-HTTPStatus` calls to avoid issues when IE is not configured
- Update `Remove-Object` to use `ErrorVariable`

## [1.2.4](https://github.com/Akaizoku/PSTK/releases/1.2.4) - 2021-09-21

Standardisation effort

Expand All @@ -32,7 +46,7 @@ The following functions have been updated:
- Remove-Object
- Write-Log

## [1.2.3](https://github.com/Akaizoku/PSTK/releases/tag/1.2.3) - 2020-03-26
## [1.2.3](https://github.com/Akaizoku/PSTK/releases/1.2.3) - 2020-03-26

Oracle update

Expand All @@ -54,7 +68,7 @@ The following functions have been updated:
- Write-Checksum: Added an exclusion parameter
- Write-InsertOrUpdate: Added Oracle syntax

## [1.2.2](https://github.com/Akaizoku/PSTK/releases/tag/1.2.2) - 2020-01-13
## [1.2.2](https://github.com/Akaizoku/PSTK/releases/1.2.2) - 2020-01-13

Utility update

Expand Down Expand Up @@ -82,7 +96,7 @@ The following functions have been updated:
- Write-Log: Renamed error code parameter to exit code (aliases have been set for retro-compatibility)
- Write-ErrorLog: Renamed error code parameter to exit code (aliases have been set for retro-compatibility)

## [1.2.1](https://github.com/Akaizoku/PSTK/releases/tag/1.2.1) - 2019-10-01
## [1.2.1](https://github.com/Akaizoku/PSTK/releases/1.2.1) - 2019-10-01

Hotfix to enable overwriting empty properties.

Expand All @@ -97,7 +111,7 @@ The following functions have been updated:
- Get-Properties
- Import-Properties

## [1.2.0](https://github.com/Akaizoku/PSTK/releases/tag/1.2.0) - 2019-09-12
## [1.2.0](https://github.com/Akaizoku/PSTK/releases/1.2.0) - 2019-09-12

Expansion

Expand Down Expand Up @@ -144,7 +158,7 @@ The following functions have been updated:
- Test-SQLConnection
- Write-Log

## [1.1.0](https://github.com/Akaizoku/PSTK/releases/tag/1.1.0) - 2018-10-15
## [1.1.0](https://github.com/Akaizoku/PSTK/releases/1.1.0) - 2018-10-15

Restructuring

Expand All @@ -169,7 +183,7 @@ The following functions have been marked as internal and are no longer public:
- Show-ExceptionFullName
- Test-Alphanumeric

## [1.0.0](https://github.com/Akaizoku/PSTK/releases/tag/1.0.0) - 2018-10-05
## [1.0.0](https://github.com/Akaizoku/PSTK/releases/1.0.0) - 2018-10-05

First stable release

Expand Down
35 changes: 20 additions & 15 deletions PSTK.psd1
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#
# Module manifest for module 'PSGet_PSTK'
# Module manifest for module 'PSTK'
#
# Generated by: Florian Carrier
#
# Generated on: 02/09/2021
# Generated on: 21/11/2021
#

@{
Expand All @@ -12,7 +12,7 @@
RootModule = 'PSTK.psm1'

# Version number of this module.
ModuleVersion = '1.2.4'
ModuleVersion = '1.2.5'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand All @@ -24,7 +24,7 @@ GUID = '065d3e48-45c0-4b6b-9052-b92fe22b4e51'
Author = 'Florian Carrier'

# Company or vendor of this module
CompanyName = 'Unknown'
CompanyName = ''

# Copyright statement for this module
Copyright = '(c) 2019-2021 Florian Carrier. All rights reserved.'
Expand Down Expand Up @@ -83,11 +83,11 @@ FunctionsToExport = 'Compare-Hashtable', 'Compare-Properties', 'Compare-Version'
'Remove-Object', 'Rename-NumberedFile', 'Resolve-Array',
'Resolve-Boolean', 'Resolve-Tags', 'Resolve-URI', 'Select-XMLNode',
'Set-EnvironmentVariable', 'Set-RelativePath', 'Set-Tags',
'Start-Script', 'Stop-Script', 'Sync-EnvironmentVariable',
'Test-EnvironmentVariable', 'Test-HTTPStatus', 'Test-Object',
'Test-OracleConnection', 'Test-Service', 'Test-SQLConnection',
'Update-File', 'Wait-WebResource', 'Write-Checksum', 'Write-ErrorLog',
'Write-InsertOrUpdate', 'Write-Log'
'Start-Script', 'Stop-AllTranscripts', 'Stop-Script',
'Sync-EnvironmentVariable', 'Test-EnvironmentVariable',
'Test-HTTPStatus', 'Test-Object', 'Test-OracleConnection',
'Test-Service', 'Test-SQLConnection', 'Update-File', 'Wait-WebResource',
'Write-Checksum', 'Write-ErrorLog', 'Write-InsertOrUpdate', 'Write-Log'

# 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.
CmdletsToExport = @()
Expand Down Expand Up @@ -116,7 +116,7 @@ PrivateData = @{
Tags = 'PowerShell','PS','PoSh','Tool','ToolKit','Utility'

# A URL to the license for this module.
LicenseUri = 'https://github.com/Akaizoku/PSTK/blob/master/LICENSE'
LicenseUri = 'https://github.com/Akaizoku/PSTK/blob/main/LICENSE'

# A URL to the main website for this project.
ProjectUri = 'https://github.com/Akaizoku/PSTK'
Expand All @@ -125,18 +125,23 @@ PrivateData = @{
# IconUri = ''

# ReleaseNotes of this module
ReleaseNotes = '[1.2.4]
- Fix shallow copy function for ordered hashtables'
ReleaseNotes = 'https://github.com/Akaizoku/PSAYX/blob/main/CHANGELOG.md'

# Prerelease string of this module
# Prerelease = ''

# Flag to indicate whether the module requires explicit user acceptance for install/update/save
# RequireLicenseAcceptance = $false

# External dependent modules of this module
# ExternalModuleDependencies = ''
# ExternalModuleDependencies = @()

} # End of PSData hashtable

} # End of PrivateData hashtable

# HelpInfo URI of this module
HelpInfoURI = 'https://github.com/Akaizoku/PSTK/blob/master/README.md'
HelpInfoURI = 'https://github.com/Akaizoku/PSTK/blob/main/README.md'

# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
# DefaultCommandPrefix = ''
Expand Down
13 changes: 8 additions & 5 deletions Public/Get-HTTPStatus.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ function Get-HTTPStatus {
.NOTES
File name: Get-HTTPStatus.ps1
Author: Florian Carrier
Creation date: 15/01/2019
Last modified: 17/01/2019
Creation date: 2019-01-15
Last modified: 2021-11-14
#>
Param(
[Parameter(
Expand All @@ -32,10 +32,13 @@ function Get-HTTPStatus {
Process {
try {
# Query server
Write-Debug -Message $URI
$Status = Invoke-WebRequest -URI $URI | Select-Object -ExpandProperty "StatusCode"
Write-Log -Type "DEBUG" -Object $URI
$Status = Invoke-WebRequest -URI $URI -UseBasicParsing | Select-Object -ExpandProperty "StatusCode"
} catch {
# If server is offline
# If server is offline or an error occurs
if ($null -ne $Error[0].Exception.Message) {
Write-Log -Type "DEBUG" -Object $Error[0].Exception.Message
}
$Status = 0
}
return $Status
Expand Down
4 changes: 2 additions & 2 deletions Public/Get-URI.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ function Get-URI {
.NOTES
File name: Get-URI.ps1
Author: Florian Carrier
Creation date: 21/10/2019
Last modified: 21/10/2019
Creation date: 2019-10-21
Last modified: 2019-10-21
#>
Param(
[Parameter (
Expand Down
8 changes: 3 additions & 5 deletions Public/Remove-Object.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@ function Remove-Object {
.PARAMETER Exclude
The exclude parameter corresponds to the filter to apply to the name of objects *not* to remove.
/!\ Exclude is currently not supported in Windows PowerShell
See https://github.com/PowerShell/PowerShell/issues/6865
.NOTES
File name: Remove-Object.ps1
Author: Florian Carrier
Creation date: 2019-06-14
Last modified: 2021-07-08
Last modified: 2021-09-10
#>
[CmdletBinding ()]
Param (
Expand Down Expand Up @@ -94,9 +92,9 @@ function Remove-Object {
Write-Log -Type "DEBUG" -Object $Object.FullName
}
try {
Remove-Item -Path $Object.FullName -Recurse -Force
Remove-Item -Path $Object.FullName -Recurse -Force -ErrorVariable "ErrorMessage" -ErrorAction "Stop"
} catch {
Write-Log -Type "ERROR" -Message $Error[0].Exception.Message
Write-Log -Type "ERROR" -Message $ErrorMessage
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Public/Resolve-URI.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function Resolve-URI {
The URI parameter corresponds to the uniform resource identifier to resolve.
.INPUTS
System.String. You can pipe the uniform resource identifier to Resolve-URI.DESCRIPTION
System.String. You can pipe the uniform resource identifier to Resolve-URI.
.OUTPUTS
System.String. Resolve-URI returns the encoded uniform resource identifier.
Expand Down
9 changes: 6 additions & 3 deletions Public/Start-Script.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# ------------------------------------------------------------------------------
# Advanced start function
# ------------------------------------------------------------------------------
function Start-Script {
<#
.SYNOPSIS
Expand All @@ -18,6 +15,12 @@ function Start-Script {
In this example, Start-Script will set stric mode on, and record all the
output in a file colled "transcript.log" under the ".\log" directory.
.NOTES
File name: Start-Script.ps1
Author: Florian Carrier
Creation date: 2018-10-15
Last modified: 2018-10-15
#>
[CmdletBinding ()]
Param (
Expand Down
50 changes: 50 additions & 0 deletions Public/Stop-AllTranscripts.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
function Stop-AllTranscripts {
<#
.SYNOPSIS
Stop all transcripts
.DESCRIPTION
Stop all active PowerShell transcripts
.NOTES
File name: Stop-AllTranscripts.ps1
Author: Florian Carrier
Creation date: 2021-10-28
Last modified: 2021-10-28
#>
[CmdLetBinding ()]
Param (
[Parameter (
HelpMessage = "Suppress summary output"
)]
[Switch]
$Silent
)
Begin {
# Get global preference vrariables
Get-CallerPreference -Cmdlet $PSCmdlet -SessionState $ExecutionContext.SessionState
}
Process {
# Variables
$ActiveTranscript = $true
$Count = 0
# Stop transcripts
while ($ActiveTranscript) {
try {
Stop-Transcript
$Count += 1
} catch {
$ActiveTranscript = $false
}
}
# Generate log
if ($Silent -eq $false) {
switch ($Count) {
0 { return "The host is not currently transcribing." }
1 { $Log = "One single transcript was stopped." }
default { $Log = "$Count transcripts were stopped." }
}
Write-Log -Type "DEBUG" -Message $Log
}
}
}
4 changes: 2 additions & 2 deletions Public/Test-HTTPStatus.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ function Test-HTTPStatus {
.NOTES
File name: Test-HTTPStatus.ps1
Author: Florian Carrier
Creation date: 18/10/2019
Last modified: 18/10/2019
Creation date: 2019-10-18
Last modified: 2019-10-18
#>
[CmdletBinding()]
Param(
Expand Down
Loading

0 comments on commit 0e6b224

Please sign in to comment.