text:
BUG (Docker) New installation fails with clean mariadb database

Hello,
i have a problem with a new PDA installation. I have a clean database and PDA fills that with the schema.
Thats the error code from the pda container log:
Traceback (most recent call last):
  File "/usr/bin/flask", line 8, in <module>
    sys.exit(main())
  File "/usr/lib/python3.8/site-packages/flask/cli.py", line 966, in main
    cli.main(prog_name="python -m flask" if as_module else None)
  File "/usr/lib/python3.8/site-packages/flask/cli.py", line 586, in main
    return super(FlaskGroup, self).main(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/lib/python3.8/site-packages/flask/cli.py", line 426, in decorator
    return __ctx.invoke(f, *args, **kwargs)
  File "/usr/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/flask_migrate/cli.py", line 134, in upgrade
    _upgrade(directory, revision, sql, tag, x_arg)
  File "/usr/lib/python3.8/site-packages/flask_migrate/__init__.py", line 95, in wrapped
    f(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/flask_migrate/__init__.py", line 280, in upgrade
    command.upgrade(config, revision, sql=sql, tag=tag)
  File "/usr/lib/python3.8/site-packages/alembic/command.py", line 298, in upgrade
    script.run_env()
  File "/usr/lib/python3.8/site-packages/alembic/script/base.py", line 489, in run_env
    util.load_python_file(self.dir, "env.py")
  File "/usr/lib/python3.8/site-packages/alembic/util/pyfiles.py", line 98, in load_python_file
    module = load_module_py(module_id, path)
  File "/usr/lib/python3.8/site-packages/alembic/util/compat.py", line 184, in load_module_py
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "migrations/env.py", line 88, in <module>
    run_migrations_online()
  File "migrations/env.py", line 81, in run_migrations_online
    context.run_migrations()
  File "<string>", line 8, in run_migrations
  File "/usr/lib/python3.8/site-packages/alembic/runtime/environment.py", line 846, in run_migrations
    self.get_context().run_migrations(**kw)
  File "/usr/lib/python3.8/site-packages/alembic/runtime/migration.py", line 520, in run_migrations
    step.migration_fn(**kw)
  File "/app/migrations/versions/856bb94b7040_add_comment_column_in_domain_template_.py", line 21, in upgrade
    op.add_column('domain_template_record',
  File "<string>", line 8, in add_column
  File "<string>", line 3, in add_column
  File "/usr/lib/python3.8/site-packages/alembic/operations/ops.py", line 1929, in add_column
    return operations.invoke(op)
  File "/usr/lib/python3.8/site-packages/alembic/operations/base.py", line 374, in invoke
    return fn(self, operation)
  File "/usr/lib/python3.8/site-packages/alembic/operations/toimpl.py", line 132, in add_column
    operations.impl.add_column(table_name, column, schema=schema, **kw)
  File "/usr/lib/python3.8/site-packages/alembic/ddl/impl.py", line 237, in add_column
    self._exec(base.AddColumn(table_name, column, schema=schema))
  File "/usr/lib/python3.8/site-packages/alembic/ddl/impl.py", line 140, in _exec
    return conn.execute(construct, *multiparams, **params)
  File "/usr/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 982, in execute
    return meth(self, multiparams, params)
  File "/usr/lib/python3.8/site-packages/sqlalchemy/sql/ddl.py", line 72, in _execute_on_connection
    return connection._execute_ddl(self, multiparams, params)
  File "/usr/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1039, in _execute_ddl
    ret = self._execute_context(
  File "/usr/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1249, in _execute_context
    self._handle_dbapi_exception(
  File "/usr/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1476, in _handle_dbapi_exception
    util.raise_from_cause(sqlalchemy_exception, exc_info)
  File "/usr/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 398, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/usr/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 152, in reraise
    raise value.with_traceback(tb)
  File "/usr/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1245, in _execute_context
    self.dialect.do_execute(
  File "/usr/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 581, in do_execute
    cursor.execute(statement, parameters)
  File "/usr/lib/python3.8/site-packages/MySQLdb/cursors.py", line 209, in execute
    res = self._query(query)
  File "/usr/lib/python3.8/site-packages/MySQLdb/cursors.py", line 315, in _query
    db.query(q)
  File "/usr/lib/python3.8/site-packages/MySQLdb/connections.py", line 239, in query
    _mysql.connection.query(self, query)
sqlalchemy.exc.OperationalError: (MySQLdb._exceptions.OperationalError) (1060, "Duplicate column name 'comment'")
[SQL: ALTER TABLE domain_template_record ADD COLUMN comment TEXT]
(Background on this error at: http://sqlalche.me/e/e3q8)

This is my compose file:
version: "3.7"

services:
  mariadb:
    image: mariadb:10.4
    environment:
      MYSQL_ROOT_PASSWORD: mypassword
      MYSQL_USER: powerdns
      MYSQL_PASSWORD: otherpassword
      MYSQL_DATABASE: powerdns
    restart: unless-stopped
    volumes:
      - ./pv/mariadb:/var/lib/mysql

  pdns:
    image: psitrax/powerdns:v4.3.0
    ports:
      - "53:53"
      - "53:53/udp"
    depends_on:
      - mariadb
    environment:
      MYSQL_DB: powerdns
      MYSQL_USER: powerdns
      MYSQL_PASS: otherpassword
      MYSQL_HOST: mariadb
    restart: unless-stopped
  #  volumes:
  #    - ./pv/pdns:/etc/pdns/

  pdns-admin:
    image: ngoduykhanh/powerdns-admin:0.2.2
    ports:
      - "9191:80"
    restart: unless-stopped
    depends_on:
      - mariadb
      - pdns
    logging:
      driver: json-file
      options:
        max-size: 50m
    environment:
      SQLALCHEMY_DATABASE_URI: mysql://pda:thisismypassword@mariadb/pda
      GUNICORN_TIMEOUT: 60
      GUNICORN_WORKERS: 2
      GUNICORN_LOGLEVEL: DEBUG
      OFFLINE_MODE: "False" # True for offline, False for external resources
    volumes:
      - ./pv/pdns-admin:/data

I try to delete the database and restart the pda container, but get the same error.
Please help, i hate the pdnsutil cli ^^
Thank you :)

Hello,
Could you resolve your issue since you asked ?
Regards

repo: PowerDNS-Admin/PowerDNS-Admin


text:
akka.actor.serializers is not in sync between the two systems序列化程序不同步

2022-06-02 21:24:52.938  WARN 7 --- [lt-dispatcher-9] akka.remote.artery.Deserializer          : Failed to deserialize message from [akka://oms@10.244.11.143:27777] with serializer id [6] and manifest []. java.io.NotSerializableException: Cannot find serializer with id [32] (manifest [com.github.kfcfans.powerjob.common.request.WorkerHeartbeat]). The most probable reason is that the configuration entry akka.actor.serializers is not in sync between the two systems.
2022-06-02 21:24:55.528  INFO 7 --- [omsTimingPool-5] t.p.s.c.scheduler.PowerScheduleService   : [JobScheduleService] cron schedule: 3.198 ms, workflow schedule: 856.1 μs, frequent schedule: 766.1 μs.
2022-06-02 21:24:55.673  WARN 7 --- [lt-dispatcher-9] akka.remote.artery.Deserializer          : Failed to deserialize message from [akka://oms@10.244.18.180:27777] with serializer id [6] and manifest []. java.io.NotSerializableException: Cannot find serializer with id [32] (manifest [com.github.kfcfans.powerjob.common.request.WorkerHeartbeat]). The most probable reason is that the configuration entry akka.actor.serializers is not in sync between the two systems.
2022-06-02 21:24:55.748  INFO 7 --- [  XNIO-1 task-3] t.p.s.r.s.e.ServerElectionService        : [ServerElection] this server(10.244.18.179:10086) become the new server for app(appId=1).
2022-06-02 21:24:57.979 ERROR 7 --- [  XNIO-1 task-3] t.p.s.web.ControllerExceptionHandler     : [ControllerException] http request failed.

同问

同问

一般都是 server 和 worker 的版本不同步导致的，检查下相关的版本信息

source: gharchive/issue

repo: PowerJob/PowerJob

license_type: permissive

license_source: github-api


text:
应用接入Worker在启用测试模式后启动失败

您好:
反应一个奇怪的状况，
在现有SpringBoot应用中接入Worker，
并在配置文件启用测试模式
(powerjob.worker.enableTestMode=true)
应用启动会失败；
但改成powerjob.worker.enableTestMode=false
却会成功。
平台：
PowerJob Server-PowerJob(docker-compose版)
PowerJob Worker-SpringBoot 2.7.9
Worker OS-Ubuntu 20.04.5 LTS
Worker JVM-Java 17.0.5 Eclipse-Temurin
项目依赖：
https://gist.github.com/tzengshinfu/502992addb8ca743c7d3ebd813db85e0
配置文件：
https://gist.github.com/tzengshinfu/5b72a54acb8aaca615a99fec71a7e6b4
PowerJobConfig.java：
https://gist.github.com/tzengshinfu/ef6747fb905a465f0395f074bfd36d20
Log：
https://gist.github.com/tzengshinfu/327ce76b268722a812ac093ea9350ed0

好的，问题已收到，我看看什么原因导致的。

好的，问题已收到，我看看什么原因导致的。

谢谢 @KFCFans ，我先把processor从业务应用分拆出来，这样两边都会单纯些，您可先排查其他问题。

一个小错误，已修复。如果急用的话，也可以自己先 merge 这个改动。

authors: KFCFans tzengshinfu


text:
Support for ACR/Container Registries as a Repository

Summary of the new feature / enhancement
As a user I want to be able to utilize ACR as a private repository for my packages with PSResourceGet/PowerShellGet.
Proposed technical implementation details (optional)
No response

Doc updates should be made for this as well

authors: SydneyhSmith alerickson

repo: PowerShell/PSResourceGet

license: MIT


text:
Severity parameter is case-sensitive.

When running the command:
    invoke-scriptanalyzer .\a.ps1 -severity error

invoke-scriptanalyzer will throw an ArgumentException.

Hi @imfrancisd, thanks for reporting this! We will fix this issue as soon as possible!

Hi @imfrancisd , the bug is fixed and submitted into BugFixes. #148

authors: imfrancisd yutingc

repo: PowerShell/PSScriptAnalyzer

license: mit

license_source: bigquery


text:
PSParser Tokenize with Switch Default fails

Trouble when trying to Tokenize a script containing a Switch-statement with a Default case in Powershell 7.1.0-preview.5. This works as expected in Powershell 7.0.3 (stable). If one does comment-out the default case, it works as expected. This has been reproduced on more than one computer.
Steps to reproduce
Create a file containing a simple function that has a switch-statement with a default case (see below). Save that file. Then try to tokenize that file (also see below) from a console running Powershell 7.1.0-preview.5.
# Save this as a file called 'TEST.ps1'
Function Test {
    Param (
        $String
    )

    Switch ($String) {
        "test" {
            "sfdsf"
        }

        "test2" {
            "sfdsf"
        }

        default {
            "sdfsdf"
        }
    }
}

# From a Powershell 7.1.0-preview.5 prompt execute the following:
$scripts = Get-ChildItem -Path "C:\__TEMP\TEST.ps1"

Foreach ($file in $scripts) {
    $contents = Get-Content -Path $file.fullname -ErrorAction Stop
    $errors = $null
    $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors)
    $errors.Count -eq 0
}

Expected behavior
True

Actual behavior
MethodInvocationException:
Line |
   4 |      $null = [System.Management.Automation.PSParser]::Tokenize($conten …
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Exception calling "Tokenize" with "2" argument(s): "Index was outside the bounds of the array."
True

Environment data

Name                           Value
----                           -----
PSVersion                      7.1.0-preview.5
PSEdition                      Core
GitCommitId                    7.1.0-preview.5
OS                             Microsoft Windows 10.0.19041
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0ÔÇª}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

PSParser is legacy and I'm not sure it's actually supported in a meaningful way.
Instead, you can use:
$tokens = $parseErrors = $null
$ast = [System.Management.Automation.Language.Parser]::ParseInput($script, [ref]$tokens, [ref]$parseErrors)

My guess is the PSParser code path was probably broken with #10487 cc @SteveL-MSFT @rjmholt not sure PSParser is really supported / what would need to be done to "fix" it following that change, or whether it's worth looking into as there are fully functional and supported alternatives available.

Thank you for your prompt reply!
Perfect, that works for me. Hopefully this will help someone else as well.

This sounds like something we should still fix though -- the PSParser API needs to be maintained for broad module compatibility

Full stack trace:

Exception             :
    Type           : System.Management.Automation.MethodInvocationException
    ErrorRecord    :
        Exception             :
            Type    : System.Management.Automation.ParentContainsErrorRecordException
            Message : Exception calling "Tokenize" with "2" argument(s): "Index was outside the
bounds of the array."
            HResult : -2146233087
        CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordException
        FullyQualifiedErrorId : IndexOutOfRangeException
        InvocationInfo        :
            ScriptLineNumber : 1
            OffsetInLine     : 1
            HistoryId        : -1
            Line             : [System.Management.Automation.PSParser]::Tokenize($s, [ref]$errs)
            PositionMessage  : At line:1 char:1
                               + [System.Management.Automation.PSParser]::Tokenize($s, [ref]$errs)
                               + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            CommandOrigin    : Internal
        ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1
    TargetSite     :
        Name          : ConvertToMethodInvocationException
        DeclaringType : System.Management.Automation.ExceptionHandlingOps,
System.Management.Automation, Version=7.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
        MemberType    : Method
        Module        : System.Management.Automation.dll
    StackTrace     :
   at System.Management.Automation.ExceptionHandlingOps.ConvertToMethodInvocationException(Exception
exception, Type typeToThrow, String methodName, Int32 numArgs, MemberInfo memberInfo)
   at CallSite.Target(Closure , CallSite , Type , Object , PSReference )
   at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1
arg1, T2 arg2)
   at System.Management.Automation.Interpreter.DynamicInstruction`4.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame
frame)
    Message        : Exception calling "Tokenize" with "2" argument(s): "Index was outside the
bounds of the array."
    Data           : System.Collections.ListDictionaryInternal
    InnerException :
        Type       : System.IndexOutOfRangeException
        TargetSite :
            Name          : GetPSTokenType
            DeclaringType : System.Management.Automation.PSToken
            MemberType    : Method
            Module        : System.Management.Automation.dll
        StackTrace :
   at System.Management.Automation.PSToken.GetPSTokenType(Token token)
   at System.Management.Automation.PSToken..ctor(Token token)
   at System.Management.Automation.PSParser.get_Tokens()
   at System.Management.Automation.PSParser.Tokenize(String script, Collection`1& errors)
   at CallSite.Target(Closure , CallSite , Type , Object , PSReference )
        Message    : Index was outside the bounds of the array.
        Source     : System.Management.Automation
        HResult    : -2146233080
    Source         : System.Management.Automation
    HResult        : -2146233087
CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
FullyQualifiedErrorId : IndexOutOfRangeException
InvocationInfo        :
    ScriptLineNumber : 1
    OffsetInLine     : 1
    HistoryId        : -1
    Line             : [System.Management.Automation.PSParser]::Tokenize($s, [ref]$errs)
    PositionMessage  : At line:1 char:1
                       + [System.Management.Automation.PSParser]::Tokenize($s, [ref]$errs)
                       + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    CommandOrigin    : Internal
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1

The problem is that this mapping hasn't been maintained:
https://github.com/PowerShell/PowerShell/blob/4b9b0788ed28ea6d463ce857d1ed81bd4a977a59/src/System.Management.Automation/engine/lang/interface/PSToken.cs#L105-L307
That's ostensibly easy to fix, but:

We need testing for it
We need to work out what else might be missing
There may be tokens that we could return but we can't for compatibility reasons -- something I'm not sure how to handle (haven't thought about this properly). For example, how should a caller built to handle PS v3 code deal with the class keyword?

/cc @daxian-dbw

@rjmholt Is this specific regression caused by https://github.com/PowerShell/PowerShell/pull/10487?

@rjmholt Is this specific regression caused by #10487?

I believe so

base seems to be working fine:
PS:162> $es = $null; [System.Management.Automation.PSParser]::Tokenize("class foo { foo() : base() }", [ref]$es)
...
Content     : base
Type        : Unknown
Start       : 20
Length      : 4
StartLine   : 1
StartColumn : 21
EndLine     : 1
EndColumn   : 25
...

Type        : Unknown

That looks like this:
https://github.com/PowerShell/PowerShell/blob/4b9b0788ed28ea6d463ce857d1ed81bd4a977a59/src/System.Management.Automation/engine/lang/interface/PSToken.cs#L306

Yeah. Let's first fix this regression by simply updating s_tokenKindMapping. And also open a new issue to discuss how to deal with PSParser in the long term to keep it up-to-date.

authors: LAltinell daxian-dbw rjmholt vexx32

repo: PowerShell/PowerShell


text:
Importing modules by name is case sensitive

Steps to reproduce
Start a PowerShell session.
Remove-Module PSReadline
Import-Module PSReadline
Expected behavior
Expect to be able to re-import PSReadline. This works with other modules.
Actual behavior
Error reporting module can't be found.

## Environment data

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      5.1.10032.0
PSEdition                      PowerShellCore
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   3.0.0.0
GitCommitId                    v6.0.0-alpha.7
CLRVersion
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

I believe that as a general principle, PowerShell should be as case-preserving/case insensitive as possible while not breaking the underlying OS.
So in the case of the Unix File system manipulation and environmental variables - these directly affect the underlying OS and integration with other tools so we have to be case sensitive.
In the case of PowerShell variable names - there is no interaction between them and the underlying OS so we should be case insensitive.
So then issue with Module Names is that they are a tweener.  On the one hand there is a strong mapping to an underlying OS - a foldername.  On the other hand, theyy refer to a pure PowerShell concept - a PowerShell Module.   So you could argue it either way.
To me, the thing that pushes this decisively to the Case Insensitive solution is the effect the issue has on Ecosystem sharing.  If module names are case sensitive in Unix, then Tom might publish Module TEST and Mary might publish Module test.  But then if a Windows users tries to use both these modules, they are going to collide and they fail.
I'm going to propose an acid test we need to apply:  Does case sensitivity break sharing artifacts between Windows and Linux?    If the answer is yes, then the prima facia answer should be that we should be case insensitive.
Ergo - Module names should be case insensitive.
Does that sound right?

Guys, please note that it isn't about "Windows is case-sensitive and Linux is not". That's "most common Windows file systems are case-insensitive" and "most common Linux file systems are case-sensitive". And, AFAIK, macOS is case-insensitive too. You could switch this option either on Windows, on Linux or on macOS.
That decision (at least about the file names) shouldn't be tied to platform, but to underlying FS (and every OS could at once mount multiple file systems with different settings).

Noticing that $env variables are case-sensitive as well.  $env:PSMODULEPATH does not equal $env:PSModulePath

Environment variables on Linux are case sensitive.

This needs to get fixed along with #706. Adding it to the usability project.

Based on @jpsnover's reply and the logic that the @PowerShell/powershell-committee landed on in #706, we should close on the fact that importing two modules with the same case-insensitive names should have the same behavior as whatever happens when you import two modules with the same name from different paths (either an error, overwriting the existing one in memory, or silently doing nothing).

authors: ForNeVeR Zsoldier andschwa jdhitsolutions joeyaiello jpsnover


text:
Build scripts don't detect installed cmake

The provided build scripts are not able to find cmake. Both Start-PSBuild and Start-PSBootstrap say that cmake is missing, however choco states differently:

On first run the Start-PSBootstrap installed cmake and cmake.install. However, the scripts still can't detect cmake. I tried both running powershell as normal and elevated, even rebooted to sort out %PATH% issues.
Running Windows 10 build 14905, VS2015 at latest patch level, Chocolatey v0.10.0.

I had this problem :)
$env:path got wrong path to cmake. (X64 vs X86)
I just added the counter part to the path, and it worked :)

@McAndersDK thanks for the hint. After I changed C:\Program Files (x86)\CMake\bin to C:\Program Files\CMake\bin the build could continue.

authors: McAndersDK thoemmi


text:
Start-PSBootstrap failing on Windows 10

From a freshly cloned repository, I'm trying to build Powershell on Windows 10 using PowerShell Core 6.0.0-beta.   It fails.
It seems to work using the Windows 10 distributed PowerShell.exe.
Steps to reproduce
From repository root:
import-module .\build.psm1
Start-PSBootstrap

Expected behavior
bootstrap completes, as under desktop version of PowerShell:
Installing PowerShell build dependencies
C:
dotnet-install: Downloading https://dotnetcli.azureedge.net/dotnet/Sdk/2.0.0-preview1-005952/dotnet-sdk-2.0.0-preview1-005952-win-x64.zip
dotnet-install: Downloading https://dotnetcli.azureedge.net/dotnet/Sdk/2.0.0-preview1-005952/dotnet-dev-win-x64.2.0.0-preview1-005952.zip
dotnet-install: Extracting zip from https://dotnetcli.azureedge.net/dotnet/Sdk/2.0.0-preview1-005952/dotnet-dev-win-x64.2.0.0-preview1-005952.zip
dotnet-install: Adding to current process PATH: "C:\Users\Burt_\AppData\Local\Microsoft\dotnet\". Note: This change will not be visible if PowerShell was run as a child process.
dotnet-install: Installation finished
Chocolatey is already installed. Skipping installation.
Cmake is already installed. Skipping installation.
Windows 10 SDK present. Skipping installation.

Actual behavior
Installing PowerShell build dependencies
C:
dotnet-install: Downloading https://dotnetcli.azureedge.net/dotnet/Sdk/2.0.0-preview1-005952/dotnet-sdk-2.0.0-preview1-005952-win-x64.zip
dotnet-install: Downloading https://dotnetcli.azureedge.net/dotnet/Sdk/2.0.0-preview1-005952/dotnet-dev-win-x64.2.0.0-preview1-005952.zip
Exception calling "IsBypassed" with "1" argument(s): "Operation is not supported on this platform."
At C:\code\PowerShell\tools\dotnet-install.ps1:170 char:20
+ ...          if($DefaultProxy -and (-not $DefaultProxy.IsBypassed($Uri))) ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : PlatformNotSupportedException

Environment data
Latest commit 6bb12c9df5afa0a2cbbcef1289b2f253875ed50d.
There are no HTTP proxies in my environment.  I'm behind a modern home NAT router.

Name                           Value
----                           -----
PSVersion                      6.0.0-beta
PSEdition                      Core
BuildVersion                   3.0.0.0
CLRVersion
GitCommitId                    v6.0.0-beta.2
OS                             Microsoft Windows 10.0.15063
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

This was discussed today.
Error derives from some .NET APIs missing on CoreCLR.
Currently Start-PSBootstrap has to be run in full Windows PowerShell.
Need to either:

when it is launched on PowerShell Core on Windows, add a warning/error to Start-PSBootstrap saying to use Windows PowerShell.
when it is launched on PowerShell Core on Windows, implicitly launch Windows PowerShell and run the necessary stuff in there.

This should be addressed by #4144. See the changes in build.psm1 at here

authors: BurtHarris anmenaga daxian-dbw


text:
Powershell 6.0.0-1.debian.9 logging to /var/log/syslog is too verbose...

Hi there,
Opening /usr/bin/pwsh, typing in "hello world." and pressing enter yields 43 (+4 on exit) events to /var/log/syslog. This isn't the case with all of my servers but it is for all of my servers running Powershell 6.0.0-1.debian.9.
Here is the first log generated, as an example:
Jan 25 15:53:30 server-name powershell[18813]: (v6.0.0:7:11) [Command_Lifecycle:CommandStart.Method.Informational] Command Import-Module is Started.#012%n%nContext:%n        Severity = Informational#012        Host Name = ConsoleHost#012        Host Version = 6.0.0#012        Host ID = 183c0648-d3c2-4c60-9ba5-18204b3c9f81#012        Host Application = /opt/microsoft/powershell/6.0.0/pwsh.dll#012        Engine Version = 6.0.0#012        Runspace ID = b261234c-963d-4ab3-b814-03161505d08f#012        Pipeline ID = 1#012        Command Name = Import-Module#012        Command Type = Cmdlet#012        Script Name = #012        Command Path = #012        Sequence Number = 7#012        User = server-name\root#012        Connected User = #012        Shell ID = Microsoft.PowerShell#012%n%nUser Data:%n%n

17 lines later it's telling me that the console is ready for use:
Jan 25 15:53:31 server-name powershell[18813]: (v6.0.0:1:10) [Perftrack_ConsoleStartupStop:PowershellConsoleStartup.WinStop.Informational] PowerShell console is ready for user input

And then finally, 47 lines later it's done with:
Jan 25 16:10:08 server-name powershell[18813]: (v6.0.0:7:11) [Command_Lifecycle:CommandStop.Method.Informational] Command PSConsoleHostReadline is Stopped.#012%n%nContext:%n        Severity = Informational#012        Host Name = ConsoleHost#012        Host Version = 6.0.0#012        Host ID = 183c0648-d3c2-4c60-9ba5-18204b3c9f81#012        Host Application = /opt/microsoft/powershell/6.0.0/pwsh.dll#012        Engine Version = 6.0.0#012        Runspace ID = b261234c-963d-4ab3-b814-03161505d08f#012        Pipeline ID = 9#012        Command Name = PSConsoleHostReadline#012        Command Type = Function#012        Script Name = #012        Command Path = #012        Sequence Number = 42#012        User = server-name\root#012        Connected User = #012        Shell ID = Microsoft.PowerShell#012%n%nUser Data:%n%n

As you can imagine, running even a simple script would cause flooding of syslog and then worse for log servers downstream.
Is this "normal" now, is there a way to disable this behavior or at least redirect logging to another source, for instance to one that isn't sent off for parsing by log servers?
Thanks!

@dantraMSFT Thanks for the clarification. I like the idea that all events are defined in the manifest and the caller just provides event id and payload to write an event.

This would work on Linux and MacOS; in fact, the manifest is currently is being used to generate the resx file containing the event messages that are logged to syslog/os_log. Take a look at tools\ResxGen\Resxgen.psm1.  It currently extracts this information from the manifest in anticipation of changes to our logging.
For example, it's straight forward to use this to generate a C# class like mc.exe does then insert the platform specific 'logger' interface underneath it.

@k1rb: This should now be fixed with PR https://github.com/PowerShell/PowerShell/pull/6086

authors: dantraMSFT daxian-dbw k1rb


text:
ArgumentException.ThrowIfNullOrEmpty();

PR Summary
Use ArgumentException.ThrowIfNullOrEmpty(); where possible

PR Context
Contributes to #19212

PR Checklist

[ ] PR has a meaningful title

Use the present tense and imperative mood when describing your changes

[ ] Summarized changes
[ ] Make sure all .h, .cpp, .cs, .ps1 and .psm1 files have the correct copyright header
[ ] This PR is ready to merge and is not Work in Progress.

If the PR is work in progress, please add the prefix WIP: or [ WIP ] to the beginning of the title (the WIP bot will keep its status check at Pending while the prefix is present) and remove the prefix when the PR is ready.

Breaking changes

[ ] None
OR
[ ] Experimental feature(s) needed

[ ] Experimental feature name(s):

User-facing changes

[ ] Not Applicable
OR
[ ] Documentation needed

[ ] Issue filed:

Testing - New and feature

[ ] N/A or can only be tested interactively
OR
[ ] Make sure you've added a new test if existing tests do not effectively test the code changed

Tooling

[ ] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted.
OR
[ ] I have considered the user experience from a tooling perspective and opened an issue in the relevant tool repository. This may include:

[ ] Impact on PowerShell Editor Services which is used in the PowerShell extension for VSCode
(which runs in a different PS Host).

[ ] Issue filed:

[ ] Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features.

[ ] Issue filed:

[ ] Impact on PSScriptAnalyzer (which provides linting & formatting in the editor extensions).

[ ] Issue filed:

[ ] Impact on EditorSyntax (which provides syntax highlighting with in VSCode, GitHub, and many other editors).

[ ] Issue filed:

@daxian-dbw Can we make changes to Microsoft.Management.UI.Internal. Notably, #18784 made changes there.
Previous guidance has been the module is frozen, but we have not documented this in the repository.

For Microsoft.Management.UI.Internal, we ship it and own the code, so I think it's OK to make changes to it.
But for code that we don't build/ship (e.g. ScheduledJob, LocalAccounts), we should avoid changing it.
For the code that comes from .NET (e.g. ComInterop), we should avoid changing it unless the original code in dotnet/runtime was also updated to use ArgumentException.ThrowIfNullOrEmpty.

@CarloToso I see you have a few pull requests that have been open for some time. In the case of this PR, although it is marked as Small , the changes cover multiple modules, so it may take reviewers some time to review and approve the changes. If you would like, I can use git cherry-pick to split your contribution (preserving attribution).

@CarloToso I could also document which changes are affected by the PowerShell breaking changes contract.

@xtqqczze Thank you very much, I'll gladly accept your help 😄

For Microsoft.Management.UI.Internal, we ship it and own the code, so I think it's OK to make changes to it. But

for code that we don't build/ship (e.g. ScheduledJob, LocalAccounts), we should avoid changing it.
for the code that came from .NET (e.g. ComInterop), we should avoid changing it unless the original code in dotnet/runtime was also updated to use ArgumentException.ThrowIfNullOrEmpty.

Also WinRM code. Very sensitive.

source: gharchive/pull-request

authors: CarloToso daxian-dbw iSazonov xtqqczze


text:
Improve path completion

PR Summary
Refactor of the file path completion code to make it faster and prepare it for some future improvements I have planned (Not replacing variables in input text, user options for controlling sorting behavior and more).
Speed improvements for relative paths are pretty big:
cd C:\windows\System32\
Measure-Command -Expression {TabExpansion2 -inputScript .\}

old: 1.99 seconds
new: 199 ms
Similar improvements are seen in other providers:
cd HKCU:\SOFTWARE\Classes\
Measure-Command -Expression {TabExpansion2 -inputScript .\}

Old: 1.60 seconds
new: 139 ms
Also stopped it from replacing ~ when referring to home so this: ~\Downloads<Tab> no longer turns into: C:\Users\Martin\Downloads\

PR Context
Fixes https://github.com/PowerShell/PowerShell/issues/4797
Contributes to: https://github.com/PowerShell/PowerShell/issues/5350

PR Checklist

[X] PR has a meaningful title

Use the present tense and imperative mood when describing your changes

[X] Summarized changes
[X] Make sure all .h, .cpp, .cs, .ps1 and .psm1 files have the correct copyright header
[X] This PR is ready to merge and is not Work in Progress.

If the PR is work in progress, please add the prefix WIP: or [ WIP ] to the beginning of the title (the WIP bot will keep its status check at Pending while the prefix is present) and remove the prefix when the PR is ready.

Breaking changes

[X] None
OR
[ ] Experimental feature(s) needed

[ ] Experimental feature name(s):

User-facing changes

[X] Not Applicable
OR
[ ] Documentation needed

[ ] Issue filed:

Testing - New and feature

[ ] N/A or can only be tested interactively
OR
[X] Make sure you've added a new test if existing tests do not effectively test the code changed

Tooling

[X] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted.
OR
[ ] I have considered the user experience from a tooling perspective and opened an issue in the relevant tool repository. This may include:

[ ] Impact on PowerShell Editor Services which is used in the PowerShell extension for VSCode
(which runs in a different PS Host).

[ ] Issue filed:

[ ] Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features.

[ ] Issue filed:

[ ] Impact on PSScriptAnalyzer (which provides linting & formatting in the editor extensions).

[ ] Issue filed:

[ ] Impact on EditorSyntax (which provides syntax highlighting with in VSCode, GitHub, and many other editors).

[ ] Issue filed:

@MartinGC94   Thanks for you contribution!

Also stopped it from replacing ~ when referring to home so this: ~\Downloads no longer turns into: C:\Users\Martin\Downloads\

This is an unfortunate change. It's broken me a lot because those tildes not being replaced means that applications no longer understand paths with it in it. I got a suggestion to use Enable-ExperimentalFeature PSNativePSPathResolution but that is apparently no longer an option.
Is there a way for me to turn this back on? I'm getting super tired of having to retype C:\Users\bradwilson. 😢

@bradwilson Please open new issue to discuss your scenario(s).

authors: MartinGC94 PaulHigin bradwilson iSazonov


text:
Request: Vault Extension Module Path Should be VaultName.SecretManagementExtension

@PaulHigin Great job on the thorough blog posts, it's most helpful.
I think that we should support module authors to be able to have a Secret Management Extension as part of their original module rather than having to spin it off as a separate module, similar to how DSC resources can exist in the same module as the main implementing module. This will reduce the proliferation of modules that have to be downloaded and simplify developers not needing to maintain multiple repositories.
However, the existing VaultName.Extension nomenclature is too vague for this use case. Someone coming across the repository will not know this is specially a implementation of a secret vault, so the path should also support something more specific, such as VaultName.SecretManagementExtension or VaultName.SecretManagementVault or something to clearly denote the code is for the secretmanagement vault extension implementation, since this is hardcoded and not configurable.
Example
For a module named KeePass that implements a vault, the folder structure should allow for KeePass.SecretManagementExtension  subfolder, then the user has a very simply starting flow:
Install-Module KeePass #Also gets the regular powershell keepass commands
Register-SecretVault MyKeepass -Module Keepass
#etc...

Recommended Alternative
Consider a new PSData attribute in the psd1 to specify the path or name where the secret vault is located. This would have the additonal benefit to make them far more discoverable, for example something like Get-SecretVault -ListAvailable could search the modules and find which ones have the SecretManagementVault psdata attribute and return a list.

Thanks @JustinGrote do you know of any other module patterns that use .Extension?
We like the idea of having the submodule name in the PSData but arent sure if it is worth making the breaking change for...would love more input from the community on this one--thanks!

@SydneyhSmith not currently so it's not a breaking change but it doesn't hurt to be explicit.

Changing the required extension vault name would be a breaking change, and all vault authors would have to update their vault modules, and I would prefer not to allow alternative naming conventions as it seems unnecessary.  The current naming convention is enough to disambiguate different extension vault modules, and calls to extension vault functions.  So I am marking this as 'wont' fix' for now.

@PaulHigin @SydneyhSmith @joeyaiello @SteveL-MSFT  my only thought is that there may need to be a wider standard/recommendation on this. For instance, there are now going to be PSReadline intellisense extensions. What's that going to be? If I make a powershell module and I want to implement all of this, am I going to have a bunch of seemingly arbitrary folders in my source to implement them or are they going to have a nice nomenclature, e.g. MyModule.SecretManagementExtension and MyModule.PSReadlineExtension?

I think moving forward the extension directory name can be defined in the parent module manifest, private data field (as suggested by @SteveL-MSFT).  Any new extension module can use that and avoid the current SecretManagment hard coded naming convention.  In fact, SecretManagement can move to this model at any time and still be backward compatible to the hard coded naming.
But at this time, I don't see any problem with the current naming scheme for SecretManagement.

private data field (as suggested by @SteveL-MSFT)

😕

Sorry, I forgot you suggested it!  But I agree that is a better way to define the extension name.

authors: JustinGrote PaulHigin SydneyhSmith

repo: PowerShell/SecretManagement


text:
Sp result source

Pull Request (PR) description
BREAKING CHANGE: Allows Result Sources to be created at different scopes: SSA, SPSite or SPWeb
This Pull Request (PR) fixes the following issues

Fixes #918

Task list

[x] Added an entry under the Unreleased section of the change log in the CHANGELOG.md.
Entry should say what was changed, and how that affects users (if applicable).
[x] Resource documentation added/updated in README.md in the resource folder.
[x] Resource parameter descriptions added/updated in schema.mof
and comment-based help.
[x] Comment-based help added/updated.
[x] Localization strings added/updated in all localization files as appropriate.
[x] Examples appropriately added/updated.
[x] Unit tests added/updated. See DSC Resource Testing Guidelines.
[x] Integration tests added/updated (where possible). See DSC Resource Testing Guidelines.
[x] New/changed code adheres to DSC Resource Style Guidelines and Best Practices.

This change is

Codecov Report

Merging #930 into v3.0-development will decrease coverage by <1%.
The diff coverage is 93%.

@@               Coverage Diff                @@
##           v3.0-development    #930   +/-   ##
================================================
- Coverage                92%     92%   -1%
================================================
  Files                   111     111
  Lines                 10931   10928    -3
  Branches                  1       1
================================================
- Hits                  10091   10086    -5
- Misses                  839     841    +2
  Partials                  1       1

There are two issues in the schema:
[00:34:53]     Context MSFT_SPSearchResultSource
[00:34:53] Test-ParameterMetaDataIsDscResourceProperty : The ValidateSet item SPweb for property Scope in the schema was not found in the module.
[00:34:53] At C:\Users\appveyor\Documents\WindowsPowerShell\Modules\xDscResourceDesigner\xDSCResourceDesigner.psm1:1925 char:23
[00:34:53] + ...       -not (Test-ParameterMetaDataIsDscResourceProperty $GetParameter ...
[00:34:53] +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[00:34:53]     + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
[00:34:53]     + FullyQualifiedErrorId : SchemaModuleValidateSetItemError,Test-ParameterMetaDataIsDscResourceProperty
[00:34:53]
[00:34:53] Test-GetKeyRequiredMandatory : The function Get-TargetResource must take all Key and Required properties, and they must be mandatory. There was an issue with property Scope.
[00:34:53] At C:\Users\appveyor\Documents\WindowsPowerShell\Modules\xDscResourceDesigner\xDSCResourceDesigner.psm1:1878 char:36
[00:34:53] + ... ror = -not (Test-GetKeyRequiredMandatory $GetCommandInfo.Parameters ` ...
[00:34:53] +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[00:34:53]     + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
[00:34:53]     + FullyQualifiedErrorId : GetMissingKeyOrRequiredError,Test-GetKeyRequiredMandatory
[00:34:53]
[00:34:53] Test-ParameterMetaDataIsDscResourceProperty : The ValidateSet item SPweb for property Scope in the schema was not found in the module.
[00:34:53] At C:\Users\appveyor\Documents\WindowsPowerShell\Modules\xDscResourceDesigner\xDSCResourceDesigner.psm1:1974 char:23
[00:34:53] + ...       -not (Test-ParameterMetaDataIsDscResourceProperty $SetParameter ...
[00:34:53] +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[00:34:53]     + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
[00:34:53]     + FullyQualifiedErrorId : SchemaModuleValidateSetItemError,Test-ParameterMetaDataIsDscResourceProperty
[00:34:53]
[00:34:53] Test-SetHasExactlyAllNonReadProperties : The functions Set-TargetResource and Test-TargetResource must take all Key, Required and Write properties. There is an issue with the parameter Scope defined in the schema.
[00:34:53] At C:\Users\appveyor\Documents\WindowsPowerShell\Modules\xDscResourceDesigner\xDSCResourceDesigner.psm1:1884 char:34
[00:34:53] + ... rror = -not (Test-SetHasExactlyAllNonReadProperties $SetCommandInfo `
[00:34:53] +                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[00:34:53]     + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
[00:34:53]     + FullyQualifiedErrorId : SetAndTestMissingParameterError,Test-SetHasExactlyAllNonReadProperties
[00:34:53]
[00:34:53]       [-] Should pass Test-xDscResource 305ms
[00:34:53]         Expected $true, but got $false.
[00:34:53]         382:                 Test-xDscResource -Name $scriptResourcePath | Should -Be $true
[00:34:53]         at <ScriptBlock>, C:\projects\sharepointdsc\Modules\SharePointDsc\DSCResource.Tests\Meta.Tests.ps1: line 382

and
[00:40:36]       [-] Should compile MOFs for example correctly 533ms
[00:40:36]         Expected no exception to be thrown, but an exception "At C:\projects\sharepointdsc\Modules\SharePointDsc\Examples\Resources\SPSearchResultSource\1-Example.ps1:16 char:13
[00:40:36]         +             SPSearchResultSource RemoteSharePointFarm
[00:40:36]         +             ~~~~~~~~~~~~~~~~~~~~
[00:40:36]         Undefined DSC resource 'SPSearchResultSource'. Use Import-DSCResource to import the resource." was thrown from C:\projects\sharepointdsc\Modules\SharePointDsc\Examples\Resources\SPSearchResultSource\1-Example.ps1:16 char:13
[00:40:36]             +             SPSearchResultSource RemoteSharePointFarm
[00:40:36]             +             ~~~~~~~~~~~~~~~~~~~~.
[00:40:36]         751:                     } | Should -Not -Throw
[00:40:36]         at <ScriptBlock>, C:\projects\sharepointdsc\Modules\SharePointDsc\DSCResource.Tests\Meta.Tests.ps1: line 614

I somehow pushed the changes to the Schema Mof, but appveyor isn't kicking in...

Closing and reopening to start AppVeyor

The tests are throwing the following errors:
ImportCimAndScriptKeywordsFromModule : Cim deserializer threw an error when deserializing file
C:\Windows\system32\WindowsPowerShell\v1.0\Modules\SharePointDsc\DSCResources\MSFT_SPSearchResultSource\MSFT_SPSearchResultSource.Schema.mof.
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration\PSDesiredStateConfiguration.psm1:2120 char:50
+ ... dResource = ImportCimAndScriptKeywordsFromModule -Module $mod -Resour ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], PSInvalidOperationException
    + FullyQualifiedErrorId : System.Management.Automation.PSInvalidOperationException,ImportCimAndScriptKeywordsFromModule

ImportCimAndScriptKeywordsFromModule : Syntax error:
 At line:5, char:191
 Buffer:
","SPWeb"}] String Scope^;
    [

I remember from the past that the name scope cannot be used as parameter name. I ran into the same issue with SPDesignerSettings and had to use another name to get around the issue.

And please update from the v3.0 branch, since I just merged your other PR

Are you trying to update the v3.0-development branch with all changes from dev? I am trying to do that as well, but this took longer and turned out to be more work than I expected, but am almost there ;-)

Now that you already started, please go ahead and finish this one up. We can go from there.

Since I was already done, I just submitted a PR with the merge of dev and v3.0-dev. Can you review this, so you can do a pull to this branch afterwards?

Ok, ready for a pull from v3.0-development......I guess "Good luck" is in order here ;-)

Knocking on wood with my fingers crossed :)

Does this PR also solve issue 920?

Please check some of the changed files, some of them still have "<<<<<<<HEAD" lines in them.

Please ignore this PR for the moment, I still have a few conflicts to iron out. I will let you know when it is ready for review. Thanks

@ykuijs all yours to review and merge, sorry I was off sick for the past few days and couldn't fix my tests.

I have caused the failing test.....just submitted a PR that should fix the issue

Merged my PR. If you update your branch, the tests should work fine.

authors: NikCharlebois codecov-io ykuijs

repo: PowerShell/SharePointDsc


text:
xVMHyperV - EnableGuestService does not work localized OS

The EnableGuestService option in xVMHyperV doesn't work in localized OS (non-EN), as the name 'Guest Service Interface' does not exist.
MSFT_xVMHyper.psm1 uses *-VMIntegrationService Cmdlets with the -Name Parameter
(e.g. Line 94
EnableGuestService = ($vmobj | Get-VMIntegrationService -Name 'Guest Service Interface').Enabled).
Unfortunately Microsoft localized the integration service names, like 'Gastdienstschnittstelle' in german, instead of 'Gues Service Interface'. Therefore checking and setting the Guest Service status fails on non-EN systems.
In my opinion, there are two ways to identify the Guest Service without its name.

TypeName: Every guest service has its own object type. Guest Service Interface is [Microsoft.HyperV.PowerShell.GuestServiceInterfaceComponent]
Id: Every guest service has an unique Id. In the object the id looks like 'Microsoft:\6C09BB55-D683-4DA0-8931-C9BF705F6480'. This could be matched with a Regex like  "Microsoft:[0-9A-Fa-f]{8}[-][0-9A-Fa-f]{4}[-][0-9A-Fa-f]{4}[-][0-9A-Fa-f]{4}[-][0-9A-Fa-f]{12}\6C09BB55-D683-4DA0-8931-C9BF705F6480"

I tried to fix the issue here: https://github.com/vrdse/xHyper-V/blob/dev/DSCResources/MSFT_xVMHyperV/MSFT_xVMHyperV.psm1
However, the Pester test now fails and I'm not shure why or how to fix. Any help is appreciated.

Reopened to track #100 This is a release blocker until merged.

authors: bgelens vrdse

repo: PowerShell/xHyper-V


text:
Converted Pester tests to V4 - Fixes #120

Pull Request (PR) description
Update all tests to support Pester V4 standard.
This Pull Request (PR) fixes the following issues:
Fixes #120
Task list:

[x] Change details added to Unreleased section of CHANGELOG.md?
[ ] Added/updated documentation, comment-based help and descriptions in .schema.mof files where appropriate?
[ ] Examples appropriately updated?
[ ] New/changed code adheres to Style Guidelines?
[x] Unit and (optional) Integration tests created/updated where possible?

@Johlju - I have another one for you :grin: hopefully this one is easy as all I've done is update the pester tests to V4 using the script you pointed me to.

This change is

Codecov Report

Merging #125 into dev will not change coverage.
The diff coverage is n/a.

@@        Coverage Diff         @@
##           dev   #125   +/-   ##
==================================
  Coverage   94%    94%
==================================
  Files        5      5
  Lines      671    671
==================================
  Hits       636    636
  Misses      35     35

This one was easy :) Just one minor comment.

Reviewed 14 of 14 files at r1.
Review status: all files reviewed at latest revision, 1 unresolved discussion.

Tests/Integration/MSFT_xDiskAccessPath.Integration.Tests.ps1, line 82 at r1 (raw file):

throw

Throw (upper 'T'). Throughout.

Comments from Reviewable

Thanks @Johlju - all fixed!

Review status: 13 of 14 files reviewed at latest revision, 1 unresolved discussion.

Tests/Integration/MSFT_xDiskAccessPath.Integration.Tests.ps1, line 82 at r1 (raw file):
Previously, johlju (Johan Ljunggren) wrote…

throw

Throw (upper 'T'). Throughout.

Done.

Comments from Reviewable

Reviewed 11 of 11 files at r2.
Review status: all files reviewed at latest revision, all discussions resolved.

Comments from Reviewable

authors: PlagueHO codecov-io johlju

repo: PowerShell/xStorage


text:
Implement & link ac_windmill

Adding in ac_windmill

I think clang format isn't enforced here. Some functions seem to have 4 spaces (correct for our clang format settings), and others seem to have 2 spaces. Mind fixing that?

repo: Prakxo/ac-decomp


text:
Test actions setup

:)

:)

:)

asdfasdf
123123

asdfasdf
123123

repo: Pranav-yadav/needs-attention


text:
Hide Packages & releases

Suggested to hide packages & releases if not being used in the project/repo

Okay sure I didn't knew this feature is there Thank you


text:
incorrect checked state of multi-select combobox

likely from using index as the :key prop, the checked state of the input is incorrect
https://user-images.githubusercontent.com/6098901/193132929-f7d13efc-2d43-481f-80fc-65b4db4fa5f3.mov

Unable to reproduce 👍🏻

authors: dylanbhughes stackoverfloweth

repo: PrefectHQ/prefect-design


text:
Cruft update

ran cruft update

I'll add a better landing page in a separate PR, i just want to build the docs right now

Ok that sounds good!

repo: PrefectHQ/prefect-kubernetes


text:
Enhancement: Adds display of deployment status

Summary
Adds display of deployment status to the DeploymentDetails and DeploymentsTable components.
Deployments are READY if they are actively polled for scheduled runs by a worker, agent, or runner. Deployments are NOT_READY if they are not actively being polled.
Screenshots
Deployment details

Deployment table

Holding off on merging until deployment status API changes are in prod.

repo: PrefectHQ/prefect-ui-library


text:
Update Mailbox_Guard_Sensor_MQTT_Auto_Discovery.ino

This file is for auto discovery

Thanks!!

repo: PricelessToolkit/MailBoxGuard


text:
Simplify model repr methods

Refactors repr methods for models across the app to make them shorter and more readable and usable for debugging.

Codecov Report

Merging #317 into develop will decrease coverage by <.01%.
The diff coverage is 100%.

@@             Coverage Diff             @@
##           develop     #317      +/-   ##
===========================================
- Coverage    98.97%   98.97%   -0.01%
===========================================
  Files          146      146
  Lines         7105     7088      -17
  Branches        16       16
===========================================
- Hits          7032     7015      -17
  Misses          73       73

had one suggestion that affects how all the tests are written, but otherwise this is great. I think the use of ?? for no pk is succinct and much clearer than N/A or something else.

Can't take credit for the ??, pretty sure I borrowed it from somewhere else (django code maybe?), but glad you find this readable.

authors: codecov-io rlskoeser

repo: Princeton-CDH/mep-django


text:
Single quotes(') are translated into double quotes(")

my input's value need to be translated into json, like this  value='{ "pages": 20, "items": 199}'.
but prism translated the single into double , and the input wasn't rendered.

Hi. Please provide on online example reproducing your issue.

authors: Golmote ruanjiayou

repo: PrismJS/prism


text:
PrismJS is not rendering Eiffel correctly in one particular instance

Generally I find PrismJS works well for Eiffel but I am having trouble with one particular class called EL_ZSTRING. See this web page: http://www.eiffel-loop.com/library/base/text/string/zstring/el_zstring.html
The syntax highlighting starts to fail at the line:
item alias "[]", at alias "@" (i: INTEGER): CHARACTER_32 assign put

This is a rather important class in my libraries so I would appreciate to have the syntax highlighting working. I suspect it might have something to do with the alias string
"[]"

This is because this construct also indicates an unescaped string similar to the way a triple quote works in Python. For example
xml: STRING = "[
   <?xml version="1.0" encoding="utf-8">
   <empty/>
]"

Unfortunately there is no version information in the Prism code.

Many thanks for the fix.
BTW, I would like to offer a suggestion. The most popular Eiffel IDE (EiffelStudio) highlights Eiffel class names with the color blue. Screenshot If PrismJS could do the same it would be fantastic. This should be relatively easy to achieve as any identifier consisting of all upper case letters can be assumed to be a class name. This is a universal naming convention in the Eiffel community.

Sounds good. Could you open a new issue for this?

Done!

authors: Golmote finnianr


text:
Extra line added with line-numbers

When I have line-numbers added to my code block I always end up with an extra line:

Any way to get rid of it?

And strangely line-numbers load for language-php but not language-css or language-markup

Never mind, I realized I had an outdated version of Prism, I updated and everything works now.


text:
[WIP] Implement test suite runner

This is a WIP, please don't merge it yet
I finally got around on implementing a simple (?) test suite runner. For now, the test suite runs in node, so just the language definitions will be tested, not the integration with the browser. We won't catch things like unsupported methods in old browser for now. (So, if your language definition uses [].forEach the test suite will pass (as node supports this), but IEold will fail as the method is unsupported there.)
Test case location
All tests are located in /tests/languages/${language}/${file}. ${language} must match the name of the language definition in components.js. ${file} is just a file name and only used to provide an info to the test runner.
So if the directory looks like this:
.
└── languages
    ├── css
    │   └── blabla.css
    └── javascript
        └── testcase1.js

your output will look like this:

As you can see the file name doesn't matter, it is only included in the test description (that you can quickly find your failing tests).
Test case specification
Please provide feedback / better ideas than mine here.
An example test case file looks like this:
var a = 5;

--------

[
	["keyword", "var"],
	["operator", "="],
	["number", "5"],
	["punctuation", ";"]
]

It consists of
... language snippet...

/^----*\w*$/m                        <-- yep, thats the exact regex that splits the test case file

... JSON of expected token stream ...

Please consider that the test case specification does use some simplifications / expectations. I tried to find a well enough mix of "too much magic" and "way too much to write and manage". Please be lenient with me here.

The expected token stream is not an array of objects (like the result of Prism.tokenize()), but it is an array of two-element arrays. The only reason to do this is to reduce the amount of text you need to write for a test case.
Only token.type and token.content are compared, something like token.alias is just ignored.
The JSON part must be valid JSON. Although a little bit uncomfortable, this is my take against reinventing the wheel.
If the test case file can't be properly parsed (the split produces more or less that two parts) the test case is failed.
All non-matched parts (strings in the compiled token stream) are simply ignored.
An entry in the expected token stream consists of [${type}, ${content}]
The Prism test instances are isolated.

Implemention
The implemention looks like this:

Load the complete test suite (= a nested array of all test case files).
Define the test for all tests.
Run the tests using mocha, chai and an isolated Prism instance.

As the language definitions (and Prism itself) doesn't use proper encapsulation (Prism is a global singleton), some hoop-jumping is required for this work: we need to run the source code in a vm in node (natively supported in require("vm"), docs) and pass the context manually in their. This way we can build completely fresh and isolated Prism instances for each test (so that they won't interfere with each other).
This kills performance but as we can't just use new Prism(), this is required for ensuring that the tests run in isolation (even different tests in the same language should ideally use different instances – as they currently do).
This is not exactly ideal for performance... but let's write tests and worry about testing performance later! :tada:
ToDo

[x] test it / review it
[x] discuss the test case file format
[ ] write tests for the languages (PRs welcome :sunglasses:)
[ ] add travis integration
[ ] write documentation explaining the testing procedure

Intended to replace/refresh #355

I'll definitely try to take a look at this soon! Hopefully this weekend

I finally found some time to pull your branch to test it, although a week later than I thought. Sorry about that.
I'm currently having some troubles making it work... (weird error... I'm trying to update node.js right now)
I reviewed your code in the meantime, though, and I must say that I like the way you implemented it. The code is clean and straightforward. Well done!
I also realised it was meant to run only one test per file. Wouldn't it be useful to write several tests in a single file. Like for example, a test file that tests for strings highlighting might need to check single and double quotes. Using two files for this feels strange to me. I would have think of one file per pattern or something like that. What do you think?
Also, I'd like the test files to be suffixed with some extension (like .test?) (and we could remove that extension when displaying the filename in the test results) so that my IDE stops complaining about syntax errors:

