Quantcast
Channel: Windows PowerShell forum
Viewing all 21975 articles
Browse latest View live

PowerShell load data from excel to SQL Server table

$
0
0

I am dynamically loading different files from excel files to SQL server tables. Some of the files have millions of rows. Since this is a dynamic process I have decided to use PowerShell. The script below works perfectly well for small files. Big files are partially loaded before the process errors.  I was wondering if someone can help me improve my script so that it can load in batches (say 100 000 rows per time) instead of trying to get everything into memory first and then bulk load it to the destination table. I have seen a few examples online where the process is set to loop on the data files line by line. While that works, it however takes AGES.

 

$filepath='directory_path\my_excel_file.xls'

#Connection String for Excel 2007:

$connString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=`"$filepath`";Extended Properties=`"Excel 12.0Xml;HDR=YES`";"

#Connection String for Excel 2003:

#$connString ="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=`"$filepath`";Extended Properties=`"Excel 8.0;HDR=Yes;IMEX=1`";"

$qry='select * from [Sheet1$]'

$sqlserver='my_server_name'

$dbname='my_target_database'

#Create a tablein destination databasewith the with referenced columns andtable name.

$tblname='temp_PATALGCD'

#######################

functionGet-ExcelData

{

   param($connString,$qry='select * from [sheet1$]')

   $conn= new-objectSystem.Data.OleDb.OleDbConnection($connString)

   $conn.open()

   $cmd= new-objectSystem.Data.OleDb.OleDbCommand($qry,$conn)

   $da= new-objectSystem.Data.OleDb.OleDbDataAdapter($cmd)

   $dt= new-objectSystem.Data.dataTable

   [void]$da.fill($dt)

   $conn.close()

   $dt

} #Get-ExcelData

#######################

function Write-DataTableToDatabase

{

   param($dt,$destServer,$destDb,$destTbl)

   $connectionString ="Data Source=$destServer;Integrated Security=true;Initial Catalog=$destdb;"

   $bulkCopy= new-object("Data.SqlClient.SqlBulkCopy")$connectionString

   $bulkCopy.DestinationTableName="$destTbl"

   $bulkCopy.WriteToServer($dt)

}# Write-DataTableToDatabase

#######################

$dt=Get-ExcelData$connString$qry

Write-DataTableToDatabase$dt$sqlserver $dbname$tblname

 


Mpumelelo


Trouble with DDG Filter in O365

$
0
0

Hi,

I have set up a DDG in my org's Office 365 E2 plan, which was intended to include all accounts in the domain (an allstaff mailing address, basically). There is a need to filter a single person off of this list. For the sake of granularity I decided to filter based on "Title". Here's the filter copied from the membership section of the DDg in exchange admin-

((-not(Title -eq 'Trustee')) -and (-not(Name -like 'SystemMailbox{*')) -and (-not(Name -like 'CAS_{*')) -and (-not(RecipientTypeDetailsValue -eq 'MailboxPlan')) -and (-not(RecipientTypeDetailsValue -eq 'DiscoveryMailbox')) -and (-not(RecipientTypeDetailsValue -eq 'PublicFolderMailbox')) -and (-not(RecipientTypeDetailsValue -eq 'ArbitrationMailbox')) -and (-not(RecipientTypeDetailsValue -eq 'AuditLogMailbox')) -and (-not(RecipientTypeDetailsValue -eq 'AuxAuditLogMailbox')))

I set this up with powershell and from what I can tell, the filter is set up correctly.

However, when sending emails to this list, users with Title = Trustee still receive the email.

I have tried this with various other properties like Custom attributes, setting up a security group and adding members to that, and omitting it with a filter in the same manner as above, but none have worked. I must surely be overlooking something simple. Can anyone please help me?

thanks in advance

Powershell Filter with Where-Object clause

$
0
0

Can I add a piped "Where-Object {@(Get-ADGroupMember $_).Length -ne 0}" to the $directorySearcher.Filter statement?  How would the syntax look?

 $directorySearcher = New-Object System.DirectoryServices.DirectorySearcher
 $directorySearcher.SearchRoot = (New-Object System.DirectoryServices.DirectoryEntry(("LDAP://" + (Get-LocalDomainController $domain) + "/" + (Get-DomainDn $domain))))
 $directorySearcher.Filter = "(&(objectClass=group)(objectCategory=group)(sAMAccountName=$sAMAccountName))"
Thank you.

Why do I get an exception calling 'ReadKey'?

$
0
0

Hello,

I run the following code in my script.  What displays is 'Press any key to continue' which is the intent, but then the following error occurs without a key being pressed and the script proceeds.  I dont understand the error. Any insight as to why I see this error?

write-Host "Press any key to continue.."
$x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")

Exception calling "ReadKey" with "1" argument(s): "The method or operation is not
implemented."
At C:\adtest.ps1:247 char:1+ $x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo          : NotSpecified: (:) [], MethodInvocationException+ FullyQualifiedErrorId : NotImplementedException


Thanks for your help! SdeDot

bcdedit commands not working

$
0
0

I am trying to use bcdedit from within a PowerShell window. PowerShell window is launched as administrator, so it has privileges, and other privileged commands appear to work fine. But it seems like bcdedit is not working properly in a PowerShell window.

PS C:\Users\Administrator> bcdedit /copy {current} /d New
The copy command specified is not valid.
Run "bcdedit /?" for command line assistance.
The parameter is incorrect.

If I issue the exact same command from a command window, it works just fine.

C:\Windows\system32>bcdedit /copy {current} /d new
The entry was successfully copied to {30070d01-4e58-11e4-a80d-fc88c48f0475}.
I have the same issue with other bcdedit commands, not all, just some, such as set and delete; seems like read commands work fine but update don't.  Is there something special I have to do to get bcdedit to work within a PowerShell window?  I have tried this on Windows 8.1, Windows 10, Windows Server 2012 R2, and Windows Server 2016 all with the same results.  It's not that big of a deal to have to open a command window, but it seems a little strange.


. : | : . : | : . tim

Get-ADObject return long names that shows as "..."

$
0
0

Hi Powershell guy's,

When running the command 

Get-ADObject -Filter 'ObjectClass -eq "serviceConnectionPoint" -and Name -eq "Microsoft Hyper-V"'

The output gets cut and added "..." at the end

CN=Microsoft Hyper-V,CN=BA... Microsoft Hyper-V             serviceConnectionPoint        c2cc2adc-14bb-4cfa-b895-d0...
CN=Microsoft Hyper-V,CN=HY... Microsoft Hyper-V             serviceConnectionPoint        7642438b-6308-425f-bfba-ac...
CN=Microsoft Hyper-V,CN=RE... Microsoft Hyper-V             serviceConnectionPoint        cc25aa28-81c4-4b9a-a3b2-6c...
CN=Microsoft Hyper-V,CN=JE... Microsoft Hyper-V             serviceConnectionPoint        cd1bf4a8-5e96-4ba4-bce3-6d...

How can i run the same command and to have full text fields instead of the "..." ?

Scripts to extract member of the group and sub - groups

$
0
0

Hi All,

Can anyone provide with script to extract the disabled user in group and its sub group or nesting group

Thanks


NA

Change/Calculate value in CSV file

$
0
0

Hi,

I have a CSV file with this structure

(Initially the Column4 is empty and presented values have to be calculated with PowerShell)

Column1 Column2 Column3 Column4
Name1 001 25 Name1 001 25;Name1 01 25;Name1 1 25;Name1 001/25;Name1 01/25;Name1 1/25
Name2 085 30 Name2 085 35;Name1 85 35;Name1 85/35;Name1 085/35
Name3 191 35 Name3 191 35; Name3 191/35
 

Based on the first three column I have to build the last one, in such a way to have all possible values separated by space or /.

As can be seen, the second column have numeric values. These have to be represented in column 4 with all their possible values:

- for 001: 001, 01 and 1

- for 085: 085 and 85

- for 191: 191

Initially, in the CSV file the Column4 is empty.

How can I fill in those values in Column4 using PowerShell?

Thanks in advance for any suggestion.


OvidiuG



Certificate-Based Authentication for Windows PowerShell

$
0
0

Hello,

I have two domain controllers in two separate domains. For security reasons, no trust exists between the two domains, and no credentials can be passed.

How can I use certificate-based authentication to invoke a command from one domain controller to the other? For example to lookup users in Active Directory using PowerShell's Get-ADUser command?

Thanks in advance


Hazem Elshabini

Subfolder archiving script

$
0
0

Hi Guys,

I'm trying to write a script to archive subfolders containing job files to a different location on our server once they get to a certain age, but I'm getting a bit lost. I've looked at commands like Get-Childitem, Forfiles, Attrib, Xcopy etc but I'm not sure of the best approach...

Here's what I want to do:

We have individual 'job' folders on our server which can contain a mix of files and subfolders. These job folders are stored alphabetically in specific 'client' folders, e.g.
D:\Live Jobs\A\ABC Client\ABC123 First Job
D:\Live Jobs\A\ABC Client\ABC678 Another Job
D:\Live Jobs\A\AXY Company\AXY345 Job Thing
D:\Live Jobs\B\BCD Limited\BCD234 Some Other Job

I want to be able to identify any of the JOB folders within this directory structure that have had nothing in them modified in the last 90 days, and move them to another location, with the full directory structure intact, e.g:
Move D:\Live Jobs\A\ABC Client\ABC678 Another Job  to  D:\Archived Jobs\A\ABC Client\ABC678 Another Job

Can anyone advise on the correct commands and syntax to achieve this? I'm mostly stuck trying to isolate the specific level of the job folders in the directory...

Thanks!

Rob

test-connection cmdlet

$
0
0
Hello i would like to run a command that will ping all servers in AD using the test-connection  -computername command but have it read from a list of server names in a text file using 
test-connection -computername (get-content "c:\users\username\desktop\serverlisting1.txt") | select address,destination,ipv4address,bytes,times | export-csv "c:\users\eorosz\desktop\serverping.csv"
however I would like the output to show the results as "UP" or "Down" on the export csv file. I found a script 
$inputFile = "C:\Users\username\Desktop\serverlisting1.txt"

$OutputFile = "C:\Users\username\Desktop\Report.csv"

$servers = Get-Content $inputFile

$collection = $()

foreach ($server in $servers)

{

    #$status = @{ "ServerName" = $server; "TimeStamp" = (Get-Date -f s) }

    if (Test-Connection $server -Count 1 -ea 0 -Quiet)

    {

        $status["Results"] = "Up"

    }

    else

    {

        $status["Results"] = "Down"

    }

    New-Object -TypeName PSObject -Property $status -OutVariable serverStatus

    $collection += $serverStatus

}

$collection | export-csv $OutputFile -NoTypeInformation
but my companies environment won't let me run a script in powershell so i'm look for a few command lines that would get me the same result.  

Conncet to Office 365 through Visual studio ASP.net Web application

$
0
0

Hi Every one,

How to connecting a Office 365 through Asp.Net web application.

Pl advice me.

Querying Search-ADAccount to different domain returned out of memory error

$
0
0

While executing below command receiving memory error for one domain where as am able to get list of user account which are about to expire in two days for another domain. Do we have any option to increase memory size at the time of execution. Tried with -ResultSetsize parameter to $null, but no luck

$serverdom = "domain.test.com"

PS C:\> Search-ADAccount -AccountExpiring -TimeSpan "2" -UsersOnly -Server $serverdom -Credential $(Get-Credential)

cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
Credential

Search-ADAccount : Server returned out of memory error.
At line:1 char:17
+ Search-ADAccount <<<<  -AccountExpiring -TimeSpan "2" -UsersOnly -Server $serverdom -Credential $(Get-Credential)
    + CategoryInfo          : NotSpecified: (:) [Search-ADAccount], ADException
    + FullyQualifiedErrorId : Server returned out of memory error.,Microsoft.ActiveDirectory.Management.Commands.Searc
   hADAccountCmdlet

PS C:\>


Powershell expression

$
0
0

Hi,

I am new to powershell expressions. I have one expression "^\w{4,5}-\d{2}$" . Can someone help me to decode this expression ? What it will match to?

Iterate trough folder to see the permissions (SharePoint 2013 CSOM)

$
0
0

Hi,

In a SharePoint App we have a document library (documentlibrary) where I want to see the permissions of a specific folder called  Attachments.

Can someone help me?

$SiteURL = "https://apps-f3409b67f3bfbd.apps.sitecollection"

Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"

$User = Read-Host -Prompt "username"
$password = Read-Host -Prompt "Enter password" -


$Context = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
$credentials = New-Object System.Net.NetworkCredential($User, $password)
$Context.Credentials = $credentials
$context.RequestTimeOut = 5000 * 60 * 10;
$web = $context.Web
$site = $context.Site
$context.Load($web)
$context.Load($site)

try
{
  $context.ExecuteQuery()
}
catch
{
  Write-Host "Impossible to reach $SiteURL : bad password ?" -foregroundcolor black -backgroundcolor Red
  return
}

$listTitle = "documentlibrary"
$list = $Context.Web.Lists.GetByTitle("$listTitle")
$context.Load($list)
$context.ExecuteQuery()

$Context.load($list.Rootfolder.Folders)
$context.ExecuteQuery()

foreach ($folder in $list.Rootfolder.Folders){

    if($folder.Name -eQ "Attachments"){

        #Here is where I'm stuck...

   }
}




    







Register-ObjectEvent works in PS2.0 but not in PS4.0 with custom assembly (Citrix ICO SDK)

$
0
0

Hello,

i trying to write a little automation script with citrix ico sdk. I followed the tutorial atIca-connections-using-powershell.

If i try to Register-Objectevent on the icaclient object, with powershell2.0 everything works fine. After installing WMF4.0 and using Powershell 4.0 the events are registered (there is a event subscriber) but the events aren't fired. (only change was installation of WMF4.0) on an Windows 2008R2 x64 server.

In my researches i found, that in powershell 4 the events are shown if i call "New-Pssession srvxxxx -credential $cred". The events "TimeGenerated" is exactly the time where "New-Pssession" is called. Not the time where i trigger the "onConnectFail" event of the clientobject.

This behaviour is not general to all events, only events of the icaClientObject don't work.

Any thoughts on what have changed between the Powershell versions, that the event handling doesn't work for this kind of objects? Are there any further debugging methods? What happens with the call of New-Pssession, and why the events are shown/fired on this call?

Please help me with debugging this strange behaviour.

How to create multiple VM in a cloud service using C# Rest API

$
0
0
I have created a VM using C# Rest API. But I need to create multiple deployments in same cloud service using C# rest API. Please let me know is there any solution. Thanks in advance.

PowerShell GUI Output Issue

$
0
0

I'm trying to get the output of my GUI script to display in the output filed... however it's not working.. I see that it $returns but won't place in the $output field... any suggestions?

function button ($title, $srv, $GB, $VL, $scope, $rtr, $gtw, $sbm, $psid, $adr, $stid) {

    #Load Assembly for creating form & button

    [void][System.Reflection.Assembly]::LoadWithPartialName( “System.Windows.Forms”)
    [void][System.Reflection.Assembly]::LoadWithPartialName( “Microsoft.VisualBasic”)

    #Define the form size & placement

    $form = New-Object “System.Windows.Forms.Form”;
    $form.Width = 359;
    $form.Height = 670;
    $form.Text = $title;
    $form.StartPosition = [System.Windows.Forms.FormStartPosition]::CenterScreen;

    #Define the output box

    $outputBox = New-Object System.Windows.Forms.TextBox
    $outputBox.Location = New-Object System.Drawing.Size(10,395)
    $outputBox.Size = New-Object System.Drawing.Size(322,200)
    $outputBox.MultiLine = $True
    $outputBox.ScrollBars = "Vertical"
    $Form.Controls.Add($outputBox)

   
    #Define text label1

    $textLabel1 = New-Object “System.Windows.Forms.Label”;
    $textLabel1.Left = 10;
    $textLabel1.Top = 17;
    $textLabel1.Width = 80

    $textLabel1.Text = $srv;

    #Define text label2

    $textLabel2 = New-Object “System.Windows.Forms.Label”;
    $textLabel2.Left = 10;
    $textLabel2.Top = 54;
    $textLabel1.Width = 80

    $textLabel2.Text = $GB;

    #Define text label3

    $textLabel3 = New-Object “System.Windows.Forms.Label”;
    $textLabel3.Left = 10;
    $textLabel3.Top = 94;
    $textLabel1.Width = 80

    $textLabel3.Text = $VL;

    #Define text label4

    $textLabel4 = New-Object “System.Windows.Forms.Label”;
    $textLabel4.Left = 10;
    $textLabel4.Top = 132;
    $textLabel4.Width = 80

    $textLabel4.Text = $scope;

    #Define text label5

    $textLabel5 = New-Object “System.Windows.Forms.Label”;
    $textLabel5.Left = 10;
    $textLabel5.Top = 172;
    $textLabel5.Width = 80

    $textLabel5.Text = $rtr;

    #Define text label6

    $textLabel6 = New-Object “System.Windows.Forms.Label”;
    $textLabel6.Left = 10;
    $textLabel6.Top = 212;
    $textLabel6.Width = 80

    $textLabel6.Text = $gtw;

    #Define text label7

    $textLabel7 = New-Object “System.Windows.Forms.Label”;
    $textLabel7.Left = 10;
    $textLabel7.Top = 253;
    $textLabel7.Width = 80

    $textLabel7.Text = $sbm;

    #Define text label8

    $textLabel8 = New-Object “System.Windows.Forms.Label”;
    $textLabel8.Left = 10;
    $textLabel8.Top = 293;
    $textLabel8.Width = 80

    $textLabel8.Text = $psid;

    #Define text label9

    $textLabel9 = New-Object “System.Windows.Forms.Label”;
    $textLabel9.Left = 10;
    $textLabel9.Top = 333;
    $textLabel9.Width = 80

    $textLabel9.Text = $adr;

    #Define text label10

    $textLabel10 = New-Object “System.Windows.Forms.Label”;
    $textLabel10.Left = 10;
    $textLabel10.Top = 373;
    $textLabel10.Width = 80

    $textLabel10.Text = $stid;

    #Define text box1 for input

    $textBox1 = New-Object “System.Windows.Forms.TextBox”;
    $textBox1.Left = 200;
    $textBox1.Top = 12;
    $textBox1.width = 126;

    #Define text box2 for input

    $textBox2 = New-Object “System.Windows.Forms.TextBox”;
    $textBox2.Left = 200;
    $textBox2.Top = 47;
    $textBox2.width = 126;

    #Define text box3 for input

    $textBox3 = New-Object “System.Windows.Forms.TextBox”;
    $textBox3.Left = 200;
    $textBox3.Top = 87;
    $textBox3.width = 126;

    #Define text box4 for input

    $textBox4 = New-Object “System.Windows.Forms.TextBox”;
    $textBox4.Left = 200;
    $textBox4.Top = 127;
    $textBox4.width = 126;

    #Define text box5 for input

    $textBox5 = New-Object “System.Windows.Forms.TextBox”;
    $textBox5.Left = 200;
    $textBox5.Top = 167;
    $textBox5.width = 126;

    #Define text box6 for input

    $textBox6 = New-Object “System.Windows.Forms.TextBox”;
    $textBox6.Left = 200;
    $textBox6.Top = 207;
    $textBox6.width = 126;

    #Define text box7 for input

    $textBox7 = New-Object “System.Windows.Forms.TextBox”;
    $textBox7.Left = 200;
    $textBox7.Top = 247;
    $textBox7.width = 126;

    #Define text box8 for input

    $textBox8 = New-Object “System.Windows.Forms.TextBox”;
    $textBox8.Left = 200;
    $textBox8.Top = 287;
    $textBox8.width = 126;

    #Define text box9 for input

    $textBox9 = New-Object “System.Windows.Forms.TextBox”;
    $textBox9.Left = 200;
    $textBox9.Top = 327;
    $textBox9.width = 126;

    #Define text box10 for input

    $textBox10 = New-Object “System.Windows.Forms.TextBox”;
    $textBox10.Left = 200;
    $textBox10.Top = 367;
    $textBox10.width = 126;


    #Define default values for the input boxes
    $defaultValue = “”
    $textBox1.Text = $defaultValue;
    $textBox2.Text = $defaultValue;
    $textBox3.Text = $defaultValue;
    $textBox4.Text = $defaultValue;
    $textBox5.Text = $defaultValue;
    $textBox6.Text = $defaultValue;
    $textBox7.Text = $defaultValue;
    $textBox8.Text = $defaultValue;
    $textBox9.Text = $defaultValue;
    $textBox10.Text = $defaultValue;

    #define OK button

    $button = New-Object “System.Windows.Forms.Button”;
    $button.Left = 8;
    $button.Top = 600;
    $button.Width = 100;
    $button.Text = “Ok”
    $button.DialogResult = [System.Windows.Forms.DialogResult]::OK

    #define Cancel button

    $CancelButton = New-Object "System.Windows.Forms.Button";
    $CancelButton.Left = 232;
    $CancelButton.Top = 600;
    $CancelButton.Width = 100;
    $CancelButton.Text = "Cancel"
    $CancelButton.DialogResult = [System.Windows.Forms.DialogResult]::Cancel

       
    #This is when you have to close the form after getting values

    $eventHandler = [System.EventHandler]{
    $textBox1.Text;
    $textBox2.Text;
    $textBox3.Text;
    $textBox4.Text;
    $textBox5.Text;
    $textBox6.Text;
    $textBox7.Text;
    $textBox8.Text;
    $textBox9.Text;
    $textBox10.Text;
    $form.Close();};
    $button.Add_Click($eventHandler) ;

    #Add controls to all the above objects defined

    $form.Controls.Add($button);
    $form.Controls.Add($CancelButton);
    $form.Controls.Add($textLabel1);
    $form.Controls.Add($textLabel2);
    $form.Controls.Add($textLabel3);
    $form.Controls.Add($textLabel4);
    $form.Controls.Add($textLabel5);
    $form.Controls.Add($textLabel6);
    $form.Controls.Add($textLabel7);
    $form.Controls.Add($textLabel8);
    $form.Controls.Add($textLabel9);
    $form.Controls.Add($textLabel10);
    $form.Controls.Add($textBox1);
    $form.Controls.Add($textBox2);
    $form.Controls.Add($textBox3);
    $form.Controls.Add($textBox4);
    $form.Controls.Add($textBox5);
    $form.Controls.Add($textBox6);
    $form.Controls.Add($textBox7);
    $form.Controls.Add($textBox8);
    $form.Controls.Add($textBox9);
    $form.Controls.Add($textBox10);
    $ret = $form.ShowDialog();

    #return values

    return $textBox1.Text, $textBox2.Text, $textBox3.Text, $textBox4.Text, $textBox5.Text, $textBox6.Text, $textBox7.Text, $textBox8.Text, $textBox9.Text, $textBox10.Text

    }
 
    $return= button “DHCP Request Info” “DHCP Server:” “Scope ID:” “VLAN ID:” "Group Branch:" "Router:" "Gateway:" "SubnetMask:" "PeopleSoft ID:" "Address:" "Station ID:"

    $return[0]
    $return[1]
    $return[2]
    $return[3]
    $return[4]
    $return[5]
    $return[6]
    $return[7]
    $return[8]
    $return[9]
    $return[10]

 

