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

Help with conditionally creating folder and file

Hi everyone, First real stab at a project here. What I am trying to do: Save date as string with Month name in text. Check if folder exists for that month, if not create. Copy a template to the new...

View Article


[$5-$10] Create user in O365 / set their password / add to SharePoint group?

I just don’t have the time to do this, and it would honestly save me hours of work each week. I believe in giving back, so I’d be willing to pay $5 or $10. I just don’t have the time to do it and it’s...

View Article


script to report chrome installed/version

Currently have this, but it only reports the machines with chrome and the version. Id like it to also report the machines that are offline, or more importantly missing the file. Any tips ta $Computers...

View Article

Copy Files with a list from a Text file

Hello, I’m having big troubles somehow getting this done. Would someone be so nice and help me. Here is what i want to do: I have two Network folders where i need to copy files from a Textfile list,...

View Article

Loading/Running C# in PowerShell – Dependecy Hell

I’ve run C# in PowerShell before, but I’ve always been lucky that the needed assemblies (and the appropriate versions of those assemblies) were already available in the Global Assembly Cache (GAC) on...

View Article


how to debug a powershell command ?

Hi, I have an error with a simple posh command: set-service The error is Permission denied, it’s a strange error because I am domain admin. Then I want try to debug the error.. I think there are lack...

View Article

Having trouble wrapping my head around something – I think a custom object...

Hey All – Having trouble wrapping my head around something for a script that I am trying to clean up / make shorter and I’m trying to accomplish it without reading in from a csv or text file. I think...

View Article

Verify Domain admin credentials

This is a part of a script I’m writing. This bit checks to see if the user is currently running PowerShell with domain admin credentials. Crazy thing though, it works on some Windows 10 systems and...

View Article


Cant Paste a list into PowerShell, can this be done?

Here is my code: $computers = Read-Host “Imput PCs” $list = @" $computers "@ -split 'rn' foreach($computer in $list){ ping $computer } If I run that in ISE and paste in my list there, it works. But...

View Article


Unexpected Output

I have the following code that works great on my machine (PS 5.1) but not on a 2008 R2 server (PS 2.0). (The script creates a CSV file of non-admin, non-printer shares, suitable for import into...

View Article

Set Desktop Wallpaper via Powershell/Registry Edit

Hola, Trying to set a computer’s background using powershell via the registry. I can set the HKCU:Control PanelDesktop key to the relevant file but when I reboot it just sets the background to a solid...

View Article

Can’t figure out how to select data in what seems to be an array…help?

So i’m running Invoke-WebRequest to pull data from an OCR api, and its working!!! However, the only data i need from the return is under “Content” and it’s the “ParsedText” field. Here is what im...

View Article

PowerShell Simple GUI?

I have a PowerShell script that does some automation stuff. However, there are 2 variables that need to be hardcoded or entered by the user. I am looking for a way to make a VERY simple GUI that...

View Article


Once a functioning piece of code that reports back whether a process (.exe)...

Hi all, This code used to work well because of how faulty Windows OS reported back on process status for PowerShell. I used to test this on my own machine by listing processes like chrome or spotify...

View Article

UTF-8 to UTF-8-BOM

i am an app support guy with very little knowledge of powershell besides running the scripts. I recently received a script from the development team to automate configs for a tool that i support. When...

View Article


Using a list

What’s the correct way to run a command on a list of PCs from a .txt file? I want to run the antivirus update on all the PCs in the file. submitted by /u/jer9009 [link] [comments] The post Using a...

View Article

[Question] Is there a way to make a script to turn off my laptop display?...

This is one of a bunch of ideas I have to implement scripts in powerhell (if possible) to better my user experience in my computer daily usage. I’ve tried i the past to initiate since I don’t know A...

View Article


Delete Folders Older Than

At one point this script worked for me to delete folders (backups) that were older than a set amount, replacing with the new back up. (omitted that part). It’s been sitting unused, and now I need it....

View Article

System.Int32 madness

SOLVED: I am a tard / logic is hard. Thank you to those who responded. This is driving me insane. It has to be something obvious that I’m missing since it’s Friday afternoon. I run this function, and...

View Article

Building a web server with PowerShell

Blogged an explanation of how to make a simple web / static file server in PowerShell https://4sysops.com/archives/building-a-web-server-with-powershell/ Kinda walks you through my simple static file...

View Article
Browsing all 8793 articles
Browse latest View live