Wow, it took me so much time to understand the testing is supposed to be done with the command npm test. ><
Regarding what I said earlier about the "only one test per file is not enough" stuff, I realised that multiple tests could actually be run simply by merging them into one...
"test"
'test'
"te\"st"
'te\'st'

----------------------------------------------------

[
	["string", "\"test\""],
	["string", "'test'"],
	["string", "\"te\\\"st\""],
	["string", "'te\\'st'"]
]

so I guess this is not really an issue.

I also realised it was meant to run only one test per file. Wouldn't it be useful to write several tests in a single file.

As you already mentioned you can just make the test case longer so that it tests multiple cases. We just need to find a balance between small and self-contained test cases and a myriad of too small test cases.
But I guess grouping them by topic (like "all string variants") might work well. We can also adopt the naming scheme from the PHP core test suite ("bug453.phpt") to directly guard against specific regressions (and add a hint on why a specific test case exists and what it should guard against).

Also, I'd like the test files to be suffixed with some extension (like .test?)

I also thought about the issue with broken syntax highlighting and have no real answer. Splitting the test and the expected result into two files is not a good idea so we won't find something that doesn't break syntax highlighting and in the same time works with a lot of different languages. So using a "neutral" file extension is probably the best way.

(and we could remove that extension when displaying the filename in the test results)

That is a good idea, I will add that.

Another thought: should we also add the possibility to optionally add another section for a comment to a test case? Might be good for self-documenting the test case?
Something like this:
"test"
'test'
"te\"st"
'te\'st'

----------------------------------------------------

[
    ["string", "\"test\""],
    ["string", "'test'"],
    ["string", "\"te\\\"st\""],
    ["string", "'te\\'st'"]
]

----------------------------------------------------

This is a test for testing all possible string variants.
It also checks for escaped delimiters inside the strings.

See #588 for related info.

(still open for suggestions about the test case file layout)

I like the idea of the comment part. The test case file layout looks fine to me. It is both easy to create and easy to read.
I kinda like the Phpt tests naming convention:

Phpt tests follow a very strict naming convention. This is done to easily identify what each phpt test is for. Tests should be named according to the following list:
Tests for bugs
    bug<bugid>.phpt (bug17123.phpt)
Tests for a function's basic behaviour
    <functionname>_basic.phpt (dba_open_basic.phpt)
Tests for a function's error behaviour
    <functionname>_error.phpt (dba_open_error.phpt)
Tests for variations in a function's behaviour
    <functionname>_variation.phpt (dba_open_variation.phpt)
General tests for extensions
    <extname><no>.phpt (dba_003.phpt)

It could be simplified for Prism like this, for example:

