如何解决Power Shell中的TemplateFileType.ClientSidePage Null错误

时间:2019-05-17 12:33:26

标签: powershell sharepoint sharepoint-online

我想使用Power Shell通过共享点在线创建现代页面 把我在添加模板部分作为模板文件类型时不包含错误,不包括下面的代码中的ClientSidePage

我尝试了以下代码,但收到以下错误

  

无法为以下参数转换参数“ templateFileType”,其值为:“”   输入“ AddTemplateFile”   “ Microsoft.SharePoint.Client.TemplateFileType”:“无法转换为null   键入“ Microsoft.SharePoint.Client.TemplateFileType”是由于   无效的枚举值。指定以下之一   枚举值,然后重试。可能的枚举值为   “ StandardPage,WikiPage,FormPage”。“

var app = require(process.cwd() + '/app.js');
var chai = require('chai');
var ZSchema = require('z-schema');
var validator = new ZSchema({});
var supertest = require('supertest');
var api = supertest(app); // supertest init;

chai.should();

before(function(done) {
  function afterListening() {
    // Load customFormats now, to overwrite after sway pollutes them
    customFormats(ZSchema);
    done();
  }

  if (app.server.listening) return afterListening();

  app.on('listening', afterListening);
});

describe('/login', function() {
  describe('post', function() {
    it('should respond with 200 Success', function(done) {
      /*eslint-disable*/
      var schema = {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "response": {
            "type": "object",
            "properties": {
              "emailId": {
                "type": "string",
              },
              "name": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "role": {
                "type": "integer"
              },
              "userTeam": {
                "type": "string"
              },
              "token": {
                "type": "string"
              }
            }
          }
        }
      };

      /*eslint-enable*/
      api.post('/login')
        .set('Content-Type', 'application/json')
        .send({
          "emailId": "yyy@gmail.com",
          "password": "1234"
        })
        .expect(200)
        .end(function(err, res) {
          if (err) return done(err);
          validator.validate(res.body, schema).should.equal(true);
          done();
        });
    });

    it('should respond with 401 Validation failure.', function(done) {
      /*eslint-disable*/
      var schema = {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "code": {
            "type": [
              "string",
              "null"
            ]
          },
          "message": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      };

      /*eslint-enable*/
      api.post('/login')
        .set('Content-Type', 'application/json')
        .send({
          "emailId": "yyy@gmail.com",
          "password": "123dwqdwq4"
        })
        .expect(401)
        .end(function(err, res) {
          if (err) return done(err);
          validator.validate(res.body, schema).should.equal(true);
          done();
        });
    });

  });

});

与该链接相同

https://docs.microsoft.com/en-us/dotnet/api/microsoft.sharepoint.client.templatefiletype

存在ClientSidePage模板类型,可以帮助我创建现代页面

0 个答案:

没有答案