compare-object $srcObjScript $tgtObjScript
Hi, I am debugging old scriptwhile running with debugger from PS5 ISEand I step using F10 and capture compare-object $srcObjScript $tgtObjScriptI get output InputObject &nb
View ArticleCannot bind argument in Foreach-Object
I'm newish to Powershell and got bits of this code off the internet. I thought that using a Foreach-Object and Get-ChildItem together would automatically terminate my loop after the last file was sent,...
View ArticleUploading/downloading items from SSRS
Hi allWe have two environments (DEV and PROD) and we need to transfer reports between the two.I've found a Powershell script to download all the items (including the data sources) from our DEV...
View ArticleGet Machine Name
Hi,I need to return the current name of the machine i'm running my script on please.I know how to do this for a standalone machine, but this is a cluster of 3 servers. I need the cluster name - NOT the...
View ArticlePowerShell Error SQL Server SMO
Hi,I want to read information regarding SQL Server Extended Events.In VB.net:
View ArticleHow can i get properties of an object in order / variable substitution question
Hi all,I have an object, $Report, with 5 properties. Its an Array of datarows, returned from an SQL Query. The columns are as follows: FirstCol, SecondCol, ThirdCol, FourthCol, FifthColWhen i do a...
View ArticleDisk space report showing wrong results
Hi Experts, Need some powershell help. Issue Descrition: I work as SQL Server DBA and we monitor servers using powershell scripts. So, we have one such script to monitor disk free space of multiple...
View ArticleNeed to move the file from client's ftp to local server using powershell
I don't know PowerShell but I have no choice but to use it for what I am trying to achieve. I need to move the backup file which client put on their ftp folder everyday. I am also given a credential...
View ArticleDelete multiple SSRS reports from report portal using Powershell
Hi,Is there a way to delete multiple SSRS reports using powershell. I have a request to delete about 100 reports from different folders from report portal. All I have a report path and I hope there is...
View ArticlePowershell script transfers entire directory?
I've got a powershell script I'm using to send one file via SFTP. The only problem? It's copying everything in the directory instead of just the one file. It's got to be something in my variable set...
View ArticlePowershell Restore over another databse
Hi,I am trying to script to restore over a DB, however this fails because it tries to over write the original database.The script i have is as...
View ArticleParameters with prompts
Hi allI'm new to Powershell and Google didn't turn up anything useful (or that I could get working) so I'm here asking for help.I've got a script that requires parameters but I'd like a slightly better...
View ArticleHelp me hate PowerShell a little less, please.
I found an interesting and useful PoSh script at the following URL:http://woshub.com/get-adcomputer-getting-active-directory-computers-info-via-po
View ArticleChange Service account password for multiple servers using T-SQL query or WMI...
Can anyone help to understand if there is any T-SQL query or WMI Script or PowerShell script or SSIS script to update S
View ArticleError to Retrieve DB status
Hi All,Could someone correct the error messages in this PowerShell script used to retrieve DB status.$isodate=Get-Date -format s$isodate=$isodate -replace(":","")$basepath=(Get-Location -PSProvider...
View ArticlePowershell connecting to multiple instances
I am new to Powershell and I am currently trying to figure out why the below is not returning the server\instance as part of the script. I am guessing its because of the named instance and the '\'It is...
View ArticleDefault values set for $param in advanced function
How can I specify a list of values for an advanced function?For example, I want to write a function with a parameter called $ReportingPeriod. I only want to allow 5 selections to be allowed. More to...
View ArticleException calling "ScriptTransfer" with "0" argument(s): "Script transfer...
Hello,while running this script, getting error -Exception calling "ScriptTransfer" with "0" argument(s): "Script transfer failed. "For any dB it is exactly working fine, but for few it fails.
View ArticleInstall SQL Server Named Instance using silent install PowerShell
HiDoes anyone works on SQL Server Named install using PowerShell using .ini files?If you have any runnable script please share.Basically want to have the flexibility of both default and named install...
View ArticleGroup-object
This should be simple, but I'm having trouble with suming values across groups:[code language="sql"]$a = @()$b = New-Object pscustomobject -property @{TypeName = "Type A"; TypeId = "12"; Calls = 43}<
View Article