Code Monkey home page Code Monkey logo

profile's Introduction

ABOUT
=====

Trying to build cool stuff for other Windows developers.

profile's People

Contributors

stefangreve avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

profile's Issues

Bug in Set-EnvironmentVariable

If a value is added to an empty key, then the value stored if prefixed with a semicolon (which consequently breaks the path).

Example:

> Set-EnvironmentVariable -Value "C:\java" -Key "CLASSPATH"
> echo $env:CLASSPATH
;C:\java

Suggested additional features:
Implement an ArgumentCompleter for the Key Parameter in

  • Set-EnvironmentVariable
  • Get-EnvironmentVariable
  • Remove-EnvironmentVariable

Get-Calendar Update

Proposal

The Get-Calendar Cmdlet currently pretty-prints a specific month or year to the terminal, but something more useful than that would probably integrate data from Outlook or Gmail in some capacity. That way this new feature could emit an array of PowerShell object with the following properties:

Name Type Nullable
Subject string false
StartDate datetime true
EndDate datetime true
Location string true

List of proposed parameters:

  • Provider (using the ValidateSetAttribute for selecting Microsoft or Google)

Notes

  1. It's foreseeable that a Cmdlet with support for multiple Calendar providers would need to be split up into several functions. To keep the underlying functions private, declare these helper methods within the body of the Get-Calendar Cmdlet. One downside of this technique would be that it blows up the Cmdlet body considerably, but on the bright side it emphasizes that all these functions belong together.
  2. For Outlook there are at least two viable options for retrieving the Calendar data (COM Object or Microsoft Graph REST API). The first solution would limit Outlook users to Windows computers that already have Office365 installed, and from what I have gathered it's generally discouraged to use COM objects in this day and age. As far as Gmail is concerned, this blog post details the steps required to authenticate an application for accessing the Gmail API using OAuth v2.
  3. Clarify how API secrets are going to be stored persistently across all platforms following current best practices?

Implement Get-Battery

Since Linux 2.6.24 it is recommended to read this information from /sys/class/power_supply/BAT1, e.g.

PS > cat /sys/class/power_supply/BAT1/capacity
99

or

PS > cat /sys/class/power_supply/BAT1/status
charging

Linux Roadmap

After testing this profile on Linux I noticed a few issues that should be addressed in the next release:

  • use : as split character in Get-EnvironmentVariable, Set-EnvironmentVariable and Remove-EnvironmentVariable on Linux
  • The prompt function is broken in many ways:
    • $env:USERNAME isn't set by default in Raspbian OS
    • same goes for $env:COMPUTERNAME
    • the active branch isn't detected correctly edit: it works with a fairly new version of Git
  • alias winfetch to neofetch on Windows
  • the performance (time to load profile) is really bad (Loading personal and system profiles took 4140ms.)
    • configure automatic transcript recording preferences via an environmental variable and opt out by default

Additionally, update the README.md file to include further tips and tricks for Unix-based operating systems.

Implement Get-Encoding

This Cmdlet should return a custom object with the following properties

  • LineEndings: CRLF or LF (as string values)
  • Encoding: compare remark [1] (as an enum)

There have been a couple of implementation attempts in the past, though their reliability
is sometimes questionable [2] [3].


[1]: List of common character encodings: https://en.wikipedia.org/wiki/Character_encoding
[2]: C# code from SO: https://stackoverflow.com/a/62814282/10827244
[3]: Some godforsaken batch function, also from SO: https://stackoverflow.com/a/43147510/10827244

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.