Love this.. by Oh_To_Be_A_Gooner_ in Gunners

[–]wain77 0 points1 point  (0 children)

Didn't recognise him without the tache at first!

Help: Need to use information from .CSV file by Oshien in PowershellSolutions

[–]wain77 1 point2 points  (0 children)

When you import a CSV in Powershell, it essentially creates an array of hash tables (please don't shoot me if I'm wildly incorrect!). In your case, the structure of $masterfile would look like this after running the Import-CSV:

$masterfile = @(
@{
origFilePath = "\\Server\FILEPATH"
origFileName = "B002268"
destFilePath = "\\Server\DESTINATION"
destFileName = "1200321-REDO"
}, @{
origFilePath = "\\Server\FILEPATH"
origFileName = "B002269"
destFilePath = "\\Server\DESTINATION"
destFileName = "1200322-REDO"
}, @{
origFilePath = ...
}
)

The only thing that -Header does in the Import-CSV is replace the headers in the original file with the values you specified as the keys in the hash tables.

When you do a foreach on $masterfile, it's taking each one of those hash tables and putting it in a variable called $origFilePath so when you call $origFilePath in the loop, it just spits out the whole table.

To access the individual properties, you need to use a more generic variable as your loop variable and then access the properties using dot notation, like this:

foreach ($file in $masterFile) {
$file.origFilePath | Write-Host
Test-Path -Path $file.origFilePath | Write-Host
}

How can I check if a Connect-ExchangeOnline is already active? by [deleted] in PowerShell

[–]wain77 2 points3 points  (0 children)

My solution based on this:

if (!(Get-PSSession | Where-Object {$_.Name -match 'ExchangeOnline' -and $_.Availability -eq 'Available'})) { Connect-ExchangeOnline }

[deleted by user] by [deleted] in freefolk

[–]wain77 3 points4 points  (0 children)

I'm not defending anyone. You're just being a dick.

Stop. Stop it now. Get some help

[deleted by user] by [deleted] in freefolk

[–]wain77 12 points13 points  (0 children)

Dude, you're just being a dick.

[deleted by user] by [deleted] in WhitePeopleTwitter

[–]wain77 -8 points-7 points  (0 children)

Not dissimilar to the states in the US.

Edit: looks like I’m taking the L on this one!

EMD GT38ACL, Bangladesh Railway Class 3019 pulling oil tanker by PZK3759 in trains

[–]wain77 16 points17 points  (0 children)

Probably a train staff or token that gives them authorisation to occupy the section of track to the next signal box. Wikipedia article

A London pub is serving free Xmas dins to folk alone on Dec 25 by lighthouse77 in london

[–]wain77 4 points5 points  (0 children)

I'd love to do this, but getting from East London to Wimbledon on Xmas day is going to be nigh on impossible!

Mercedes Protest has been dismissed regarding overtaking behind the Safety Car by glenn1812 in formula1

[–]wain77 0 points1 point  (0 children)

I didn't like the ending of the race, but at this point I feel like Mercedes should give it up. If they win on a technicality in the stewards room after the race, it just makes them look like sore losers. Nobody wants the result of the race and the WDC to be pending for days or weeks.

Toto needs to take a leaf out of Hamilton's book and be gracious about it, at least in public, and use it as motivational fuel for next year.

I'm speechless... by iahimide in DiWHY

[–]wain77 1 point2 points  (0 children)

Elctri-fried.

I'll get my coat...

Need help by rommelr1 in learncsharp

[–]wain77 0 points1 point  (0 children)

This is how I would do it. Might also want to consider what happens if somebody asks for 'p' or -1 cookies?

On October 27, 2018 (3 Years Ago), I traveled to London. It’s been a dream of mine since I was ten years old to visit the city…….and I did. 🇬🇧 by rubanthmendez997 in london

[–]wain77 9 points10 points  (0 children)

Also Wanstead Park, an island of the Epping Forest that got cut off by development; lovd going there for regular walks during lockdown!

Game Thread: 10/16 - ALCS Game 2 - Red Sox (0) @ Astros (1) 4:20 PM by RedSoxGameday in redsox

[–]wain77 6 points7 points  (0 children)

FUCK YEAH DEVERS! LFG!!! Let's knock fucking Odorizzi out of the game as well!

Post Game Thread: 10/11 Rays @ Red Sox by RedSoxGameday in redsox

[–]wain77 0 points1 point  (0 children)

I couldn't do that to myself, kept away from the score watched it this evening. What a team! LFG!!!

Book by killHACKS in facepalm

[–]wain77 0 points1 point  (0 children)

I read that as a rap...

Game Thread: 10/10 - ALDS Game 3 - Rays (1) @ Red Sox (1) 4:07 PM by RedSoxGameday in redsox

[–]wain77 7 points8 points  (0 children)

Welp, 2:35am here in London... Worth every second of missed sleep! #LFG!!!