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

[Question] How do I stop get-child truncating when writing to a file?

I am trying to get the full path of some files as part of an emulation project I am working on. I have rom files stored on a network share and I am trying to get the full path in order to create empty...

View Article


The Snazzy Secret of PowerShell Parameter Aliases

submitted by /u/Net-Runner [link] [comments] The post The Snazzy Secret of PowerShell Parameter Aliases appeared first on How to Code .NET.

View Article


[HELP]ACL Cleanup Script

In my organization we use a local folder (C:Downloads) when we need to copy things to remote PCs. In the past, no one ever changed the ACL for this folder from the default. Now, this isn’t normally an...

View Article

Should the default be “Y”? Quick slip of the enter key…

submitted by /u/ApeironThanatos [link] [comments] The post Should the default be “Y”? Quick slip of the enter key… appeared first on How to Code .NET.

View Article

Need help combining some scripts

I have three scripts that I run in PowerShell to get some information I need from remote workstations. I would like this to be accomplished with just one script instead of three. What I need to get...

View Article


How can I add a line to a [pscustomobject]$variable ?

say for example I have $person1 = [pscustomobject]@{ name = “john” age = 21 } what I would like to do is add to this variable. sticking with the [pscustomobject] way of doing things I have been...

View Article

Script help [Complete Noob]

Hi, I am very VERY new to Powershell and I wanted to get started by creating a few scripts to automate things I do on my home computer in a day to day basis. I’ve started by just running the...

View Article

Image may be NSFW.
Clik here to view.

Overwritting LastAccessTime for all *.vbk files in a volume

So for some reason out Veeam reverse incremental backups are changing the modified timestamp on the vbk but not the access timestamp which is causing issues with our Backup Exec tape jobs that are...

View Article


Finding Groups with the Active Directory Searcher and PowerShell

submitted by /u/Pvt-Snafu [link] [comments] The post Finding Groups with the Active Directory Searcher and PowerShell appeared first on How to Code .NET.

View Article


Windows 10 setup automation

Hey guys, newbie user here. I’m trying to write a script to automate the setup of windows 10 machines (for business use, if that matters). Is PS the tool to use? Things that need to be done include:...

View Article

return $Error – font color is white?

Hi all, In a module I’m writing, I have a function that handles my errors by taking an [ErrorRecord] as input, doing some things with it, and then returning that same input [ErrorRecord]. For example,...

View Article

Regarding [pscustomobject] and [ordered] Type Accelerators: A mildly annoying...

I’ve been running into this a lot lately and it’s really annoying because the “Doesn’t Work” entry below is always my first instinct on how to handle this… $ht = @{Key1 = "Value1"; Key3 = "Value3";...

View Article

Are PowerShell crashes logged somewhere automatically to assist with diagnosis?

I have a script that operates on a large data set. It takes several hours to complete. CPU remains spiked for the duration of the run, but memory exhaustion is definitely not an issue, because it is...

View Article


Powershell & FTP with PSFTP for example

Hey PS Pro’s. I have a problem and maybe you have a hint for a solution. I try to download a complete directory structure with included files with powershell over ftp. I found PSFTP for that and it...

View Article

Folder permissions comparison script

I was recently tasked with created a comparison script that compares the permissions of two different folders (they have the same content as they were restored to a new storage device.) We just need...

View Article


Syntax for rounding to two decimal places

Here’s the code: $diskprops = @{'Volume'=$disk.DeviceID; 'Size'=$disk.Size/1gb; 'Used'=($disk.Size - $disk.FreeSpace)/1gb; 'Available'=$disk.FreeSpace/1gb; 'FileSystem'=$disk.FileSystem;...

View Article

Alright, ladies and gents. What’s the laziest you’ve ever been using PowerShell?

I had a task where I have to enter some data. I had a raw list of about 8 strings, and then I had to put them in a format: "[unimportantText1] WordN [unimportantText2]" "[unimportantText3] WordN...

View Article


(System-based?) Problems creating variables via Get-Content

So, here’s my code I’m trying to make a very simple INI file, with a few variables. When I run it at work on Windows 7, everything is fine, regardless of running in PS-ISE or from “Run in Powershell”....

View Article

PowerShell 6.0 Roadmap: CoreCLR, Backwards Compatibility, and More!

submitted by /u/PowerShellChallenge [link] [comments] The post PowerShell 6.0 Roadmap: CoreCLR, Backwards Compatibility, and More! appeared first on How to Code .NET.

View Article

How to call a powershell script from a sharepoint page

Hi, I want to have a link a user can click on in sharepoint that runs a powershell script. I can make a hyperlink to a .ps1 file but it (of course) just opens in the editor by default. I make a link...

View Article
Browsing all 8793 articles
Browse latest View live