chelnak / OneTimeSecret

A PowerShell Module for OneTimeSecret.com
MIT License
10 stars 1 forks source link

PowerShell Gallery version doesnt appear to be the one on GH i.e. some parameters are set as mandatory #10

Closed NegativeZero000 closed 3 years ago

NegativeZero000 commented 4 years ago

I was making a module for OTS and found yours. I installed it and it looks like the version I am getting is expecting me to supply BaseUrl for Set-OTSAuthorizationToken when it should be optional. New-OTSSecret is similarly expecting a passphrase....

This just might be my ignorance but wanted to be sure. It seems like the one hosted on the Gallery is old and not the one I see here on the Hub

Steps to reproduce

Install-Module -Name OneTimeSecret
PS M:\Scripts> Set-OTSAuthorizationToken -Username $OTScredentials.username.split("\")[-1] -APIKey $OTScredentials.GetNetworkCredential().Password

Expected behavior

Authorization                                                                   BaseUrl
-------------                                                                   -------
bWNhbWVyb25AY2FuYWRpYW5ub3J0aC5jb206NG1NTQ2Yzk1YTM5NWIyMmFlYQ==                 https://onetimesecret.com/

Actual behavior

cmdlet Set-OTSAuthorizationToken at command pipeline position 1
Supply values for the following parameters:
BaseUrl:

Environment data

Name                           Value
----                           -----
PSVersion                      5.1.18362.752
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.18362.752
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Name              : OneTimeSecret
Path              : C:\Program Files\WindowsPowerShell\Modules\OneTimeSecret\2.2.0\OneTimeSecret.psm1
Description       : PowerShell Module for OneTimeSecret.com
ModuleType        : Script
Version           : 2.2.0
NestedModules     : {}
ExportedFunctions : {Get-OTSAuthorizationToken, Get-OTSRecentMetadata, Get-OTSSecret, Get-OTSSecretMetadata...}
ExportedCmdlets   :
ExportedVariables :
ExportedAliases   :
babak-dev commented 3 years ago

Hi,

I also faced the same issue, solution:

add https://onetimesecret.com/ as baseurl, to end of your command. -baseurl https://onetimesecret.com/

chelnak commented 3 years ago

I completely missed this. I'll look in to getting things aligned.

chelnak commented 3 years ago

This is now resolved in https://www.powershellgallery.com/packages/OneTimeSecret/2.2.1