Giter Site home page Giter Site logo

posh-tasklog's Introduction

Posh Tasklog

Powershell module to let me do very simple work logging.

Written in F# - because (-:

Commands

  • Start something - it needs a title
  • Stop - whatever it is I last started
  • Note something - assumed to be part of whatever it is I'm working, timestamp might be good, need option to not have timestamp (not sure what the default should be)

Plan

  1. Work through an example of an F# cmdlet
  2. Document Start-task functionality
  3. Document Stop-task functionality
  4. Document Add-TaskNote functionality
  5. Can I test with Pester ?? See Pester
    1. Yes if I can set up a test drive and use it as the target for my commands
    2. This also means that I need to understand $psdefaultparametervalues because if I'm requiring a target folder I don't want to have to type it every time
  6. Implement test functionality
    1. Create file if missing
    2. Don't create file if it already exists (file count should be unchanged, content should be persisted)
    3. Add title (same test, in both cases, its two tests)
    4. Add stop task, have to do this as a #end:HH:mm tag?
      1. Does not create a file if no file found
      2. Returns a warning if no file found
      3. Assumes there is an active task (for simplicity, may change later) so will always work
      4. Lets add an HR after, because...
    5. Add note capability, notes are plain text, so really simple
    6. Add note parameter to start
    7. Add note parameter to end (note should, for now, follow timestamp)
  7. Use verbs from library properly if you're not already
  8. Wrap it in a module, because this is generally "better"
  9. How can I publish for personal use? (Installable, updateable)
  10. More formatting or other hints to let me parse things after the fact 1.
  11. Some idiot proofing so that I get a sane log
    1. Can only end something that started
    2. Add the HR (separator) on start of next not end of current
  12. Reporting, of a sort
  13. Bonus projects:
    1. Can I wire it into teams calls, especially where someone calls me
    2. Can I create a teams both with the same logic (and ideally the same target via onedrive)
  14. Did I mention more structure/formatting? Something consistent with the todo list, that I also need to make work

Note to self...

Create Tasklog: as a PS Drive (in one's profile) in order to make life easier (ish)

Then set it as the default -TaskLogPath parameter because that really will make life easier (c.f. $psdefaultparametervalues)

Then how do I wire the above into profiles that I use (import the module etc) but maybe keeps some clean?

Then how do I set up to publish / install / update said module trivially (there's a build process in there somewhere)

Baby steps...

Testing

Because I'm writing a Cmdlet I (probably) want to use pester to do at least some testing - of an integration type nature where I'm testing calling the comdlets rather than anything where I test the internal function of the code (allowing that these are similar).

For pester to work its assumed that the test module will be in the "publish" folder off the root: dotnet publish -o publish

Run invoke-pester from the root, things should pass. But it will lock the .dll so use pwsh -Command invoke-pester to wrap the import of the module into a process that goes away after the test finish.s

Testing warnings

There is a param -WarningVariable that I should be able to pass when invoking the cmdlet - pass a variable name (without the $) and the text of the warning will be written to the variable. Upon which one can then assert. Not sure if one needs to have the var initialised first (probably not).

Usage

I can do multiline notes using here strings @"..."@. In theory at least, which makes this all the better really!

References

posh-tasklog's People

Contributors

recumbent avatar

Watchers

 avatar  avatar

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.