GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Remove use of cmdlet aliases from .\test\powershell by xtqqczze · Pull Request #8546 · PowerShell/PowerShell

Conversation

@xtqqczze

@xtqqczze xtqqczze commented Dec 27, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

PR Summary

  • Remove use of cmdlet aliases from .\test\powershell directory.

PR Checklist

  • PR has a meaningful title
    • Use the present tense and imperative mood when describing your changes
  • Summarized changes
  • Change is not breaking
  • Make sure all .h, .cpp, .cs, .ps1 and .psm1 files have the correct copyright header
  • This PR is ready to merge and is not Work in Progress.
    • If the PR is work in progress, please add the prefix WIP: to the beginning of the title and remove the prefix when the PR is ready.
  • User-facing changes
    • Not Applicable
    • OR
    • User-facing Documentation needed
      • Issue filed - Issue link:
  • Testing - New and feature
    • Not Applicable or can only be tested interactively
    • OR
    • Make sure you've added a new test if existing tests do not effectively test the code changed
      • Add [feature] if the change is significant or affects feature tests

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@xtqqczze
Remove use of cmdlet aliases from .\test\powershell
20cdf64
Remove use of cmdlet aliases from .\test\powershell\* and suppress warnings from PSScriptAnalyzer if use of a cmdlet alias is necessary for tests.
@xtqqczze
xtqqczze requested review from Paul Higinbotham (PaulHigin), Travis Plunk (TravisEz13), Aditya Patwardhan (adityapatwardhan), Andrew (anmenaga) and Dongbo Wang (daxian-dbw) as code owners December 27, 2018 01:00
xtqqczze added 2 commits December 27, 2018 01:25
@xtqqczze
Fixes for failing tests
e9688c7
@xtqqczze
Fixes
808f216
Fix for failing test and remove accidentally committed files under .\test\tools\Modules\SelfSignedCertificate
@iSazonov

Ilya (iSazonov) commented Dec 27, 2018

Copy link
Copy Markdown
Collaborator

xtqqczze Thanks for your contribution!

We never used message suppressions and I would delete its. In the case we could fast merge. If you think that this could be useful please open new issue for discussion.

xtqqczze reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

xtqqczze added 2 commits December 27, 2018 16:24
@xtqqczze
Remove PSAvoidUsingCmdletAliases message suppression
fc73b5d
Remove PSAvoidUsingCmdletAliases message suppression.
@xtqqczze
Improve comments
17e3e35
@iSazonov

Ilya (iSazonov) commented Dec 28, 2018

Copy link
Copy Markdown
Collaborator

xtqqczze Sorry, I meant that comments is not needed too. We don't have strong CI checks for scripts. So such suppressions and related comments makes no sense.

xtqqczze reacted with confused emoji
All reactions
  • 😕 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@xtqqczze
Improve comments again
6055d60
@xtqqczze

xtqqczze commented Dec 28, 2018

Copy link
Copy Markdown
Contributor Author

Ilya (@iSazonov) When using vscode with the ms-vscode.powershell extension enabled, rule violations from PSScriptAnalyzer testing are listed as warnings in the 'Problems' pane, for example:

{
	"resource": "~/test/powershell/Modules/Microsoft.PowerShell.Utility/Set-Variable.Tests.ps1",
	"owner": "_generated_diagnostic_collection_name_#2",
	"code": "PSAvoidUsingCmdletAliases",
	"severity": 4,
	"message": "'sv' is an alias of 'Set-Variable'. Alias can introduce possible problems and make scripts hard to maintain. Please consider changing alias to its full content.",
	"source": "PSScriptAnalyzer",
	"startLineNumber": 178,
	"startColumn": 2,
	"endLineNumber": 178,
	"endColumn": 4
}

Certain tests have comments explaining a rule should be ignored, because at the present time rules can only be suppressed on a file level for Pester tests. These comments help identify spurious warnings in the vscode 'Problems' pane and provide a placeholder for future implementation of rule suppression at a test level.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@iSazonov

Ilya (iSazonov) commented Dec 28, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

