Quantcast
Channel: /r/powershell – How to Code .NET
Browsing all 8793 articles
Browse latest View live

Any way to know if an object property is null because there is no value (yet)...

Server 2012 R2, no non-recommended updates to powershell or Windows Management. New to powershell, and windows for that fact. I’m trying to get some disk health information to zabbix (monitoring). I...

View Article


Advice for my first functions?

submitted by /u/Jackriip [link] [comments] The post Advice for my first functions? appeared first on How to Code .NET.

View Article


dumb little questions regarding csv and args

Hello, I’m embarrassed to be essentially asking you lot to do my homework for me but I cannot for the life of me figure this out. So i am required to create a temporary file and copy the content of...

View Article

Looking for help understanding powershell.exe execution from task...

My task looks like this: Command: powershell Arguments: -Command invoke-expression -Command "c:scriptsChecks.ps1" Set-ExecutionPolicy Unrestricted -Confirm:$False; import-module PSWindowsUpdate;...

View Article

New-PSdrive – Unable to keep -persistent connection working after mapping...

Hello, I recently switched from performing “net use” to “new-psdrive” for mapping my home nas drive, since new-psdrive supports encrypted -credential flag. The problem is, I can’t seem to keep a...

View Article


Wait for input on forms?

I’m wanting to make a checkbox form window that will have all our applications listed and then basically be variables for their respective AD groups it will ask you the computer name at the top of the...

View Article

Need help getting this script to run against a list of machines

I have finally tracked down a reboot script that does exactly what I want. It displays a popup message with an option to “Reboot Now” or “Postpone” by 4 hours, 1 hour, 30 mins, and 10 mins. I need...

View Article

Breaking up results based on if they have multiple or single results

I am running this in my script (Get-WMIObject -cn ComputerName Win32_NetworkAdapterConfiguration).DefaultIPGateway And when I run it on a machine that is in a docking station with a hardwired...

View Article


PowerShell 102 – Practice scripts

submitted by /u/spuijk [link] [comments] The post PowerShell 102 – Practice scripts appeared first on How to Code .NET.

View Article


Testing Ansible Roles Against Windows with Test-Kitchen and Pester

submitted by /u/MattHodge [link] [comments] The post Testing Ansible Roles Against Windows with Test-Kitchen and Pester appeared first on How to Code .NET.

View Article

How do you retrieve info stored in JSON using invoke-restmethod?

This is actually a follow-up to my previous post. I have no idea how to send a call with invoke-restmethod to retrieve the value of status that is stored in JSON. This is the fiddler’s capture and...

View Article

Simple Foreach loop, but not producing results looking for.

http://pastebin.com/STuusmh3 The title says it all, I have a csv file of email address that I want to pull the Displayname, Recipienttype, and Title from. As of this writing, I am believing I need to...

View Article

What is your preferred method of having an advanced function output an object...

submitted by /u/challer [link] [comments] The post What is your preferred method of having an advanced function output an object which can then be passed to a second advanced function as input?...

View Article


Why Am I getting Bash errors?

ok I have posh-ssh installed and its working but whenever I send this command Invoke-SSHCommand -Index 0 -Command 'cd /efg/app/abcd/somting/TEST; ./maprapi 1.1.1.1 99999...

View Article

Script to append to another .csv file

Hi can someone please help me with appending from one csv file to another. I have two csv files, just need the data to move from test1 to test2 without removing any data on the csv file. I have the...

View Article


GPO to Reg question

I’ve been playing with the Get-GPRegistryValue command recently as part of a project. Being able to enumerate the actual values effected by a GPO is phenomenal, but having to supply the key makes it...

View Article

Require Invoke-WebRequest be HTTPS

I’m trying to retrieve a file containing sensitive data via a POST statement made to a site’s RESTful API. Assuming my statement looks like this: Invoke-WebRequest https://securedownload.net -Method...

View Article


Can you explain me the difference between the two scripts?

I am trying to find (eventually delete) empty folders recursively but having trouble with my script. I found the script online from the following website but trying to understand what is the...

View Article

Log Off Azure Remote App User via PowerShell

submitted by /u/Glass-Water [link] [comments] The post Log Off Azure Remote App User via PowerShell appeared first on How to Code .NET.

View Article

Out-File write-host data?

Before I go any further, I know this is a silly ask. I’ve run into a bit of an odd scenario and I just want to see if anyone else might have a potential solution. I could go into a lot of detail about...

View Article
Browsing all 8793 articles
Browse latest View live


Latest Images