Skip to content

Add rule to check cmdlet compatibility #617

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 38 commits into from
Sep 26, 2016

Conversation

kapilmb
Copy link

@kapilmb kapilmb commented Sep 22, 2016

Resolves #605


This change is Reviewable

Kapil Borle added 29 commits September 21, 2016 17:41
@kapilmb kapilmb force-pushed the kapilmb/UseCompatibleCmdlets branch from 1418841 to 36fe25a Compare September 23, 2016 21:10
throw new ArgumentNullException("ast");
}

scriptPath = fileName;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fileName [](start = 25, length = 8)

Any possibility of this being null or whitespace? or not existing file?


Function IsPSEditionDesktop
{
$PSEdition -eq $null -or $PSEdition -eq 'Desktop'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$PSEdition -eq $null -or $PSEdition -eq 'Desktop' [](start = 4, length = 49)

use below here
(Get-PSVariable -Name PSEdition -ErrorAction Ignore) -or ($PSEdition -eq 'Desktop')

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it Get-Variable or Get-PSVariable?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it should be Get-Variable only. Thanks!

{
$null
}
$root
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use below

if ((Test-Path (Join-Path $root $solutionFilename)))
{
    $root
}

{
$null
}
Join-Path $slnRoot "Rules"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use below

if ($slnRoot)
{
    Join-Path $slnRoot "Rules"
}

{
$null
}
Join-Path $prjRoot "ScriptAnalyzerBuiltinRules.csproj"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use the above suggestion here too.

@bmanikm
Copy link

bmanikm commented Sep 24, 2016

:shipit:

@kapilmb
Copy link
Author

kapilmb commented Sep 26, 2016

@bmanikm Thanks!

@kapilmb kapilmb force-pushed the kapilmb/UseCompatibleCmdlets branch from ad039ae to 7406fc0 Compare September 26, 2016 22:27
@kapilmb kapilmb force-pushed the kapilmb/UseCompatibleCmdlets branch from 7406fc0 to 8adbda8 Compare September 26, 2016 22:43
@kapilmb kapilmb merged commit 48a6cd2 into development Sep 26, 2016
@kapilmb kapilmb deleted the kapilmb/UseCompatibleCmdlets branch October 4, 2016 20:55
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants