aaronengels / DattoRMM

A PowerShell module that connects to the Datto RMM API
GNU General Public License v3.0
64 stars 23 forks source link

Global Arguments #1

Closed Michu44 closed 3 years ago

Michu44 commented 4 years ago

Hi @aaronengels

I've been running into the following problem:

When you use a different names for the global Arguments, these are not correctly passed down to the functions.

# Enter API Url and API keys
$dattoApiUrl            =   '<url>'
$dattoApiKey            =   '<key>'
$dattoApiSecretKey      =   '<secretKey>'

Import-Module DattoRMM -ArgumentList $dattoApiUrl, $dattoApiKey, $dattoApiSecretKey 

Maybe if I find the time, I can fix this issue, and create a pull-request. Thanks for your work with the library!

Best Michael

aaronengels commented 4 years ago

Hi Michael,

Yes, I guess I was a bit lazy, I'm also new to PowerShell. Any improvements or suggestions are more than welcome, which are plenty to make. I'm thinking of adding logging and better error handling next.

Thanks for trying out the module and providing feedback!

Aaron

Michu44 commented 4 years ago

Hi Aaron,

Logging and Error handling would be awesome too! The codebase that you started is already quite neat.

Hope I can help further.

Thanks Michael

aaronengels commented 4 years ago

I have removed the global variables. It should now work passing local vars to the module. Thanks for the suggestion!

KelvinTegelaar commented 3 years ago

resolved, closing :)