PowerShellGetv2 icon indicating copy to clipboard operation
PowerShellGetv2 copied to clipboard

New-ScriptFileInfo

Open he852100 opened this issue 5 years ago • 2 comments

Steps to reproduce


Expected behavior


Actual behavior

PS /sdcard/Documents/sh> New-ScriptFileInfo -path ../aa/scriptfileinfo.ps1 -Description 'fgg' -force
MetadataError: /root/.powershell-daily/Modules/PowerShellGet/PSModule.psm1:10282
 Line |
10282 |                  $Author = $env:USER
      |                  ~~~~~~~~~~~~~~~~~~~
      | The variable cannot be validated because the value  is not
      | a valid value for the Author variable.

Get-PSScriptInfoString: /root/.powershell-daily/Modules/PowerShellGet/PSModule.psm1:10321
 Line |
10321 |          $PSScriptInfoString = Get-PSScriptInfoString @params
      |                                                       ~~~~~~~
      | Cannot validate argument on parameter 'Author'. The
      | argument is null or empty. Provide an argument that is not
      | null or empty, and then try the command again.

Test-ScriptFileInfo: /root/.powershell-daily/Modules/PowerShellGet/PSModule.psm1:10347
 Line |
10347 |  …           $scriptInfo = Test-ScriptFileInfo -Path $tempScriptFilePath
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      | PSScriptInfo is not specified in the script file
      | '/tmp/185685321.ps1'. You can use the
      | Update-ScriptFileInfo with -Force or New-ScriptFileInfo
      | cmdlet to add the PSScriptInfo to the script file.

Environment data

PSVersion                      7.0.0-daily.20200204
PSEdition                      Core
GitCommitId                    7.0.0-daily.20200204
OS                             Linux 4.9.112-perf #1 SMP PREEMPT …
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

he852100 avatar Feb 07 '20 10:02 he852100

@he852100 thanks for also opening this issue, could you please describe the expected behavior, the problem and if this is only a recent issue for you? Have you been able to successfully run this command in the past? Thanks!

SydneyhSmith avatar Feb 07 '20 22:02 SydneyhSmith

Expected to execute correctly. $USER does not exist

he852100 avatar Feb 08 '20 06:02 he852100