Skip to content

Commit c0d6cdf

Browse files
authored
Merge pull request #80 from jwittner/fix/lintFailure
Change helper to better name
2 parents 6ead389 + bcf0a9b commit c0d6cdf

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

UnitySetup/DSCResources/xUnitySetup/xUnitySetup.psm1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ function Set-TargetResource {
7979
foreach ($version in $splitVersions) {
8080
$findArgs = @{
8181
'Version' = $version
82-
'Components' = New-UnitySetupComponent -Components $Components
82+
'Components' = ConvertTo-UnitySetupComponent $Components
8383
}
8484

8585
$installArgs = @{ 'Cache' = "$env:TEMP\.unitysetup" }
@@ -156,7 +156,7 @@ function Test-TargetResource {
156156
$result = $true
157157
switch ( $Ensure ) {
158158
'Present' {
159-
$setupComponents = New-UnitySetupComponent -Components $Components
159+
$setupComponents = ConvertTo-UnitySetupComponent $Components
160160
foreach ($version in $splitVersions) {
161161
Write-Verbose "Starting test for $version"
162162
$setupInstances = Get-UnitySetupInstance | Select-UnitySetupInstance -Version $version
@@ -170,7 +170,7 @@ function Test-TargetResource {
170170

171171
$availableComponents = ($setupInstances[0].Components -band $setupComponents)
172172
if ($availableComponents -ne $setupComponents) {
173-
$missingComponents = New-UnitySetupComponent ($setupComponents -bxor $availableComponents)
173+
$missingComponents = ConvertTo-UnitySetupComponent ($setupComponents -bxor $availableComponents)
174174
Write-Verbose "Found $version missing $($missingComponents)"
175175
$result = $false
176176
break

UnitySetup/UnitySetup.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
'Select-UnitySetupInstance',
8383
'Uninstall-UnitySetupInstance',
8484
'Start-UnityEditor',
85-
'New-UnitySetupComponent'
85+
'ConvertTo-UnitySetupComponent'
8686
)
8787

8888
# 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.

UnitySetup/UnitySetup.psm1

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,17 +158,16 @@ class UnityVersion : System.IComparable {
158158
.PARAMETER Components
159159
What components would you like included?
160160
.EXAMPLE
161-
New-UnitySetupComponent -Components Setup,Metro
161+
ConvertTo-UnitySetupComponent Setup,Metro
162162
#>
163-
function New-UnitySetupComponent {
163+
function ConvertTo-UnitySetupComponent {
164164
[CmdletBinding()]
165-
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '', Scope = 'Function')]
166165
param(
167-
[parameter(Mandatory = $true)]
168-
[UnitySetupComponent] $Components
166+
[parameter(Mandatory = $true, Position = 0)]
167+
[UnitySetupComponent] $Component
169168
)
170169

171-
$Components
170+
$Component
172171
}
173172

174173
<#

0 commit comments

Comments
 (0)