Skip to content

Commit

Permalink
Small tweaks
Browse files Browse the repository at this point in the history
Change negation in New-GS files
Fix typo in Help in Import-GSSheet
remove explicit add-type in help tests
  • Loading branch information
FISHMANPET committed Mar 30, 2022
1 parent 2899b66 commit 73877da
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion PSGSuite/Public/Docs/New-GSDocument.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function New-GSDocument {
try {
$body = New-Object 'Google.Apis.Docs.v1.Data.Document'
$body.Title = $Title
if (!$Title) {
if (-not $Title) {
$Title = "Untitled document"
}
Write-Verbose "Creating Document '$Title' for user '$User'"
Expand Down
2 changes: 1 addition & 1 deletion PSGSuite/Public/Sheets/Import-GSSheet.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function Import-GSSheet {
.NOTES
SheetName and Range are how the API determines which sheet (or "tab") to pull data from.
Specifying just a SheetName is the simplest option, most closely replicationg the behavior of Import-CSV, and should work in most cases.
Specifying just a SheetName is the simplest option, most closely replicating the behavior of Import-CSV, and should work in most cases.
If you have some knowledge of how the Sheets API works under the hood, you can additionally use Range to specify which cells on that sheet you return.
For advanced use cases, you can construct a valid Range query yourself and pass that directly, in either A1 notation or R1C1 notation.
Expand Down
2 changes: 1 addition & 1 deletion PSGSuite/Public/Sheets/New-GSSheet.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function New-GSSheet {
$body.Properties = New-Object 'Google.Apis.Sheets.v4.Data.SpreadsheetProperties' -Property @{
Title = $Title
}
if (!$Title) {
if (-not $Title) {
$Title = "Untitled spreadsheet"
}
Write-Verbose "Creating Spreadsheet '$Title' for user '$User'"
Expand Down
2 changes: 1 addition & 1 deletion PSGSuite/Public/Slides/New-GSPresentation.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function New-GSPresentation {
try {
$body = New-Object 'Google.Apis.Slides.v1.Data.Presentation'
$body.Title = $Title
if (!$Title) {
if (-not $Title) {
$Title = "Untitled presentation"
}
Write-Verbose "Creating Presentation '$Title' for user '$User'"
Expand Down
18 changes: 9 additions & 9 deletions Tests/1. Module Tests/PSGSuite.Help.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ Describe "Public Function Help tests" {
# Adapted from Francois' post here: https://lazywinadmin.com/2016/05/using-pester-to-test-your-comment-based.html
Import-Module "$TargetModulePath\$($ModuleName).psd1" -Force -ErrorAction SilentlyContinue
# Make sure the assemblies are present in the current scope otherwise function help will fail
$dllFolder = if ($PSVersionTable.PSVersion.Major -le 5) {
[System.IO.Path]::Combine($TargetModulePath,'lib','net45')
}
else {
[System.IO.Path]::Combine($TargetModulePath,'lib','netstandard1.3')
}
Get-ChildItem $dllFolder -Filter '*.dll' -Recurse | ForEach-Object {
Add-Type -Path $_.FullName -IgnoreWarnings
}
# $dllFolder = if ($PSVersionTable.PSVersion.Major -le 5) {
# [System.IO.Path]::Combine($TargetModulePath,'lib','net45')
# }
# else {
# [System.IO.Path]::Combine($TargetModulePath,'lib','netstandard1.3')
# }
# Get-ChildItem $dllFolder -Filter '*.dll' -Recurse | ForEach-Object {
# Add-Type -Path $_.FullName -IgnoreWarnings
# }
$FunctionsList = (Get-Module $ModuleName).ExportedFunctions.Keys
foreach ($Function in $FunctionsList) {
$Help = Get-Help -Name $Function -Full
Expand Down

0 comments on commit 73877da

Please sign in to comment.