# $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")
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
--- /dev/null
+
+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
}
}
+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
--- /dev/null
+<#
+.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
--- /dev/null
+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
Write-Host "Require remote scripts to be signed."\r
Set-ExecutionPolicy RemoteSigned\r
+Set-PSRepository -Name PSGallery -InstallationPolicy Trusted # Trust PowerShell Gallery\r
Install-Module posh-git\r
+Install-Module -Name PowerShellForGitHub
\ No newline at end of file
" 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//