Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Script analyzer warns about unused variables when variable is used in Invoke-Command #825

Open
@DanrwAU

Description

@DanrwAU

Hi Guys,

Script Analyzer is flagging a few variables as not used anywhere in the script.

These variables are only used during an Invoke-Command line when is calling them like below

Invoke-Command -Session $S -ScriptBlock {$VMDet = Get-VM $VM}
$VMDetails = Invoke-Command -Session $S -ScriptBlock {$VMDet}

Script analyzer is throwing file: '
message: 'The variable 'VMDet' is assigned but never used. (PSUseDeclaredVarsMoreThanAssignments)'
at: '665,62'
source: 'PSScriptAnalyzer'

Cheers

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp