Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Write-Verbose : Cannot bind argument to parameter 'Message' because it is null #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

russ960
Copy link

@russ960 russ960 commented Aug 11, 2017

Fixed issue where default instance failed as the name would be truncated after the first character. Once this was done the code properly updates the startup parameters.

Here is the error I got::

`PS> Set-SQLStartupParameters "localhost" "-T1499"
Write-Verbose : Cannot bind argument to parameter 'Message' because it is null.
At line:22 char:23

  •     Write-Verbose $wmisvc.StartupParameters
    
  •                   ~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidData: (:) [Write-Verbose], ParameterBindingValidationException
    • FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.WriteVerbos
      eCommand

Exception calling "Substring" with "2" argument(s): "Index and length must refer to a location within the string.
Parameter name: length"
At line:38 char:50

  • ... ms += $oldparams | Where-Object {$_.Substring(0,2) -match '-d|-e|-l'}
  •                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    • FullyQualifiedErrorId : ArgumentOutOfRangeException

Exception setting "StartupParameters": "STARTUPPARAMETERS: unknown property."
At line:46 char:13

  •         $wmisvc.StartupParameters = $paramstring
    
  •         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], SetValueInvocationException
    • FullyQualifiedErrorId : ExceptionWhenSetting

WARNING: Startup Parameters for localhost updated. You will need to restart the service for these changes to take
effect.
PS>`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants