Discovering unnamed parameters
I’m having a difficult time finding an answer to this. Let’s say I run this command: ls -recurse *help* Works fine. It’s obviously picking a positional parameter for my wildcard search, right? My...
View ArticleCompare-Object results are inaccurate
I am in need of assistance as I am seeing weird results for Compare-Object. I have two lists of DistinguishedNames. The reference object is the full list and the difference object is a list of...
View ArticleImport-CSV to Set-ADUser Properties
Hello r/PowerShell ! I’ve been a member of the sub for a few months now and I appreciate the amount of knowledge and insight the community here has given me for my career. I don’t have much formal...
View ArticleCopy directory only include files that are X days old and archive..
Hi guys, i’m a noob at powershell and most of the time i just piece bits together. I frequent this to try and learn a little bit. I’ve been working on a script that will archive files for me. But i...
View ArticleMultidimensional Array question
Can anyone look at this code and tell me what is incorrect? I am trying to build an array of arrays and then test it. This is just for my education not to solve any problem. I’m using looped variables...
View ArticleHow do you create a backup of an arraylist?
$a = New-Object System.Collections.ArrayList $b = New-Object System.Collections.ArrayList $a.Add(“1”) $a.Add(“3”) $a.Add(“5”) $b = $a $b.Remove(“3”) $b now equals 1, 5 $a now equals 1, 5 as well I’m...
View ArticleUsing ‘jobs’ since 1940s! Get your ‘job’ on!
submitted by /u/Mskews [link] [comments] The post Using ‘jobs’ since 1940s! Get your ‘job’ on! appeared first on How to Code .NET.
View ArticlePowerShell GUI for Viewing/Exporting Dynamic Distribution List Members on...
Code: https://github.com/markekraus/O365DynamicListViewer Release: https://github.com/markekraus/O365DynamicListViewer/releases/tag/v1.0.0.34 Screenshot Album: http://imgur.com/a/Vvz6e System...
View ArticleScript shaming
Do you think script shaming exists and that’s why some great scripts never make it to the community? Is because people are self conscious of their scripting ability? Or is it because the amount of...
View ArticleContinuously Testing your Infrastructure with OVF and Microsoft Operations...
submitted by /u/PlagueHO [link] [comments] The post Continuously Testing your Infrastructure with OVF and Microsoft Operations Management Suite appeared first on How to Code .NET.
View ArticlePowershell slickness
I’ve written a script to check for what superseded updates are missing from servers on the network. I’m still pretty new to Powershell, so thought I’d post it on here and see what people could suggest...
View ArticleIs it possible to initialize A pscustoobject with a ScriptProperty using the...
Hi All! Basically, I have fallen in love creating PSObjects like this: $TestObj = [pscustomobject]@{ Property1 = 'Value 1' Property2 = 'Value 2' } It’s objectively faster and much cleaner than a bunch...
View ArticleCreating Signed Powershell Scripts
I’ve got a powershell script that I want our servers to run. This script just sends an email if a server restarts for ANY reason. I’m looking for best practices on how to accomplish this. I currently...
View ArticlePowerShell Oneliner Contest 2016
submitted by /u/happysysadm [link] [comments] The post PowerShell Oneliner Contest 2016 appeared first on How to Code .NET.
View ArticleIssues copying to machines
Can anyone see any issues with this? I’m getting “invalid path”…I’ve confirmed the path several times over. Cls Goals Copy exe to computers within sql DB Copy .dat to servers within sql DB Run exe...
View ArticlePair bluetooth device
I have a BT speaker that needs to get re-paired each time computer goes to sleep. I use nircmd to set it as default: nircmd setdefaultsounddevice Headphones However, are there any ready to use modules...
View Articlemore efficient dealing with Win32_Share
I’m currently trying to archive a lot of users from 2008R2 file share (so not Get-SMBShare for me ) and running into trouble with unsharing their homedirectory. I can use get and then remove fine, but...
View ArticleTrying to scrape SharePoint, having trouble stripping newlines to parse output
We use SharePoint to document our network, and I’m trying to pull some data out of it. Looks like the custom fields we created are not stored in a way that I can parse as native PS objects, but rather...
View ArticlePowerShell Magazine » ForEach and Where magic methods
submitted by /u/rschiefer [link] [comments] The post PowerShell Magazine » ForEach and Where magic methods appeared first on How to Code .NET.
View ArticleSeeking guidance/peer review for a work-in-progress script
Hello, I’m new to coding, so I’ll do my best to explain what I need without rambling on. Flowchart of what I’m looking to do: 1.) Create an array of existing user accounts (about 10 of them, example:...
View Article