Tests for issues: issue<issueid> (issue590)
Tests for features: <featurename>_feature (string_feature, string_interpolation_feature)
Tests for specific usages: <usagename>_usage (css_in_markup_usage) (I can't think of anything but language inclusion that could fit in this last category... so maybe the name is not well chosen...)

BTW, is it possible to test language inclusion inside another? It requires both components to be loaded, even if they aren't dependent one from the other... Maybe the test case file layout could indicate another component is required?
Also, do we need to write tests for known failures too? Those would be tests that we expect to fail, so that we will know if some change fixes them?

I just pushed comment support:

I just use the message parameter from chai.
I just pushed the requirement for all test cases to have the .test file extension:
This should both prevent highlighting issues in common IDEs as well as preventing the test runner to choke on non test-related files like .DS_Store or Thumbs.db.
Also the file extension is now hidden in the test description (you can see that in the screenshot above).

I just pushed support for language inclusion / language integration tests
By using composed language names like javascript+css or markup+php both languages will be loaded. This way you can test whether two languages interact nicely with each other and more importantly you can test language inclusions.
The first language (javascript for javascript+css) will be passed to Prism for highlighting, but the additional languages will be loaded, too. (For that I extended the language loader as it now needs to keep track on the already loaded languages, so that it doesn't load languages twice (so for bash+javascript the clike requirement will only be loaded once, etc…)).

If the implementation looks good, I would write some documentation. As soon as the docs are finished, this is ready for merging.

Thanks for all those updates! This looks good to me. @LeaVerou, did you have time to take a look at this PR? What do you think of it?

Thank you both! Looks good to me from a quick look.

Great! :) Then, @apfelbox, tell us when the PR is ready for merging.

@Golmote all right. I am currently moving (as in moving to another apartment) but may get some free time next week.

@apfelbox: I ran into an issue related to language inclusion with the "lang1+lang2" feature.
There are cases in our grammars where the secondary language needs to be loaded before the primary language (see XML inside ActionScript, filters in HAML, filters in Jade...)
Actually, it seems that CSS and JS are the only exceptions here: they modify another grammar to add themselves into it.
IMO, this is not the right way to do it. Currently, the CSS component adds itself inside Markup if it is available. I think it should be the opposite: Markup should add CSS inclusion if available, because it's much easier to know which languages can be embedded inside another, than to know which are the other languages a language can be embedded into. (I hope the previous sentence makes some sense...) What's your opinion on this, @LeaVerou?

If we want to keep both ways of doing this, then we need a way to specify the main language to use in the test, that is not related to the order of the languages in the folder name.
Maybe something like markup+!actionscript? (Markup should be loaded before ActionScript, but the latter is actually the main language to be used for highlighting)

@apfelbox

5 . All non-matched parts (strings in the compiled token stream) are simply ignored.

This might be an issue for patterns using the inside feature.
Consider the following test, that checks for strings in the apacheconf component.
"foo bar"
'foo bar'
"%{REMOTE_HOST}"

Because the string pattern has an inside key to match variables, the simplified token streams produced by this test are:
[
	["string", []],
	["string", []],
	["string", [
		["variable", "%{REMOTE_HOST}"]
	]]
]

The first two are quite useless, don't you think?

Actually, it seems that CSS and JS are the only exceptions here: they modify another grammar to add themselves into it.

I think we should change that. We should unify the way languages extend each other.
(This would be a BC break, hover, as you need to reorder these language definitions.)

Because the string pattern has an inside key to match variables, the simplified token streams produced by this test are:

No, the simplified token stream would look like this:
[
["string", [""foo bar""]]
["string", ["'foo bar'"]]
...
]
As the strings are not empty.
My description is misleading.

All non-matched parts (strings in the compiled token stream) are simply ignored.

Strings is meant here as generic character lists instead of the token string.
If you have a language that only matches "a" and you highlight the text:
a b a

The you would get
[
["my-token", "a"]
(b is unknown and therefore ignored – that is what is meant with 5.)
["my-token", "a"]
]
Does this clear things up?

No, the simplified token stream would look like this:
[
    ["string", ["\"foo bar\""]]
    ["string", ["'foo bar'"]]
    ...
]

Are you sure about this? Because I don't reproduce this behaviour with your current code...
With the following pattern in the grammar (here apacheconf):
'string': {
	pattern: /("|').*\1/,
	inside: {
		'variable': /(\$|%)\{?(\w\.?(\+|\-|:)?)+\}?/
	}
},

and the following test:
"foobar"
----------
[
	["string", ["foobar"]]
]
----------

Here is the result I get:
  1) Testing language 'apacheconf' - should pass test case 'test':

      AssertionError: expected [ [ 'string', [ 'foobar' ] ] ] to deeply equal [ [ 'string', [] ] ]
      + expected - actual

       [
         [
           "string"
      -    [
      -      "foobar"
      -    ]
      +    []
         ]
       ]

Actually, it seems that CSS and JS are the only exceptions here: they modify another grammar to add themselves into it.

I think we should change that. We should unify the way languages extend each other.
(This would be a BC break, hover, as you need to reorder these language definitions.)

@LeaVerou Would you be okay with this? (moving CSS inclusion and JS inclusion into the Markup component)

Are you sure about this? Because I don't reproduce this behaviour with your current code...

The current code produces the token stream as defined above, the empty array comes from your recursive implementation (it doesn't correctly handle arrays). I have just pushed an implementation for support of nested token streams, which should handle the case quite well.
I also updated the apacheconf test case (it is now passing), so that you can see how the expected token stream looks like.

Ok, thank you for the updates!
I'm still a bit confused with the behaviour regarding those strings that are filtered.
Compare those two test, that both pass with the current implementation:

CSS only

foo {
	bar: baz;
}
--------
[
	["selector", "foo"],
	["punctuation", "{"],
	["property", "bar"],
	["punctuation", ":"],
	["punctuation", ";"],
	["punctuation", "}"]
]
--------
Simple CSS test.

CSS embedded into Markup

<style type="text/css">
foo {
	bar: baz;
}
</style>
--------
[
	["style", [
		["tag", [
			["tag", [
				["punctuation", "<"],
				"style"
			]],
			" ",
			["attr-name", [
				"type"
			]],
			["attr-value", [
				["punctuation", "="],
				["punctuation", "\""],
				"text/css",
				["punctuation", "\""]
			]],
			["punctuation", ">"]
		]],
		"\r\n",

		["selector", "foo"],
		" ",
		["punctuation", "{"],
		"\r\n\t",
		["property", "bar"],
		["punctuation", ":"],
		" baz",
		["punctuation", ";"],
		"\r\n",
		["punctuation", "}"],

		"\r\n",
		["tag", [
			["tag", [
				["punctuation", "</"],
				"style"
			]],
			["punctuation", ">"]
		]]
	]]
]
--------
Simple CSS embedded into Markup test.

Notice how the strings (inside the CSS part) are handled differently depending on whether they appear at the first level or in an inside clause.
Should we filter the strings at all?

Should we filter the strings at all?

We could include them. But I would remove all strings, that just include whitespace, like "\r\n" and "\r\n\t".

Sounds good to me.

I just pushed some updates.
I think I got it all – I even managed to reduce code complexity a bit.
If you want to learn the details about the token stream transformation you can check the newly created test file testrunner-tests.js (as we are at a point where we should test our test runner).

I think you forgot the filter the blank strings (that just contain whitespaces) you were talking about.
Also, since we don't hear from @LeaVerou regarding the BC breaking change for language inclusions, would you mind allowing both behaviours for now? i.e. we need to assume the main language is the last one listed, because this is the most common case, and we need a way to override this behaviour for the CSS and JS components (I suggested tagging the main language with some character like "!" but any solution would do).

Also, I think your example testcase1.test does not pass right now, since the variable name " a " is missing in the JSON.

Oh, and one last thing, since you commited about quote style consistency, I noticed you are not consistent in the position of the curly braces (sometimes at the end of the line, sometimes on their own line)? ^^ Prism mostly uses braces at the end of the line.

@Golmote sorry for the delay. All done.

Just added travis support. You can see the result of the travis build of my fork here: https://travis-ci.org/apfelbox/prism

And I finally pushed a documentation page, explaining the test runner, test suite and everything in it (I am no native speaker, so please correct me if anything doesn't make sense :wink: ).

This is now ready to be merged :shipit:

A final note:

We could probably move the prism loader to a separate helper directory, outside of /tests/ as this seems to be useful for multiple use cases and not just tests.

What do you think?

It might be useful indeed, but maybe we can wait for an actual use case. ^^
I'll merge the PR during next week, as I'm still away from home right now. I already wrote a bunch of tests for a few components, so I will also submit PRs for them.

Here we go! :)

:tada: thanks

authors: Golmote LeaVerou apfelbox


text:
Merge pull request #4 from PriyanjanaGit/feature1

Merge pull request #3 from PriyanjanaGit/main

done


text:
Shooting-bird-game

#123

that  is how its looks like...
Now you can merge this issue

also fix that problem...

@shahil-afroz  conflicts are there