Configuring "Do not forcefully unload the users registry at user logoff" in...
I need to write a PowerShell script that should configure the below settings of Group policy in all the machines.Gpedit.msc → Computer Configuration → Administrative Templates → System → User Profiles...
View ArticleGenerating Powershell scripts by working in Windows GUI
My understanding is that virtually all "real work" done by the various GUI components in Windows Server 2012 (for example, in Disk Management) is performed by invoking Powershell. (That is, there's...
View ArticleWriting a hex escaped char in Powershell
Is there any way to write something like this in Powershell? (Linux would be with Perl)char foo = '\x41';I need to input some non-printable characters to one of my programs
View ArticleGetting the user's Documents folder in Powershell
I want to use a PowerShell script to automate tasks related to the user when the user logs in.Sometimes a user will have moved his Documents folder from the default location. How can I determine the...
View ArticleWhich windows events to look for when a application opened by user (Mouse...
I am looking for a event or any trigger points, broadcasted by Windows OS when a an specific application opened from user either by Mouse click or ALT+Tab.Reason for looking this event is, I have a...
View ArticlePowershell - Why is Using Invoke-WebRequest Much Slower Than a Browser Download?
I use Powershell's Invoke-WebRequest method to download a file from Amazon S3 to my Windows EC2 instance.If I download the file using Chrome, I am able to download a 200 MB file in 5 seconds. The same...
View Articleget IPv4 address into a variable
Is there an easy way in PowerShell 3.0 on Windows 7 to get the local computer's IPv4 address into a variable?
View ArticlePowershell Access to Path is Denied
I have developed a git pre-commit hook for my workplace. The way it operates is as follows:There is a pre-commit file that invokes a pre-commit.ps1 file in the same directory. Both are withing the...
View ArticleCan't Activate Document in Pipeline (unix script)
I'm trying to run the program bayes-seg with: cat data/books/clinical/050.ref | ./segment config/dp.config using Powershell. I understand that the command cat outputs the file and pipe will use the...
View ArticlePowerShell is missing the terminator: "
I have the following script code#[string]$password = $( Read-Host "Input password, please" )param ( [string]$ReleaseFile = $(throw "-ReleaseFile is required"), [string]$Destination = $(throw...
View ArticleLaunch Metro style apps using powershell
I am trying to write a powershell script for windows 10 that will automatically launch a Metro-style app.The Start-Process cmdlet seems like it should work, but I cannot get it to launch anything...
View ArticleCopy-item Files in Folders and subfolders in the same directory structure of...
I am struggling really hard to get this below script worked to copy the files in folders and sub folders in the proper structure (As the source server).Lets say, there are folders mentioned below:Main...
View ArticlePowerShell script to upload multiple tables into MySQL workbench DB
I tried using the below script to achieve the solution programmatically instead of manually using the MySQL workbench window to import from self-Contained File located under a folder in C:\ drive>#...
View ArticleHow to address mutable parameters like datatime in Powershell?
We have a server that is running out of space (435Gb remaining) and we want to know when it will as new 1Gb files are created every 15 hours consistently. So, I've crafted a script where users can...
View ArticleImplement the subcommand pattern in PowerShell
Is it possible to implement the subcommand pattern in PowerShell? Something like:command [subcommand] [options] [files]Examples: Git, svn, HomebrewWhat would be the general architecture? A single...
View ArticlePowershell command to select one value
My PowerShell command is working fine as below :PS C:\Users\username> whoami /userUSER INFORMATION----------------User Name SID================...
View ArticleSetting Regional format with PowerShell
I'm trying to set some Regional Settings for all devices in my company. So far I didn't have any problems with Keyboard Layouts etc. but I can't find a way to control the highlighted settings with...
View ArticlePowerShell script to export Array in CSV format with Headers
I've below PS Script which connects to API and puts responses on an Array List.I'm struggling to convert Array List to CSV file and giving them a Column Header.Anyone got Idea how to this can be done...
View ArticlePowershell Try/Catch Exception to SQL
Hello I have a little problem regarding my error logging to SQL from powershell scripts.function Invoke-Sqlcmd { param( [Parameter(Position=0, Mandatory=$true ,ValueFromPipeline = $false)]...
View ArticlePowerShell Add-WindowsFeature unrecognized
Thanks first of all for reviewing this.I've basically got a third-party agent software which allows me to execute PowerShell as LocalSystem. This allows me to easily run remote PowerShell commands...
View Article