Giter Site home page Giter Site logo

Comments (5)

RamblingCookieMonster avatar RamblingCookieMonster commented on August 18, 2024

Hiyo!

If you explicitly Import-Module PSSlack -WarningAction Ignore ahead of running that, you might avoid the warning. Completely agree, we'll look at moving the config file to $env:APPDATA similar to some other modules. Might be a little while, feel free to take a stab if you'd like!

Warren

from psslack.

jwhipp avatar jwhipp commented on August 18, 2024

I'm curious what the configuration file is for? In the examples it shows you can pass to it everything you need. Specifically, I wanted to use this in an AWS Lambda function but it fails with configuration file errors.

from psslack.

christamlyn-bridge avatar christamlyn-bridge commented on August 18, 2024

I'm also trying to use the module in a Lambda, is there a workaround?

from psslack.

RamblingCookieMonster avatar RamblingCookieMonster commented on August 18, 2024

config file doesn't make sense in a lambda context. Does importing with warningaction ignore not suffice?

fwiw - the intention of the config file is mostly for CLI-ish use - set your config once, and don't deal with it again.

from psslack.

jwhipp avatar jwhipp commented on August 18, 2024

@RamblingCookieMonster Sorry, hadn't had a chance to get back to this until today.

I tried using Import-Module PSSlack -WarningAction Ignore a head of attempting to send a slack message, still doesn't work. Appears writing the file is required:

START RequestId: 49ec9d63-4a23-4192-ba47-87e89ec2f74e Version: $LATEST
Importing module ./Modules/PSSlack/0.1.0/PSSlack.psd1
[Error] - Cannot bind argument to parameter 'Path' because it is null.
[Warning] - Did not find config file , attempting to create
[Warning] - Failed to create config file : Cannot bind argument to parameter 'Path' because it is null.
[Warning] - Error importing PSSlack config: Cannot bind argument to parameter 'Path' because it is null.

An exception was thrown when the constructor for type 'Slack_PS_Test.Bootstrap' was invoked. Check inner exception for more details.: LambdaException


   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean wrapExceptions, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& hasNoDefaultCtor)
   at System.RuntimeType.CreateInstanceDefaultCtorSlow(Boolean publicOnly, Boolean wrapExceptions, Boolean fillCache)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, Boolean wrapExceptions)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic, Boolean wrapExceptions)
   at System.Activator.CreateInstance(Type type)
Cannot bind argument to parameter 'Path' because it is null.: ParameterBindingValidationException
   at Amazon.Lambda.PowerShellHost.PowerShellFunctionHost..ctor()
   at Amazon.Lambda.PowerShellHost.PowerShellFunctionHost..ctor(String powerShellScriptFileName)
   at Slack_PS_Test.Bootstrap..ctor() in /tmp/slack-message/Bootstrap.cs:line 9


from psslack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.