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

Replace text

I’m trying to replace text in a file that is like: keepthis=something I want to replace what is after the = So far I have this: powershell -Command “(gc test.txt) -replace ‘keepthis=.*?’,...

View Article


Issue with New-ADUser

Hello everyone! I’m a 3 year admin, 1 month powersheller and I’m having some issues. My first goal was to create a one stop shop script that creates users, enables a mailbox, enables Lync and assigns...

View Article


Help with User Update script

I must be completely drained from learning Azure… I can’t seem to remember how to make my user properties script work. We need to update every user with new values, here is what I am using, could...

View Article

Configure a Windows Server 2016 Server (Server Core or Server Core with GUI)...

submitted by /u/PlagueHO [link] [comments] The post Configure a Windows Server 2016 Server (Server Core or Server Core with GUI) to be a Docker Container host using PowerShell DSC. appeared first on...

View Article

$OSVersion in powershell

Hi again Im trying to make a vesrion choice for the OS so that if i have a Win 7 fix for e.g i can apply it just to that OS and not the others. This is where ive been heading and ive left the...

View Article


Show git status for file

When moving around in a repository I want to be able to show the git status of a file; whether it’s untracked, unchanged, modified, ignored, etc… I’m thinking of doing something like this: function...

View Article

Convertto-html question

I have a script that I am trying to build. I am basically trying to peace together some smaller scripts to one biggest script the output it all to HTML. I figured Since I am very new at this, that...

View Article

Technician with little power shell experience looking for help with a command.

Hello! I have a client with about 7000 deleted items in his online exchange mailbox. I need a way to delete all of the emails older than 1/1/16 from his deleted folder only. My experience with power...

View Article


CSV Manipulation in powershell

Hi there, I am not strong with powershell I have essentially just been pickup up things as I go. I have been asked to perform a task at work and I think it is probably possible but my skill are...

View Article


Set Range via Excel COM

We have a current (manual) process for evaluating expiring user accounts. I’d like to automate the generation of the list, and allow supervisors to just update the spreadsheet. The part I’m having...

View Article

Image may be NSFW.
Clik here to view.

Filter out objects from Table that are part of an array.

I’m trying to rule out any updates in a csv file which have been superseded by another update. So I get an array of all the updates which Supersedes others EG: MS16-117. Then use this to filter them...

View Article

Help files with Powershell error

I came to PS from AutoIt which had a fantastic helpfile, i find the one in PS sadly lacking in the way its laid out etc. But the biggest problem for me is i cant update it If i run PS or ISE as admin...

View Article

display name script

can someone help me out with this script trying to use the display name as folder name and i am trying to create a variable here is the script im working with Imgur submitted by /u/kingpin481 [link]...

View Article


Filter Pester results and e-mail?

Any way to filter results from pester? I have just recently gotten into Pester and have ~14,000 tests defined (most of these borrowed from the internet). So, when I run Invoke-Pester the resulting...

View Article

ForEach & listing/moving files

Hello I have a very basic question, I’m trying to list files in a directory and then move them to a different directory based on their file tag So files with * Lab *in their name go to the Labs...

View Article


GitHub – vincpa/z: Save time typing out directory paths in PowerShell by...

submitted by /u/vincpa [link] [comments] The post GitHub – vincpa/z: Save time typing out directory paths in PowerShell by jumping around instead. appeared first on How to Code .NET.

View Article

[Question] Reading the Notes section from Get-Help

Consider this script Function Invoke-Whatever { <# .SYNOPSIS Executes Whatever .DESCRIPTION Executes Whatever and return whatever .NOTES Author : supermamon Created : 17 Oct 2016 #>...

View Article


Single item to array – fails

Hi! I have a function that returns users (AD) based on search properties. The output then gets converted to an array. My issue is that if the search yields one result it does not convert to an array –...

View Article

PART 7.1: MICROSOFT AZURE POWERSHELL VPN CONNECTION IN VIRTUAL NETWORK GATEWAY

submitted by /u/kunaludapi [link] [comments] The post PART 7.1: MICROSOFT AZURE POWERSHELL VPN CONNECTION IN VIRTUAL NETWORK GATEWAY appeared first on How to Code .NET.

View Article

Deleting AutoLogonCount via Powershell

I have the following line in a powershell script: remove-ItemProperty -path "HKLM:SoftwareMicrosoftWindows NTCurrentVersionWinlogon" -Name 'AutoLogonCount' -force Running this line by itself works...

View Article
Browsing all 8793 articles
Browse latest View live