What does this Nuget error mean, although package was successfully installed? - frameworks

I installed Golem v 2.2 into my project "Jupiter.Gole.ISM" by entering this command at the Package Manager Console.
PM> Install-Package Golem
Even though the system reported that Golem 2.2.1 was successfully installed to my project, two errors had appeared:
1) Value does not fall within the expected range.
2) You cannot call a method on a null-valued expression.
...
...
Executing script file 'C:\Users\AChan\Documents\TestFrameworks\Jupiter.Gole.ISM\packages\Golem.2.2.1\tools\install.ps1'
InstallPath: C:\Users\AChan\Documents\TestFrameworks\Jupiter.Gole.ISM\packages\Golem.2.2.1
ToolsPath: C:\Users\AChan\Documents\TestFrameworks\Jupiter.Gole.ISM\packages\Golem.2.2.1\tools
Package: NuGet.PackageManagement.VisualStudio.ScriptPackage
Project: System.__ComObject
Value does not fall within the expected range.
At C:\Users\AChan\Documents\TestFrameworks\Jupiter.Gole.ISM\packages\Golem.2.2.1\tools\install.ps1:32 char:1
+ $mobFile = $project.ProjectItems.Item("Proxy").ProjectItems.Item("bro ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], ArgumentException
+ FullyQualifiedErrorId : System.ArgumentException
You cannot call a method on a null-valued expression.
At C:\Users\AChan\Documents\TestFrameworks\Jupiter.Gole.ISM\packages\Golem.2.2.1\tools\install.ps1:33 char:1
+ $mobFile.Properties.Item("CopyToOutputDirectory").Value = 2
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
Successfully installed 'Golem 2.2.1' to Jupiter.Gole.ISM
PM>
Thanks for your feedback.
Arlene

Related

I tried to open current folder using powershell in vs code using code . It shows following error

Program 'code.cmd' failed to run: The system cannot find the file specifiedAt line:1 char:1
+ code .
+ ~~~~~~.
At line:1 char:1
+ code .
+ ~~~~~~
+ CategoryInfo : ResourceUnavailable: (:) [], ApplicationFailedException
+ FullyQualifiedErrorId : NativeCommandFailed
I expected the vs code will open in current folder

Issue with power shell solution checker script

I'm getting following error while running the powershell solution checker script for CI:
Get-PowerAppsCheckerRulesets : An error occurred while sending the request.
At C:\MSDynamics\BuildScripts\PowerShell\SolutionCheckerCI.ps1:31 char:13
+ $rulesets = Get-PowerAppsCheckerRulesets -Geography Europe -TenantId ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-PowerAppsCheckerRulesets], HttpRequestException
+ FullyQualifiedErrorId : System.Net.Http.HttpRequestException,Microsoft.PowerApps.Checker.PowerShell.Cmdlets.GetPowerAppsCheckerRulesets

PowerShell File Path for Readyshare