PowerShell ISE PROXY issue

$
0
0

Hi All,

We have a Proxy in our environment. I have been using the following code to get through proxy both in PowerShell and PowerGUI:

[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials
$webclient=New-Object System.Net.WebClient

OR


$webclient=New-Object System.Net.WebClient
$webclient.Proxy.Credentials = $CloudAdmin

It is still working fine, while in PowerShell ISE I'm getting:

The property 'Credentials' cannot be found on this object. Verify that the property exists and can be set.
At line:3 char:1+ $webclient.Proxy.Credentials=$creds+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo          : InvalidOperation: (:) [], RuntimeException+ FullyQualifiedErrorId : PropertyNotFound

Any Ideas?
Thanks!

Where is "" documented?

$
0
0

Hi,

Searching for "switchparameter documentation" or just "switchparameter" brings no obvious clarity to my fuzzy mind.

I just changed from PS1 to PS3, and it seems that all singleton cmdlet switches, like -force, seem to have an argument now, called <SwitchParameter>.

Examples with observed different notations:

[-Confirm <SwitchParameter>] [-Force [<SwitchParameter>]] (seen, but cannot find now)

[-WhatIf <SwitchParameter>]

[[-Force] <SwitchParameter>]  (in Get-EventSubscriber)


Can anyone tell me where to find documentation for this parameter to a parameter?

TIA,

Eb

Viewing all 21975 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>