Skip to content

Commit 3574a37

Browse files
committed
Fix the warnings of the static analyzer
1 parent eb15227 commit 3574a37

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Main.psm1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using namespace System.Diagnostics.CodeAnalysis
12
using module ./Platform.psm1
23
using module ./Release.psm1
34
using module ./Setup.psm1
@@ -95,6 +96,7 @@ function Install-Release {
9596
#>
9697
function New-Release {
9798
[OutputType([Release])]
99+
[SuppressMessage("PSUseShouldProcessForStateChangingFunctions", "")]
98100
param (
99101
[Parameter(Mandatory, Position = 0, ValueFromPipeline)]
100102
[ValidateNotNullOrWhiteSpace()]
@@ -122,6 +124,7 @@ function New-Release {
122124
#>
123125
function New-ReleaseAsset {
124126
[OutputType([ReleaseAsset])]
127+
[SuppressMessage("PSUseShouldProcessForStateChangingFunctions", "")]
125128
param (
126129
[Parameter(Mandatory, Position = 0)]
127130
[ValidateNotNull()]

src/Platform.psm1

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using namespace System.Diagnostics.CodeAnalysis
2-
31
<#
42
.SYNOPSIS
53
Identifies an operating system or platform.
@@ -18,10 +16,9 @@ enum Platform {
1816
#>
1917
function Get-Platform {
2018
[OutputType([Platform])]
21-
[SuppressMessage("PSUseDeclaredVarsMoreThanAssignments", "")]
2219
param ()
2320

24-
return $discard = switch ($true) {
21+
switch ($true) {
2522
{ $IsLinux } { [Platform]::Linux; break }
2623
{ $IsMacOS } { [Platform]::MacOS; break }
2724
default { [Platform]::Windows }

0 commit comments

Comments
 (0)