Specification:
OS Windows 10
SQL Server 2012
Languages and software used:
Powershell
Excel 2010
Code:
#Define locations and delimiter
$csv = "\\READYSHARE\USB_Storage\Trucking_Inc\SomeFile.csv" #Location of the source file
$xlsx = "\\READYSHARE\USB_Storage\Trucking_Inc\SomeFile2.xlsx" #Desired location of output
$delimiter = "," #Specify the delimiter used in the file
# Create a new Excel workbook with one empty sheet
$excel = New-Object -ComObject excel.application
$workbook = $excel.Workbooks.Add(1)
$worksheet = $workbook.worksheets.Item(1)
# Build the QueryTables.Add command and reformat the data
$TxtConnector = ("TEXT;" + $csv)
$Connector = $worksheet.QueryTables.add($TxtConnector,$worksheet.Range("A1"))
$query = $worksheet.QueryTables.item($Connector.name)
$query.TextFileOtherDelimiter = $delimiter
$query.TextFileParseType = 1
$query.TextFileColumnDataTypes = ,1 * $worksheet.Cells.Columns.Count
$query.AdjustColumnWidth = 1
# Execute & delete the import query
$query.Refresh()
$query.Delete()
# Save & close the Workbook as XLSX.
$Workbook.SaveAs($xlsx,51)
$excel.Quit()
Job error:
Executed as user: NT Service\SQLAgent$Server. ...l.exe -file "C:\Scripts\trasaction.ps1"Microsoft Excel cannot access the file '\READYSHARE\USB_Storage\Trucking_Inc\SomeFile2.csv'. There are several possible reasons: The file name or path does not exist. The file is being used by another program. The workbook you are trying to save has the same name as a currently open workbook. At C:\Scripts\trasaction.ps1:12 char:1 + $Workbook = $excel.Workbooks.Open($ExcelFilePath) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : OperationStopped: (:) [], COMException + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException You cannot call a method on a null-valued expression. At C:\Scripts\trasaction.ps1:13 char:1 + $Worksheet = $Workbook.Sheets.Item(1) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull You cannot call a method on a null-valued expression. At C:\Scripts\trasaction.ps1:21 char:1 + Out-File -FilePath C:\Scripts\process.txt -InputObject $Columns.Cells ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull You cannot call a method on a null-valued expression. At C:\Scripts\trasaction.ps1:22 char:1 + Write-Host $Columns.Cells(5,5).Value + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull You cannot call a method on a null-valued expression. At C:\Scripts\trasaction.ps1:161 char:1 + $eRow = $Worksheet.cells.item(1,1).entireRow + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull You cannot call a method on a null-valued expression. At C:\Scripts\trasaction.ps1:162 char:1 + $active = $eRow.activate() + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull You cannot call a method on a null-valued expression. At C:\Scripts\trasaction.ps1:163 char:1 + $active = $eRow.insert($xlShiftDown) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull You cannot call a method on a null-valued expression. At C:\Scripts\trasaction.ps1:164 char:1 + $Worksheet.Cells.item(1,1) = "TRANSACTION_DATE" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull You cannot call a method on a null-valued expression. At C:\Scripts\trasaction.ps1:165 char:1 + $Worksheet.Cells.item(1,2) = "AMOUNT" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull You cannot call a method on a null-valued expression. At C:\Scripts\trasaction.ps1:166 char:1 + $Worksheet.Cells.item(1,3) = "TYPE_OF_AUTHORIZATION_AND_DATE" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull You cannot call a method on a null-valued expression. At C:\Scripts\trasaction.ps1:167 char:1 + $Worksheet.Cells.item(1,4) = "CHECK_NUMBER" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull You cannot ... Process Exit Code 0. The step succeeded.
Things that were tried.
giving perminsions for the SqlServerAgent. Which readyshare will not let me do.
making the file path with powershell script name in to a bat file to be executed from the C: drive to get into the file path.
Notes:
This powershell script runs great from the command prompt by manually opening up cmd and executing. Even works great from the ISE (x86) manually.
However, when using this from a job you get the error listed above.
I have tried to get the readyshare drive to give SQLSeverAgent permissions but reverts back to original permissions. The router I have is a nightHawk router
and I didn't see any setting with in the router to give permissons either tried through Windows 10 but reverts back to original permissions.
Checked these suggestion from the message
The file name or path does not exist.
The file is being used by another program.
The workbook you are trying to save has the same name as a currently open workbook.
None applied.
Is there any work around or option I may not know about? Need some guidance or pointer in the right direction.

Error in migrations in EFCore

When I run Add-Migration using Microsoft.EntityFrameworkCore.Tools 1.1.1, I get the following error:
Add-Migration : Exception calling "Substring" with "1" argument(s):
"StartIndex cannot be less than zero. Parameter name: startIndex" At
line:1 char:1
+ Add-Migration
+ ~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Add-Migration], MethodInvocationException
+ FullyQualifiedErrorId : ArgumentOutOfRangeException,Add-Migration
The same stuff works perfect with version 1.1.0-preview4-final
This is issue #8163. You can safely ignore the error. It will be fixed in 2.0.0-preview2-final.

Errors when opening Nuget Package Manage Console

Whenever I open the package manager console in new VS 2017 session, it shows the below two error messages, and the for all intents and purposes operates normally. At least for vanilla commands like Install-Package.
Join-Path : Cannot convert 'System.Object[]' to the type 'System.String' required by parameter 'ChildPath'. Specified method is not supported.
At C:\Dev\.NET\Projects\AcmeSoft\Code\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\tools\init.ps1:13 char:57
+ ... rPackageDirectory = Join-Path $packageDirectory $compilerPackage.Name
+ ~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Join-Path], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgument,Microsoft.PowerShell.Commands.JoinPathCommand
and
Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At C:\Dev\.NET\Projects\AcmeSoft\Code\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\tools\init.ps1:14 char:44
+ ... erPackageToolsDirectory = Join-Path $compilerPackageDirectory 'tools'
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand
The offending line for the first is:
$compilerPackageDirectory = Join-Path $packageDirectory $compilerPackage.Name
with the error at $compilerPackage.Name (i.e. "char:57")
The offending line for the second is:
$compilerPackageToolsDirectory = Join-Path $compilerPackageDirectory 'tools'
with the error at $compilerPackageDirectory 'tools'.
Can anyone with more Nuget and or PowerShell skills than me explain why this is happening, and how I can fix it, please?