I am getting the following error while using the command "Get-PnPFolderItem"
Get-PnPFolderItem : The property or field 'ServerRelativeUrl' has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested.
I checked the documentation and there is no reference of it
Get-PnPFolderItem
[-FolderSiteRelativeUrl <String>]
[-ItemType <String>]
[-ItemName <String>]
[-Web <WebPipeBind>]
[-Connection <SPOnlineConnection>]
Per my test, the command "Get-PnPFolderItem" works fine on my environment. So, yes it should be part of the command Get-PnPFolderItem.
Please maek sure the version of your SharePointPnPPowerShellOnline is the lastest. Also try to connect another site and check if it works.
Related
I am wondering if there is any PowerShell script which can help to modify the timestamp of the existing ADF trigger. I want to change the time of my pipeline trigger in UAT as we don't have permission to do that manually from portal.
Set-AzDataFactoryV2Trigger
[-Name] <String>
[-DefinitionFile] <String>
[-ResourceGroupName] <String>
[-DataFactoryName] <String>
[-Force]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
The Set-AzDataFactoryV2Trigger cmdlet creates a trigger in a data factory. If you specify a name for a trigger that already exists, the cmdlet prompts for confirmation before replacing the trigger. If you specify the Force parameter, the cmdlet replaces the existing trigger without prompting for confirmation. Triggers are created in the 'Stopped' state, meaning that they don't immediately begin invoking pipelines that they reference.
Refer this official documentation for sample example and syntax.
I'm new to EF 6 and struggling how to easily apply migrations to the "remote" database. My local database is SQL Server Express and my remote database is SQL Server at GoDaddy. When I apply migrations and update the database, it appears to use the connection string from my web.config. The way I was able to apply the migration to my remote database was to swap the connection strings from my Web.Release.config and web.config files and then perform an Update-Database -TargetMigration {name of the migration}.
Are there any commands that I can use to target a specific database (without swapping the connection strings)? I've used get-help update-database but can't seem to find what I'm looking for.
Thank you
You need to apply command line switch.
Update-Database [-SourceMigration <String>] [-TargetMigration <String>] [-Script] [-Force]
[-ProjectName <String>] [-StartUpProjectName <String>] [-ConfigurationTypeName <String>]
-ConnectionString <String> -ConnectionProviderName <String>
[-AppDomainBaseDirectory <String>] [<CommonParameters>]
EF Migrations Command Reference
I try to sign my ps.1 file and wanted to create a code signing certificate but my New-SelfSigningCertificate does not have the parameter -Type in the function.
I use PowerShell 5.1.
When I use Get-Help, the description oddly enough also displays much less parameters than on the microsoft website. Opening the online help via Get-Help does not work because the URI is not specified.
The Help content:
SYNTAX
New-SelfSignedCertificate [-DnsName <string[]>] [-CloneCert <Certificate>]
[-CertStoreLocation <string>] [-WhatIf] [-Confirm] [<CommonParameters>]
Am I using an outdated version? Is this command only properly available in Win 10 or Server 2016?
I'm using Entity framework code first and I have almost 10 migrations now. I found a design issue and some of the DBMigrations are not what I expected and I want to re-generated the database.
How to discard all these existed migrations and regenerate the tables on development database? (delete all the cs files under Migrations folder and delete the database? What if I want to keep the first xxxxxx_InitialCreate.cs and restart from there?)
What if the database already published to production database server? What's the best way to sync the development database/migrations and production database/migrations?
You could revert to that initial migration
Update-Database [-SourceMigration <String>] [-TargetMigration <String>]
[-Script] [-Force] [-ProjectName <String>] [-StartUpProjectName <String>]
[-ConfigurationTypeName <String>] -ConnectionString <String>
-ConnectionProviderName <String> [<CommonParameters>]
is the Syntax so:
Update-Database -TargetMigration InitialCreate
reverts your database to the initial migrationFor the second part I would just change the connection string to the production database and run the migration again. No loss of data should occur.
I am learning powershell, so first i am learning how to use the help system of powershell. Below is the help for command "Get-EventLog",
what do we mean by : Position? named
Also is there any links to get more on how to use the help system
provided by powershell?
Synopsis
Gets the events in an event log, or a list of the event logs, on the local or remote computers.
Syntax Get-EventLog [-LogName] <String> [[-InstanceId] <Int64[]>] [-After <DateTime>] [-AsBaseObject <SwitchParameter>] [-Before <DateTime>] [-ComputerName <String[]>] [-EntryType <String[]>] [-Index <Int32[]>] [-Message <String>] [-Newest <Int32>] [-Source <String[]>] [-UserName <String[]>] [<CommonParameters>]
Get-EventLog [-AsString <SwitchParameter>] [-ComputerName <String[]>] [-List <SwitchParameter>] [<CommonParameters>]
Parameters
-After <DateTime>
Gets only the events that occur after the specified date and time. Enter a DateTime object, such as the one returned by the Get-Date cmdlet.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-InstanceId <Int64[]>
Gets only events with the specified instance IDs.
Required? false
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
-LogName <String>
Specifies the event log. Enter the log name (the value of the Log property; not the LogDisplayName) of one event log. Wildcard characters are not permitted. This parameter is required.
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
For #1, you need to understand how positional parameters are used in PowerShell. You can refer to the following scripting guys article on that.
http://blogs.technet.com/b/heyscriptingguy/archive/2012/04/22/the-problem-with-powershell-positional-parameters.aspx
For #2, in PowerShell v3, there is update-able help. By default, on PowerShell 3.0 systems, there is no help installed. Everything is online. You can download the help content using Update-Help and Save-Help cmdlets.
Also, Get-Help <cmdletname> -Online shows the online (most up-to-date) content for any cmdlet.
You can use the about topics in PowerShell to learn the concepts. These about topics can be accessed using help about*. You will see a huge list of topics which can be accessed using help or Get-Help. For example,
help about_Parameters
Once again, if you are using PowerShell 3.0, you need to update the help first to be able to see any help content.
You can first have a look to about_Command_Syntax
get_help about_Command_Syntax
Then have a look at a few other abouts, if you want to add your own help to your Cmd-Lets have a look here.