Rename-Item can’t find file due to special characters.
Get-ChildItem . -Recurse | Foreach { IF ($_.Length -gt "1") { Rename-Item -Path $_.FullName -NewName Test.txt } } Rudimentary, just trying to work around this issue, plan to use replace eventually but...
View ArticleA short video on using Params in functions
submitted by /u/riseNRG [link] [comments] The post A short video on using Params in functions appeared first on How to Code .NET.
View ArticleMy boss wants me to start training our staff on Powershell. How can I...
Does anyone know any way of restricting commands based on security group or via GPO? This way, the average user in the company has no access to PowerShell, our T1 has access to only “Get-” commands...
View Article3 line ps, in kiosk mode win 10
So I have a simple 3 line ps script and it works perfect in windows but not windows kiosk mode. What I am doing is using kiosk mode to boot directly into the VMware Horizon View client, auto connect...
View ArticleMonitoring presence on Skype for Business.
I was thinking of monitoring presence of a list of people (read from a file) who are on Skype, but not necessarily added as a contact. Is this possible to do this using pwsh and without access to...
View ArticleFind a specific DNS Server IP on multiple servers. Access denied…
I am running a script to scan all servers in an OU and report primary and secondary DNS server addresses. It is then supposed to match the addresses against an existing one and report server names...
View ArticleWhere do you keep all of your snippets of code?
I have collected a bunch of snippets and working scripts over a few years of doing scripts on the side. I am doing it every day now and not sure how to organize all these snippets and useful sections...
View ArticleBamshell : New post about Write-Log function
submitted by /u/Clebam [link] [comments] The post Bamshell : New post about Write-Log function appeared first on How to Code .NET.
View ArticleUnderstanding Get-SpeculationControlSettings PowerShell script output
submitted by /u/NISMO1968 [link] [comments] The post Understanding Get-SpeculationControlSettings PowerShell script output appeared first on How to Code .NET.
View ArticleCan i get a review/suggestion on my powershell module
I wrote the following module to audit our users. Right now it’s taking about 40-45 secs to complete and it does what I want but i feel it’s slow because it’s creating a new array object each time....
View ArticlePowershell studio community edition?
I am looking in to start making GUI tools to make my life easier and also as it looks kinda fun. My powershell in depth book has recommended powershell studio which looks totally awesome but I can...
View ArticleProblem with script trying to SSH into a linux server and being able to su –
I am trying to write a script for work to automate tasks for several servers. I need access to several ID’s. Several of these ID’s I am able to “sudo su – <account>” which makes the task easy....
View ArticleUse cmd prompt to run powershell in the same directory as the cmd prompt?
submitted by /u/Tr1pline [link] [comments] The post Use cmd prompt to run powershell in the same directory as the cmd prompt? appeared first on How to Code .NET.
View ArticleCreate folder within a folder made by a variable
I’m a powershell nub so bear with me please. I’ve been googling for like the last hour and still haven’t found an solution to my simple problem. I have this section of a larger script that ask the...
View ArticleShortest Script Challenge – Decode String?
Previous challenges listed here. Can you decode the following input? $i =...
View ArticlePoshgui.com Major update: Free online Gui Designer, Cmdlet builder, IDE,...
submitted by /u/nepronen [link] [comments] The post Poshgui.com Major update: Free online Gui Designer, Cmdlet builder, IDE, repository and more! appeared first on How to Code .NET.
View ArticleApproved PowerShell Verbs – Quick Reference [OC]
submitted by /u/jftuga [link] [comments] The post Approved PowerShell Verbs – Quick Reference [OC] appeared first on How to Code .NET.
View ArticlePowerShell Function to Confirm if a date time format pattern is valid or not
Hey Everyone, I wanted to share this quick little function I wrote for another project but I thought it might help some of you out there. Confirm-DateTimeFormatPattern submitted by /u/_Unas_ [link]...
View ArticleScript just quits randomly after accepting console input
This problem has been hard to nail down, I don’t get an error message, and nothing appears in the Event Log as far as I can see. Maybe 1 in 5 times, after accepting console input from the user,...
View ArticleDifferences between runas / right-click run as admin
So if I start an instance of powershell with runas /user:domain.comadmin-user powershell.exe I’m technically running as the administrator (in this instance my domain admin account). Yet, if I run...
View Article