Title: Set-Date don't work and admin-elevated test is silently skipped · Issue #3099 · PowerShell/PowerShell · GitHub
Open Graph Title: Set-Date don't work and admin-elevated test is silently skipped · Issue #3099 · PowerShell/PowerShell
X Title: Set-Date don't work and admin-elevated test is silently skipped · Issue #3099 · PowerShell/PowerShell
Description: Currently Set-Date tests is silently skipped during elevated test phase in Start-PSPester because the tests use Test-IsElevated function instead of RequireAdminOnWindows tag. Really if we manually run the test - one is failed: PS > Start...
Open Graph Description: Currently Set-Date tests is silently skipped during elevated test phase in Start-PSPester because the tests use Test-IsElevated function instead of RequireAdminOnWindows tag. Really if we manually ...
X Description: Currently Set-Date tests is silently skipped during elevated test phase in Start-PSPester because the tests use Test-IsElevated function instead of RequireAdminOnWindows tag. Really if we manually ...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/3099
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Set-Date don't work and admin-elevated test is silently skipped","articleBody":"1. Currently `Set-Date` tests is silently skipped during elevated test phase in Start-PSPester because the tests use `Test-IsElevated` function instead of `RequireAdminOnWindows` tag.\r\n2. Really if we manually run the test - one is failed:\r\n```powershell\r\nPS \u003e Start-PSPester -Path \\test\\powershell\\Modules\\Microsoft.PowerShell.Utility\\Set-Date.Tests.ps1 -binDir \"C:\\Program Files\\PowerShell\\6.0.0.15\"\r\nVERBOSE: Running pester tests at '\\test\\powershell\\Modules\\Microsoft.PowerShell.Utility\\Set-Date.Tests.ps1'\r\nwith tag 'CI' and ExcludeTag 'Slow'\r\n\r\nDescribing Set-Date\r\n [-] Set-Date should be able to set the date in an elevated context 850ms\r\n Expected: the expression not to throw an exception. Message was {The parameter is incorrect}\r\n from \\test\\powershell\\Modules\\Microsoft.PowerShell.Utility\\Set-Date.Tests.ps1:11 char:22\r\n + { get-date | set-date } | Should not throw\r\n + ~~~~~~~~\r\n at line: 11 in \\test\\powershell\\Modules\\Microsoft.PowerShell.Utility\\Set-Date.Tests.ps1\r\n 11: { get-date | set-date } | Should not throw\r\n [!] Set-Date should produce an error in a non-elevated context 90ms\r\nTests completed in 940ms\r\nPassed: 0 Failed: 1 Skipped: 1 Pending: 0\r\n```\r\nThe command is manually executed failed too (I tested on Windows 10 with PS Core beta 15):\r\n```powershell\r\nPS \u003e get-date | set-date\r\nset-date : The parameter is incorrect\r\nAt line:1 char:12\r\n+ get-date | set-date\r\n+ ~~~~~~~~\r\n + CategoryInfo : NotSpecified: (:) [Set-Date], Win32Exception\r\n + FullyQualifiedErrorId : System.ComponentModel.Win32Exception,Microsoft.PowerShell.Commands.SetDateCommand\r\n\r\nPS \u003e get-date\r\n\r\nSaturday, February 4, 2017 9:09:32 PM\r\n\r\n\r\nPS \u003e set-date\r\n\r\ncmdlet Set-Date at command pipeline position 1\r\nSupply values for the following parameters:\r\nDate: 2/4/2017\r\nset-date : The parameter is incorrect\r\nAt line:1 char:1\r\n+ set-date\r\n+ ~~~~~~~~\r\n + CategoryInfo : NotSpecified: (:) [Set-Date], Win32Exception\r\n + FullyQualifiedErrorId : System.ComponentModel.Win32Exception,Microsoft.PowerShell.Commands.SetDateCommand\r\n```\r\n\r\n\r\n\r\n- [ ] So in [Set-Date.Tests.ps1](https://github.com/PowerShell/PowerShell/blob/master/test/powershell/Modules/Microsoft.PowerShell.Utility/Set-Date.Tests.ps1) the test must be marked by `RequireAdminOnWindows` tag in order to run in admin-elevated phase.\r\nAnd we could remove `Test-IsElevated` from the tests and from `Test.Helpers.psm1`.\r\n\r\n/cc @JamesWTruher @vors \r\n\r\n- [ ] `Set-Date` requires a fix (for Windows only?).\r\n\r\n/cc @andschwa ","author":{"url":"https://github.com/iSazonov","@type":"Person","name":"iSazonov"},"datePublished":"2017-02-04T18:42:25.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":11},"url":"https://github.com/3099/PowerShell/issues/3099"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f2286023-cc62-c568-fafa-fb1f11885784 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9F1C:32419A:1CF8FF6:2A1349C:6A54E6FF |
| html-safe-nonce | 28a94ff592ae64f45d550dcdd0f4da1d4dcb1698743c0e65a49de1a260bace31 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RjFDOjMyNDE5QToxQ0Y4RkY2OjJBMTM0OUM6NkE1NEU2RkYiLCJ2aXNpdG9yX2lkIjoiODQyNTQ2NzQ0OTc3MjkyNjcxOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5742804e71ef26e87f1a8a63b21225a86ccc5c71b50f2907832e87859a603ed4 |
| hovercard-subject-tag | issue:205366980 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/3099/issue_layout |
| twitter:image | https://opengraph.githubassets.com/60183382af03cd4badae4dd1b941f7e6c7e8d0a3e2ee75f68260693d27279930/PowerShell/PowerShell/issues/3099 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/60183382af03cd4badae4dd1b941f7e6c7e8d0a3e2ee75f68260693d27279930/PowerShell/PowerShell/issues/3099 |
| og:image:alt | Currently Set-Date tests is silently skipped during elevated test phase in Start-PSPester because the tests use Test-IsElevated function instead of RequireAdminOnWindows tag. Really if we manually ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | iSazonov |
| hostname | github.com |
| expected-hostname | github.com |
| None | eae2aab99907699a22d2c8449aa683ca74454fca87211b98f7c7b722086b2839 |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | bb1b4ffdc07c66de20ad344214f55df0aa364bd3 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width