GCE Windows Instance not running startup scripts

PowerShell
I have been trying to apply my startup scripts to new Windows instances on Google Compute Engine as described here, however when I check the instances...
1 year ago

Is there a shorthand for the IF statement in PowerShell?

PowerShell
In bash, I often did things like: [ -z "${someEnvVar}" ] && someEnvVar="default value" Instead of creating a full-fledge if statement: if ...
1 year ago

Authentication error with webclient in powershell

PowerShell
I'm relatively new to Powershell so really not sure where to go with this issue now. I am trying to download a file from a subversion repository and...
1 year ago

Powershell : How to get Antivirus product details

PowerShell
We have over 1500 servers. Windows 2003, 2008 and 2012. I have to gather the details of antivirus(Product Name & Version) on these servers. There ...
1 year ago

Powershell script that imports from CSV, checks AD account status, then exports to CSV

PowerShell
I am writing a Powershell script to take a CSV file of Active Directory accounts, validate each account, and write the validation status back to a sep...
1 year ago

Unable to sort a 2D array in powershell

PowerShell
I'm getting some unique results with this little guy clear $Datas = @{} $Datas["Database1"] = "440" $Datas["Database2"] = "140" $Datas["Database3"] =...
1 year ago

Import-CSV add data Export

PowerShell
I'm having a heck of a time trying to import a CSV and run a Invoke-WebRequest to get data to add to a new Column.. $username = "Username" $password...
1 year ago

Zabbix script timeout

PowerShell
I'm trying to run powershell script for cleaning disk on agent from Zabbix. Seems that script is running too long and instead response I got error. p...
1 year ago

Script to get CPU Usage

PowerShell
I am using this script to get CPU usage from multiple server $Output = 'C:\temp\Result.txt' $ServerList = Get-Content 'C:\temp\Serverlist.txt' $CPUPe...
1 year ago

Can I make powershell tab complete show me all options, rather than picking a specific one?

PowerShell
In Powershell, if I type: install-<tab> Powershell tab completion will complete with a single command that starts with install- Install-Pack...
1 year ago

Restricting Powershell Commands by Version

PowerShell
I'm writing a Powershell script (on a Win10 machine) that needs to be backward-compatible all the way to Win7 machines - which shipped with Powershell...
1 year ago

How to add application to Azure AD programmatically?

PowerShell
I want to automate the creation of my application in Azure AD and get back the client id generated by Azure AD. Are there PowerShell commandlets to d...
1 year ago

How to find MAX RAM in powershell

PowerShell
How to find the maximum RAM a computer can be extended upto in powershell. I tried using $colItems3 = get-wmiobject -class "Win32_OperatingSystem" ...
1 year ago

Using Variable in Remove-Item returns "A drive with the name '"E' does not exist"

PowerShell
I have been writing a script which searches for specific folders within an "Archive" folder and then zips them. Once the folder is successfully zipped...
1 year ago

PowerShell script to return versions of .NET Framework on a machine?

PowerShell
What would a PowerShell script be to return versions of the .NET Framework on a machine? My first guess is something involving WMI. Is there somethin...
1 year ago

Sort and export-CSV

PowerShell
I have a csv file containing rows of the following extract: "EmployeeID","FirstName","LastName","Location","Department","TelephoneNo","Email" "0...
1 year ago

PS - Parameter's default value in Visual Studio 2015

PowerShell
I'm making a PowerShell script, and I've found something strange happening with my Visual Studio 2015. When I'm trying to assign value to sciript's pa...
1 year ago

Add child node at the beginning of XML

PowerShell
I am trying to add a child node in the following XML. I am able to, but my issue is it adds it at the end. How am I able to add the node at the beginn...
1 year ago

PowerShell renaming multiple files with upcounting variable

PowerShell
I have several files in my folder which look like this: PM.KDP_client_provide_123_SE.xml PM.KDP_client_provide_124_SE.xml PM.KDP_client_provide_125_S...
1 year ago

Overwriting specific Line in multiple Files using PowerShell with User Input

PowerShell
Im trying to get my PowerShell Script to read the specific line 8 on different .ctl files in multiple folders and overwrite it using a premade text an...
1 year ago