PoshCode Archive  Artifact Content

Artifact 770869223fa2c3948555b825f3c80189cbdc2863cd37197ac8678af6227a861c:

  • File So-many-holla-dollas.ps1 — part of check-in [c03bcee436] at 2018-06-10 14:05:59 on branch trunk — So many holla dollas (user: unknown size: 847)

# encoding: ascii
# api: powershell
# title: 
# description: So many holla dollas
# version: 0.1
# license: CC0
# x-poshcode-id: 6010
# x-archived: 2016-05-17T13:06:17
#
#
$30DaysFiles = Get-ChildItem $dataLocation | Where-object {
    ([datetime]::ParseExact($_.Name.Substring(4,6),"yyMMdd",$null) -gt (Get-Date).AddDays(-31)) -and `
    ([datetime]::ParseExact($_.Name.Substring(4,6),"yyMMdd",$null) -lt (Get-Date)) -and`
    
    # We also will check here to see if our $db already contains entries for the date. If so, not going to bother with it

    # In the next line, the $_.Date is referring, for example, to $db[0].Date whereas the $_.Name might refer to $30DaysFiles[0].Name
    (($db | Where-Object {$_.Date -eq [datetime]::ParseExact($_.Name.Substring(4,6),"yyMMdd",$null).ToString("MM/dd/yyyy")}) -eq $null)
    }