小编Ran*_*Dom的帖子

如何在 powershell 数组中写入托管元素的单个属性?

我查询 Office365 以获取与Chris的 displayName 匹配的所有用户的列表。

我想提示用户他们想要选择哪个克里斯。这样做时,我有以下 for..each 代码

$tmpUserOffice = Get-MsolUser -SearchString "*Chris*"
if ($tmpUserOffice -is [array])
{
    if ($tmpUserOffice.Count -lt 50) {
        Write-Host "Many matching users in MSOL. Choose which one you want to save"    
        for ($i = 0; $i -lt $tmpUserOffice.Count; $i++) {
            Write-Host $i " "  $($tmpUserOffice[$i].DisplayName) 
        }   
        Write-Host $tmpUserOffice.Count " None of the above" 
        $chosen = Read-Host

        if ($chosen -eq $tmpUserOffice.Count) {
            Write-Warning "Nothing found. Try searching with different criteria or use wildcards"
            Write-Output $null …
Run Code Online (Sandbox Code Playgroud)

powershell write-host

3
推荐指数
1
解决办法
8215
查看次数

“Install-Module -name AzureAD”在使用 MacOSX 的 PS6 上失败并出现错误

我能够在 MacOSX 上安装 Powershell Core,现在我正在尝试从它管理 Azure AD 实例。

当我安装 AzureAD 模块时,出现以下错误

PS /Users/c> Install-Module -name AzureAD                                  

Untrusted repository
You are installing the modules from an untrusted repository. If you trust this 
repository, change its InstallationPolicy value by running the Set-PSRepository
 cmdlet. Are you sure you want to install the modules from 'PSGallery'?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help 
(default is "N"):y
PackageManagement\Install-Package : Unable to load DLL 'api-ms-win-core-sysinfo-l1-1-0.dll': The specified …
Run Code Online (Sandbox Code Playgroud)

macos azure azure-powershell azure-active-directory powershell-core

2
推荐指数
1
解决办法
5734
查看次数

如何使用 id-ecc 创建自签名证书以用于 ECDSA 签名和验证?

我正在尝试更新本文的代码,以允许我创建(和使用)基于 ECC 的自签名证书,并使用它进行基本的签名和验证( ECDSA)。

  • 有没有办法通过跨平台 .NET Core API 来完成此任务,或者是否需要 Win32 P/Invoke?

根据这篇文章,我需要使用the more standard id-ecc类型

cryptography public-key .net-core .net-4.6 self-signed-certificate

2
推荐指数
1
解决办法
1030
查看次数

如何获取 PSCustom 对象的长度?

以下存储在powershell中

#Maintainer Note: The leftmost parameter must match the registry key name exactly e.g. 'DES 56'
#For more information please check https://support.microsoft.com/en-us/kb/245030
$bannedCiphersJSON = @"
   {
    "RC4 128/128":{
        "IsPermitted":false,
        "AffectedCiphers":[
                        "SSL_RSA_WITH_RC4_128_MD5",
                        "SSL_RSA_WITH_RC4_128_SHA",
                        "TLS_RSA_WITH_RC4_128_MD5",
                        "TLS_RSA_WITH_RC4_128_SHA"
        ]
    },

    "Triple DES 168":{
        "IsPermitted":false,
        "AffectedCiphers":[
                        "SSL_RSA_WITH_3DES_EDE_CBC_SHA",
                        "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA" ,
                        "TLS_RSA_WITH_3DES_EDE_CBC_SHA" ,
                        "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA"
        ]
    },

    "RC4 56/128":{
        "IsPermitted":false,
        "AffectedCiphers":[
                        "TLS_RSA_EXPORT1024_WITH_RC4_56_SHA"
        ]
    },

    "DES 56":{
        "IsPermitted":false,
        "AffectedCiphers":[
                        "SSL_RSA_WITH_DES_CBC_SHA"
        ]
    },

    "RC4 40/128":{
        "IsPermitted":false,
        "AffectedCiphers":[
                        "SSL_RSA_EXPORT_WITH_RC4_40_MD5",
                        "TLS_RSA_EXPORT_WITH_RC4_40_MD5"
        ]
    },

    "RC2 40/128":{
        "IsPermitted":false,
        "AffectedCiphers":[
                        "SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5",
                        "TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5"
        ]
    },

    "MD5":{ …
Run Code Online (Sandbox Code Playgroud)

powershell json

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