函数参数 - 找不到参数的类型

时间:2018-03-25 23:47:24

标签: powershell

调用PowerShell函数时出现以下错误:

Cannot find the type for custom attribute 'paramater'. 
Make sure that the assembly that contains this type is loaded.

我之前遇到过这个错误,它是导致错误的函数中的间距,但这次似乎不一样,我已经浏览了一下并找不到修复。这是功能:

function fn_API-GetAll {
    param ( 
            [paramater(Mandatory=$true)]$API 
    )
    return (Invoke-RestMethod -Uri $API)
}

这是电话:

$coinMarketCap        = "https://api.coinmarketcap.com/v1/ticker/"
$coinMarketCap_Global = "https://api.coinmarketcap.com/v1/global/"

$fullAPI = fn_API-GetAll -API $coinMarketCap
$fullAPI

1 个答案:

答案 0 :(得分:0)

如Booga Roo在评论中所述,add拼不是.clone()

希望有所帮助