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

Install-SqlDscReportingService: Continue running command even if not elevated #2070

Open
johlju opened this issue Mar 5, 2025 · 0 comments
Labels
bug The issue is a bug. good first issue The issue should be easier to fix and can be taken up by a beginner to learn to contribute on GitHub help wanted The issue is up for grabs for anyone in the community.

Comments

@johlju
Copy link
Member

johlju commented Mar 5, 2025

Problem description

The command is meant to stopp executing if not in elevated prompt.

Verbose logs

C:\Users\sqladmin\Desktop\report.txt -InstallFolder 'C:\Program Files\SSRS2022' -SuppressRestart -Verbose
Assert-ElevatedUser : This command must run in an elevated PowerShell session. (DRC0043)
At C:\Program Files\WindowsPowerShell\Modules\sqlserverdsc\17.1.0\SqlServerDsc.psm1:3604 char:5
+     Assert-ElevatedUser -ErrorAction 'Stop'
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (Command parameters:String) [Assert-ElevatedUser], Exception
    + FullyQualifiedErrorId : UserNotElevated,Assert-ElevatedUser

VERBOSE: Specified executable arguments: /quiet /IAcceptLicenseTerms /Edition=Dev /log "C:\Users\sqladmin\Desktop\report.txt"
/InstallFolder="C:\Program Files\SSRS2022" /norestart

Invoke a setup action
Are you sure you want to invoke the setup action 'Install'?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):

How to reproduce

Run the command in a non-elevated prompt.

Expected behavior

Stop executing.

Current behavior

Continues executing.

Suggested solution

Probably misses an -ErrorAction 'Stop' somewhere?

Operating system the target node is running

OsName               : Microsoft Windows Server 2025 Datacenter
OsOperatingSystemSKU : DatacenterServerEdition
OsArchitecture       : 64-bit
WindowsVersion       : 2009
WindowsBuildLabEx    : 26100.1.amd64fre.ge_release.240331-1435
OsLanguage           : en-US
OsMuiLanguages       : {en-US}

PowerShell version and build the target node is running

Name                           Value
----                           -----
PSVersion                      5.1.26100.2161
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.26100.2161
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Module version used

Name         Version Path
----         ------- ----
SqlServerDsc 17.1.0  C:\Program Files\WindowsPowerShell\Modules\SqlServerDsc\17.1.0\SqlServerDsc.psd1
@johlju johlju added bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community. good first issue The issue should be easier to fix and can be taken up by a beginner to learn to contribute on GitHub labels Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug. good first issue The issue should be easier to fix and can be taken up by a beginner to learn to contribute on GitHub help wanted The issue is up for grabs for anyone in the community.
Projects
None yet
Development

No branches or pull requests

1 participant