Initial commit, date conditional formatting

This commit is contained in:
dfinke
2016-01-19 17:31:39 -05:00
parent fc3a17bec8
commit a53c12d2f4
14 changed files with 165 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
echo Last7Days LastMonth LastWeek NextMonth NextWeek ThisMonth ThisWeek Today Tomorrow Yesterday |
% {
$text = @"
`$f = ".\testExport.xlsx"
rm `$f -ErrorAction Ignore
.\GenDates.ps1 |
Export-Excel `$f -Show -AutoSize -ConditionalText `$(
New-ConditionalText -ConditionalType $_
)
"@
$text | Set-Content -Encoding Ascii "Highlight-$($_).ps1"
}

View File

@@ -0,0 +1,26 @@
$f = ".\testExport.xlsx"
rm $f -ErrorAction Ignore
$data = $(
New-PSItem North 111 (echo Region Amount )
New-PSItem East 111
New-PSItem West 122
New-PSItem South 200
New-PSItem NorthEast 103
New-PSItem SouthEast 145
New-PSItem SouthWest 136
New-PSItem South 127
New-PSItem NorthByNory 100
New-PSItem NothEast 110
New-PSItem Westerly 120
New-PSItem SouthWest 118
)
#$data | Export-Excel $f -Show -AutoSize -ConditionalText (New-ConditionalText -ConditionalType AboveAverage)
$data | Export-Excel $f -Show -AutoSize -ConditionalText (New-ConditionalText -ConditionalType BelowAverage)
#$data | Export-Excel $f -Show -AutoSize -ConditionalText (New-ConditionalText -ConditionalType TopPercent)

View File

@@ -0,0 +1,22 @@
function Get-DateOffset {
param($days=0)
(Get-Date).AddDays($days).ToShortDateString()
}
function Get-Number {
Get-Random -Minimum 10 -Maximum 100
}
New-PSItem (Get-DateOffset -7) (Get-Number) 'LastWeek,Last7Days,ThisMonth' (echo Date Amount Label)
New-PSItem (Get-DateOffset) (Get-Number) 'Today,ThisMonth,ThisWeek'
New-PSItem (Get-DateOffset -30) (Get-Number) LastMonth
New-PSItem (Get-DateOffset -1) (Get-Number) 'Yesterday,ThisMonth,ThisWeek'
New-PSItem (Get-DateOffset) (Get-Number) 'Today,ThisMonth,ThisWeek'
New-PSItem (Get-DateOffset -5) (Get-Number) 'LastWeek,Last7Days,ThisMonth'
New-PSItem (Get-DateOffset 7) (Get-Number) 'NextWeek,ThisMonth'
New-PSItem (Get-DateOffset 28) (Get-Number) NextMonth
New-PSItem (Get-DateOffset) (Get-Number) 'Today,ThisMonth,ThisWeek'
New-PSItem (Get-DateOffset -6) (Get-Number) 'LastWeek,Last7Days,ThisMonth'
New-PSItem (Get-DateOffset -2) (Get-Number) 'Last7Days,ThisMonth,ThisWeek'
New-PSItem (Get-DateOffset 1) (Get-Number) 'Tomorrow,ThisMonth,ThisWeek'

View File

@@ -0,0 +1,8 @@
$f = ".\testExport.xlsx"
rm $f -ErrorAction Ignore
.\GenDates.ps1 |
Export-Excel $f -Show -AutoSize -ConditionalText $(
New-ConditionalText -ConditionalType Last7Days
)

View File

@@ -0,0 +1,8 @@
$f = ".\testExport.xlsx"
rm $f -ErrorAction Ignore
.\GenDates.ps1 |
Export-Excel $f -Show -AutoSize -ConditionalText $(
New-ConditionalText -ConditionalType LastMonth
)

View File

@@ -0,0 +1,8 @@
$f = ".\testExport.xlsx"
rm $f -ErrorAction Ignore
.\GenDates.ps1 |
Export-Excel $f -Show -AutoSize -ConditionalText $(
New-ConditionalText -ConditionalType LastWeek
)

View File

@@ -0,0 +1,8 @@
$f = ".\testExport.xlsx"
rm $f -ErrorAction Ignore
.\GenDates.ps1 |
Export-Excel $f -Show -AutoSize -ConditionalText $(
New-ConditionalText -ConditionalType NextMonth
)

View File

@@ -0,0 +1,8 @@
$f = ".\testExport.xlsx"
rm $f -ErrorAction Ignore
.\GenDates.ps1 |
Export-Excel $f -Show -AutoSize -ConditionalText $(
New-ConditionalText -ConditionalType NextWeek
)

View File

@@ -0,0 +1,8 @@
$f = ".\testExport.xlsx"
rm $f -ErrorAction Ignore
.\GenDates.ps1 |
Export-Excel $f -Show -AutoSize -ConditionalText $(
New-ConditionalText -ConditionalType ThisMonth
)

View File

@@ -0,0 +1,8 @@
$f = ".\testExport.xlsx"
rm $f -ErrorAction Ignore
.\GenDates.ps1 |
Export-Excel $f -Show -AutoSize -ConditionalText $(
New-ConditionalText -ConditionalType ThisWeek
)

View File

@@ -0,0 +1,8 @@
$f = ".\testExport.xlsx"
rm $f -ErrorAction Ignore
.\GenDates.ps1 |
Export-Excel $f -Show -AutoSize -ConditionalText $(
New-ConditionalText -ConditionalType Today
)

View File

@@ -0,0 +1,8 @@
$f = ".\testExport.xlsx"
rm $f -ErrorAction Ignore
.\GenDates.ps1 |
Export-Excel $f -Show -AutoSize -ConditionalText $(
New-ConditionalText -ConditionalType Tomorrow
)

View File

@@ -0,0 +1,8 @@
$f = ".\testExport.xlsx"
rm $f -ErrorAction Ignore
.\GenDates.ps1 |
Export-Excel $f -Show -AutoSize -ConditionalText $(
New-ConditionalText -ConditionalType Yesterday
)

View File

@@ -0,0 +1,23 @@
$f = ".\testExport.xlsx"
rm $f -ErrorAction Ignore
$data = $(
New-PSItem North 111 (echo Region Amount )
New-PSItem East 11
New-PSItem West 12
New-PSItem South 1000
New-PSItem NorthEast 10
New-PSItem SouthEast 14
New-PSItem SouthWest 13
New-PSItem South 12
New-PSItem NorthByNory 100
New-PSItem NothEast 110
New-PSItem Westerly 120
New-PSItem SouthWest 11
)
$data | Export-Excel $f -Show -AutoSize -ConditionalText (New-ConditionalText -ConditionalType DuplicateValues)