xtqqczze I see your point. These comments is obvious and don't add value but reduce readability. Your proposal will be useful after we (1) get implementation of local suppressions and (2) force CIs. Today I suggest split replacing aliases and suppressing messages. For second work you could open a tracking issue if you want.

xtqqczze reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@xtqqczze
Remove comments
c400778
iSazonov
Ilya (iSazonov) approved these changes Dec 28, 2018
View reviewed changes
@iSazonov
Ilya (iSazonov) requested a review from Steve Lee (SteveL-MSFT) December 28, 2018 06:02
SteveL-MSFT
Steve Lee (SteveL-MSFT) approved these changes Dec 28, 2018
View reviewed changes
@SteveL-MSFT Steve Lee (SteveL-MSFT) assigned Ilya (iSazonov) Dec 28, 2018
@iSazonov
Ilya (iSazonov) merged commit 70de294 into PowerShell:master Dec 28, 2018
@iSazonov

Ilya (iSazonov) commented Dec 28, 2018

Copy link
Copy Markdown
Collaborator

xtqqczze Thanks for your contribution!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@iSazonov Ilya (iSazonov) mentioned this pull request Dec 29, 2018
Fix typo in AMSI test #8561
Merged
8 of 11 tasks
@xtqqczze
xtqqczze deleted the PSAvoidUsingCmdletAliases branch January 2, 2019 01:45
xtqqczze added a commit to xtqqczze/PowerShell-PowerShell that referenced this pull request Jan 2, 2019
@xtqqczze
[feature] Avoid use of mkdir alias in *.ps1 and *.ps1m
4821ba0
Follow-up to PowerShell#8546
@xtqqczze xtqqczze mentioned this pull request Jan 2, 2019
Avoid use of mkdir alias in *.ps1 and *.psm1 #8582
Merged
8 tasks done
@xtqqczze xtqqczze mentioned this pull request Jan 12, 2019
Revise use of Start-Sleep cmdlet #8633
Merged
8 of 11 tasks
xtqqczze added a commit to xtqqczze/PowerShell-PowerShell that referenced this pull request Jan 14, 2019
@xtqqczze
[Feature] Revise use of Start-Sleep cmdlet
636c2e8
* Avoid use of sleep alias (follow-up to PowerShell#8546)
* Specify default parameter name
* Shorten overly specific comments
Ilya (iSazonov) pushed a commit that referenced this pull request Jan 15, 2019
@xtqqczze @iSazonov
Revise use of Start-Sleep cmdlet (#8633)
6126624
* Avoid use of sleep alias (follow-up to #8546)
* Specify default parameter name
* Shorten overly specific comments
@iSazonov Ilya (iSazonov) added the CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log label Jan 17, 2019
@KingAl KingAl mentioned this pull request May 11, 2022
Tests checking for Alias presence/behaviour no longer check appropriately #17310
Closed
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
@xtqqczze @iSazonov
Remove use of cmdlet aliases from .\test\powershell (PowerShell#8546)
a8d7d95
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
@xtqqczze @iSazonov
Revise use of Start-Sleep cmdlet (PowerShell#8633)
b7f086f
* Avoid use of sleep alias (follow-up to PowerShell#8546)
* Specify default parameter name
* Shorten overly specific comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@SteveL-MSFT Steve Lee (SteveL-MSFT) SteveL-MSFT approved these changes
@iSazonov Ilya (iSazonov) iSazonov approved these changes
@adityapatwardhan Aditya Patwardhan (adityapatwardhan) Awaiting requested review from adityapatwardhan
@anmenaga Andrew (anmenaga) Awaiting requested review from anmenaga
@daxian-dbw Dongbo Wang (daxian-dbw) Awaiting requested review from daxian-dbw
@PaulHigin Paul Higinbotham (PaulHigin) Awaiting requested review from PaulHigin
@TravisEz13 Travis Plunk (TravisEz13) Awaiting requested review from TravisEz13

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@iSazonov Ilya (iSazonov)

Labels

CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@xtqqczze @iSazonov @SteveL-MSFT
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.