小编Sam*_*lib的帖子

combineLatest弃用了静态combineLatest

使用后运行rxjs迁移工具

rxjs-5-to-6-migrate -p src/tsconfig.app.json

我现在得到一个linting错误:

combineLatest已弃用:不赞成使用static combineLatest.

在运行迁移命令之前,这是我的代码:

this.store.combineLatest(
        this.store.select(lang.getCurrent),
        this.store.select(lang.getCurrentLocale)
    ).subscribe(([state, currentLang, locale]) => {
        this._language = session.language === currentLang ? '' : currentLang;
        this._locale = session.locale === locale ? '' : locale;
    });
Run Code Online (Sandbox Code Playgroud)

运行迁移命令后的代码:(当前显示linting错误)

import {map, combineLatest} from 'rxjs/operators';
this.store.combineLatest(
        this.store.select(lang.getCurrent),
        this.store.select(lang.getCurrentLocale)
    ).subscribe(([state, currentLang, locale]) => {
        this._language = session.language === currentLang ? '' : currentLang;
        this._locale = session.locale === locale ? '' : locale;
    });
Run Code Online (Sandbox Code Playgroud)

问题在这个stackoverflow问题中被问到,但它不够具体:Angular 6 ng lint重复错误和警告,combineLatest已被弃用 .

rxjs rxjs6

32
推荐指数
4
解决办法
2万
查看次数

Win2012 r2上的New-SelfSignedCertificate具有较少的参数

我正在尝试使用特定的加密参数值创建自签名证书.

在运行PowerShell 5.0的Win Server 2012 r2标准上,当我尝试使用时

New-SelfSignedCertificate
Run Code Online (Sandbox Code Playgroud)

我收到一个错误:

New-SelfSignedCertificate:找不到与参数名称"Subject"匹配的参数.

当我尝试使用该-Subject参数时,除了我的笔记本电脑上允许的其他参数之外,该参数不会出现在intellisense中.

但是在我的笔记本电脑上(Win 10和PowerShell 5.0),我可以使用这些参数,并使用以下代码创建自签名证书

#create a Certificate
# OID for document encryption
    $Oid = New-Object System.Security.Cryptography.Oid "1.3.6.1.4.1.311.80.1"
    $oidCollection = New-Object System.Security.Cryptography.OidCollection
    $oidCollection.Add($oid) > $Null
# Create enhanced key usage extension that allows document encryption
$Ext = New-Object System.Security.Cryptography.X509Certificates.X509EnhancedKeyUsageExtension $oidCollection, $true 

$myCert = New-SelfSignedCertificate -Subject 'CN=myservernameasubject' -CertStoreLocation "Cert:\LocalMachine\My" -KeySpec KeyExchange -KeyUsage KeyEncipherment, DataEncipherment -Extension $Ext
Run Code Online (Sandbox Code Playgroud)

powershell certificate self-signed powershell-5.0

8
推荐指数
1
解决办法
1万
查看次数