My experimental port of Homebrew to Windows.
(Note: homebrew-mingw is an old repo and should not be used anymore)
| Set-ExecutionPolicy -ExecutionPolicy Unrestricted;$a=new-object net.webclient;$a.proxy.credentials=[system.net.credentialcache]::defaultnetworkcredentials;$a.downloadstring('http://bit.ly/OKgXHP')|iex |
| # This is the basic structure for a Windows project puppet module at Softek | |
| # We found that the Package type as provided by Puppet was not quite sufficient for our needs. | |
| # Instead, we transfer the file, exec msiexec when it changes (while logging install output), and then ensure the service is running. | |
| class some_project { | |
| $installer = 'Project.Setup.msi' | |
| $url = "puppet:///release/${installer}" | |
| file { "c:/packages/${installer}": | |
| ensure => 'file', | |
| mode => '1777', |
| # Fun with prompts | |
| # Ideas: | |
| # http://www.maketecheasier.com/8-useful-and-interesting-bash-prompts/2009/09/04 | |
| # http://www.termsys.demon.co.uk/vtansi.htm | |
| # http://slashdot.org/comments.pl?sid=108424&cid=9219400 | |
| # | |
| RESET="\[\017\]" | |
| NORMAL="\[\e[0m\]" | |
| BRIRED="\[\e[1;31m\]" |
| # Reset | |
| Color_Off="\[\033[0m\]" # Text Reset | |
| # Regular Colors | |
| Black="\[\033[0;30m\]" # Black | |
| Red="\[\033[0;31m\]" # Red | |
| Green="\[\033[0;32m\]" # Green | |
| Yellow="\[\033[0;33m\]" # Yellow | |
| Blue="\[\033[0;34m\]" # Blue | |
| Purple="\[\033[0;35m\]" # Purple |
| #*================================================================================================ | |
| #* Purpose: Sets the full build number ([major].[minor].[build].[revision]) in a consistent global way | |
| #* for all builds. We purposefully only use TeamCity to generate the incrementing [build] number. | |
| #* Set | |
| #*================================================================================================ | |
| Task Set-BuildNumber { | |
| $major = "1" | |
| $minor = "0" | |
| #Get buildCounter passed in from TeamCity, if not use zero |
My experimental port of Homebrew to Windows.
(Note: homebrew-mingw is an old repo and should not be used anymore)
| # Uses http://www.ltr-data.se/opencode.html/#ImDisk virtual disk driver for windows 7 or less | |
| # Tries to use chocolatey to install imdisk | |
| # Sample use case: | |
| # Import-Module ".\mount.iso.psm1" | |
| # Invoke-IsoExe "C:\test.iso" "setup.exe" "/passive" | |
| function Mount-Iso([string] $isoPath) | |
| { | |
| if ( -not (Test-Path $isoPath)) { throw "$isoPath does not exist" } |
| # This script mangles the output from git log between two git references | |
| # and matches this with a list of tickets from Jira. | |
| # | |
| # The List from Jira can be obtained by showing the list of issues for a release | |
| # i.e. a query like this for the given release which gets all targeting the | |
| # release in question: | |
| # | |
| # project = PUP AND fixVersion = "3.5.0" ORDER BY key ASC | |
| # | |
| # Then removing all columns from the output except key. |
| class acl { | |
| acl { 'c:/temp': | |
| owner => 'SYSTEM', | |
| group => 'Administrators', | |
| inherit_parent_permissions => 'false', | |
| permissions => [ { 'identity' => 'BUILTIN\Administrators', 'rights' => ['full'] } ] | |
| } | |
| } | |
| class registry { |
I was playing around with dynamic module creation and figured out how to monkey patch modules.
I then thought about how PowerShell is a Last-In-Wins language, and tried replacing private methods.
This led to the "what if" moment of pulling [secure data out of a loaded module][]. In this case, the username and password of a credential set.
This seems like a security issue to me, or am I being over sensitive?