From: EdTheDev Date: Mon, 17 May 2021 03:52:19 +0000 (-0500) Subject: Merge. X-Git-Url: https://us-delaporte.pagekite.me/gitweb/dotfiles.git/commitdiff_plain/ff4bd2116c84600a2a5c981d06174eb792ff52a4?hp=50f9b02644cc951730a78c06b8dc03e8b32ce4b4 Merge. --- diff --git a/Microsoft.PowerShell_profile.ps1 b/Microsoft.PowerShell_profile.ps1 index 355f90f..eed9141 100644 --- a/Microsoft.PowerShell_profile.ps1 +++ b/Microsoft.PowerShell_profile.ps1 @@ -9,7 +9,7 @@ # $env:PSModulePath = $env:PSModulePath.Replace("\\ad.uillinois.edu\techsvc\home\$($ENV:USERNAME)\Documents\PowerShell\Modules;",'') # No longer needed in PowerShell 7 -if($IsWindows -eq "") { +if(-Not $IsWindows) { # Bootstrap for older PowerShell Write-Host "***Bootstrapped Is Windows for older PowerShell***" $IsWindows = ($env:OS -eq "Windows_NT") @@ -90,3 +90,14 @@ New-Alias x16 Invoke-X16Emu if((Get-Location).Path -eq $HOME){ cd $env:src } + +function Get-GitLog() { + git log --oneline +} + +function Get-GitStatus() { + git status -b --short +} + +New-Alias ol Get-GitLog +New-Alias st Get-GitStatus \ No newline at end of file diff --git a/psmodules/dash.psm1 b/psmodules/dash.psm1 new file mode 100644 index 0000000..560f729 --- /dev/null +++ b/psmodules/dash.psm1 @@ -0,0 +1,19 @@ + +function Get-MyDashboard() { + $MyDashboard = New-UDDashboard -Title "Hello, World" -Content { + New-UDCard -Title "Hello, Universal Dashboard" -Content { + New-UDParagraph -Text 'I am a very simple card. I am good at containing small bits of information. I am convenient because I require little markup to use effectively.' + } -Links @( + New-UDLink -Text 'This is a link' -Url '#!' + New-UDLink -Text 'This is a link' -Url '#!' + ) -Size 'small' + } + return $MyDashboard +} + +function Inovke-MyDashboard() { + Start-UDDashboard -Port 1000 -Dashboard Get-MyDashboard + Write-Host "http://localhost:1000" +} + +Export-ModuleMember -Function Invoke-MyDashboard \ No newline at end of file diff --git a/psmodules/drivespace.psm1 b/psmodules/drivespace.psm1 index 59feb96..19fdc5e 100644 --- a/psmodules/drivespace.psm1 +++ b/psmodules/drivespace.psm1 @@ -21,6 +21,21 @@ function Show-Drivespace() { } } +function Show-DrivespacePretty() { + Start-Job -Name "FileCollection" -ScriptBlock { Show-Drivespace } +While((Get-Job -Name "FileCollection").State -eq "Running") { + Write-Progress -Activity "Collecting Files..." -PercentComplete $x + If($x -eq 100){ + $x = 1 + } + Else{ + $x += 1 + } +} +Write-Progress -Activity "Collecting Files..." -Completed +$Files = Get-Job -Name "FileCollection" | Receive-Job +Get-Job -Name "FileCollection" | Remove-Job +} Export-ModuleMember -Function Show-Drivespace Export-ModuleMember -Function Show-LargeFiles diff --git a/psmodules/github.psm1 b/psmodules/github.psm1 new file mode 100644 index 0000000..0f26e24 --- /dev/null +++ b/psmodules/github.psm1 @@ -0,0 +1,43 @@ +<# +.SYNPOSIS + +Fetch closed GitHub issues that were updated in the last 14 days. + +#> +function Get-GHClosed { + param( + [int]$days = -14 + ) + $repos = @('SecOps-Tools', 'secdev-job-aids', 'awscli-login') + $issueSearchParams = @{ State = 'closed'; OwnerName = 'techservicesillinois' } + $closed = @() + $repos | ForEach-Object { + $closed += Get-GitHubIssue -RepositoryName $_ @issueSearchParams + } + + # Limit to past two weeks + $issues = $closed | Where-Object { $_.updated_at -gt (Get-Date).AddDays($days) } + return $issues +} + + +<# +.SYNOPSIS + +Show closed GitHub issues that were updated in the last 14 days. + +#> +function Show-GHClosed() { + param( + [int]$days = -14 + ) + Get-GHClosed -days $days | ForEach-Object { + # Markdown output + " + [" + $_.Title + " (" + $_.Number + ")](" + $_.html_url + ")" + } + # Format-Table -Property Number, Title, Url + +} + +Export-ModuleMember -Function Get-GHClosed +Export-ModuleMember -Function Show-GHClosed \ No newline at end of file diff --git a/setup/disable-hyper-v.ps1 b/setup/disable-hyper-v.ps1 new file mode 100644 index 0000000..4a8ea03 --- /dev/null +++ b/setup/disable-hyper-v.ps1 @@ -0,0 +1,5 @@ +Write-Host "Recipe to help VMWare play nice." +Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Hypervisor +bcdedit /set hypervisorlaunchtype off # auto to turn back on +Write-Host "Start - GPEdit - Computer Configuration -> Administrative Templates -> System -> Device Guard - Turn on Virtualization Based Security" +Write-Host "You may need to restart." \ No newline at end of file diff --git a/setup/powershell.ps1 b/setup/powershell.ps1 index 6dffb0f..365629b 100755 --- a/setup/powershell.ps1 +++ b/setup/powershell.ps1 @@ -1,3 +1,5 @@ Write-Host "Require remote scripts to be signed." Set-ExecutionPolicy RemoteSigned +Set-PSRepository -Name PSGallery -InstallationPolicy Trusted # Trust PowerShell Gallery Install-Module posh-git +Install-Module -Name PowerShellForGitHub \ No newline at end of file diff --git a/vimrc b/vimrc index b212fb0..712d0c0 100644 --- a/vimrc +++ b/vimrc @@ -74,8 +74,7 @@ au BufNewFile,BufRead *.go set noet ts=2 sw=2 sts=2 " Working with Markdown au BufNewFile,BufFilePre,BufRead *.md set filetype=markdown -colorscheme slate -" colorscheme papercolor +colorscheme elflord set number set backupdir=c:\temp,.backup/,~/.backup/,/tmp//