Reply To: Exclude results of a compare-object if they meet a specific criteria
Well, the important part in getting a runnable sample was sample content for the actual csv files. Could you please create some sample csv-files to test it with?
View ArticleReply To: Exclude results of a compare-object if they meet a specific criteria
Yeah I was attempting to do it with the forum file upload but it does not seem to work. Here are the links to the files from drive: 05-07-2014.csv 05-08-2014.csv
View ArticleReply To: Exclude results of a compare-object if they meet a specific criteria
Here’s an example of one way to achieve the results you want. There might be more efficient ways, but I find this way pretty easy to read too: $yesterdays = Import-Csv -Path ("05-07-2014.csv") $todays...
View ArticleReply To: Get-Service -ComputerName in PSSession (require other privileges)
Hi Thank you for your prompt answer. I tried the following, but still get the same error. On SRV_A: Set-Item WSMAN:\localhost\client\auth\credssp –value $true Set-Item...
View ArticleReply To: Get-Service -ComputerName in PSSession (require other privileges)
Likely the cmdlet isn’t enabled for CredSSP. Try using it in Invoke-Command.
View ArticleReply To: Need help with Powershell Command
Hi deiandrei and Greg, Thank you for both of suggestion. I found a solution, it seems very easy: ((db2 get dbm cfg | select-string DIAGPATH) -split ‘ = ‘)[1]
View ArticleReply To: Non-Connected Computer Update-Help
We have the same issue and would hope someone can point us to a downloadable file we can then bring across to our offline server to then Update our PS4 help.
View ArticleReply To: Workflow with pipeline
When a workflow is run in PowerShell, it’s processed by Windows Workflow Foundation (WWF) which translates the PowerShell commands into WWF Activities. Since your Testing function doesn’t have an...
View ArticleCompare two locations, report on differences
Compare two folder locations, report on differences and copy over files from source if changes are under max size. I need the script to ensure large amount of changes are not occurring without my...
View ArticleReply To: Exclude results of a compare-object if they meet a specific criteria
Robert that was what I was looking for. I modified the code a little bit because it was pulling in some extra groups. New = $_.Group | Where { $_.SideIndicator -eq '=>' }| ?{$_.GROUP_Name -eq...
View ArticleReply To: Exclude results of a compare-object if they meet a specific criteria
Okay, I had only the sample csv files to test with, and it seemed to work fine there. Glad you got it working with your dataset too. No, the Group-Object does not make the Compare-Object more...
View ArticleReply To: Generate alert XML
Ok, so here is one way of doing it. This example first defines the variables you want to put in your XML document. Then it create the XML document (using Here-String) which takes the XML template and...
View ArticleCode formatting in forum posts?
I need help… I have tried to enter code into a post I put my code in the < code > element. The issue I have is that there is a duplicate block of code tags generated (I think?) so the post looks...
View ArticleReply To: Installing .MSU Via Powershell & PSexec
Hey Peter I’ve just checked what you wrote first I want to thank you very much and I will try it on Monday and will let you know how did it go. I read both of the scripts you wrote and bit optimistic...
View ArticleReply To: Access an existing mapped drive
Thanks Robert just what I need. What’s the difference between the 2 in terms of adherence to best practice? I’m trying to learn PS and know that there’s now right or wrong way as long as it works. I...
View ArticleReply To: OpenFileBox Result to Textbox
Hi, I used your code but for the first time it gives the below error: SelectFileDialog : The term ‘SelectFileDialog’ is not recognized as the name of a cmdlet, function, script file, or operable...
View ArticleReply To: Access an existing mapped drive
I can’t speak for best practices or not, but if you ask me the Select makes the code harder to read. I’d probably do something like: $newDrive = New-PSDrive -Name T -PSProvider FileSystem -Root...
View ArticleReply To: Code formatting in forum posts?
I have the same issue so I think it must be a bug with the forums. The workaround I use to make my code look correct is to edit my post immediately after posting it. You evidently have so long to edit...
View ArticleReply To: Code formatting in forum posts?
WordPress natively likes to use the back tick for code, which for us PowerShell people can obviously be a problem. Mike’s right in that editing your post makes it fairly easy to fix. I’ve looked into...
View Article