@pnp/cli-microsoft365 7.7.0-beta.8a32d54 → 7.7.0-beta.cec4ca2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +1 -0
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/cli/cli.js +7 -3
- package/dist/m365/entra/commands/user/user-list.js +20 -7
- package/dist/m365/spe/commands/containertype/containertype-add.js +115 -0
- package/dist/m365/spe/commands.js +5 -0
- package/dist/m365/spfx/commands/spfx-doctor.js +197 -92
- package/docs/docs/cmd/entra/user/user-list.mdx +36 -15
- package/docs/docs/cmd/spe/containertype/containertype-add.mdx +140 -0
- package/docs/docs/cmd/spfx/spfx-doctor.mdx +108 -2
- package/package.json +1 -1
|
@@ -19,14 +19,6 @@ var PackageSearchMode;
|
|
|
19
19
|
PackageSearchMode[PackageSearchMode["GlobalOnly"] = 1] = "GlobalOnly";
|
|
20
20
|
PackageSearchMode[PackageSearchMode["LocalAndGlobal"] = 2] = "LocalAndGlobal";
|
|
21
21
|
})(PackageSearchMode || (PackageSearchMode = {}));
|
|
22
|
-
/**
|
|
23
|
-
* Is the particular check optional or required
|
|
24
|
-
*/
|
|
25
|
-
var OptionalOrRequired;
|
|
26
|
-
(function (OptionalOrRequired) {
|
|
27
|
-
OptionalOrRequired[OptionalOrRequired["Optional"] = 0] = "Optional";
|
|
28
|
-
OptionalOrRequired[OptionalOrRequired["Required"] = 1] = "Required";
|
|
29
|
-
})(OptionalOrRequired || (OptionalOrRequired = {}));
|
|
30
22
|
/**
|
|
31
23
|
* Should the method continue or fail on a rejected Promise
|
|
32
24
|
*/
|
|
@@ -47,7 +39,7 @@ var SharePointVersion;
|
|
|
47
39
|
})(SharePointVersion || (SharePointVersion = {}));
|
|
48
40
|
class SpfxDoctorCommand extends BaseProjectCommand {
|
|
49
41
|
get allowedOutputs() {
|
|
50
|
-
return ['text'];
|
|
42
|
+
return ['text', 'json'];
|
|
51
43
|
}
|
|
52
44
|
get name() {
|
|
53
45
|
return commands.DOCTOR;
|
|
@@ -585,6 +577,8 @@ class SpfxDoctorCommand extends BaseProjectCommand {
|
|
|
585
577
|
}
|
|
586
578
|
}
|
|
587
579
|
};
|
|
580
|
+
this.output = '';
|
|
581
|
+
this.resultsObject = [];
|
|
588
582
|
__classPrivateFieldGet(this, _SpfxDoctorCommand_instances, "m", _SpfxDoctorCommand_initTelemetry).call(this);
|
|
589
583
|
__classPrivateFieldGet(this, _SpfxDoctorCommand_instances, "m", _SpfxDoctorCommand_initOptions).call(this);
|
|
590
584
|
__classPrivateFieldGet(this, _SpfxDoctorCommand_instances, "m", _SpfxDoctorCommand_initValidators).call(this);
|
|
@@ -593,168 +587,265 @@ class SpfxDoctorCommand extends BaseProjectCommand {
|
|
|
593
587
|
if (!args.options.output) {
|
|
594
588
|
args.options.output = 'text';
|
|
595
589
|
}
|
|
590
|
+
this.output = args.options.output;
|
|
596
591
|
this.projectRootPath = this.getProjectRoot(process.cwd());
|
|
597
|
-
|
|
598
|
-
await
|
|
599
|
-
await
|
|
600
|
-
await
|
|
592
|
+
this.logger = logger;
|
|
593
|
+
await this.logMessage(' ');
|
|
594
|
+
await this.logMessage('CLI for Microsoft 365 SharePoint Framework doctor');
|
|
595
|
+
await this.logMessage('Verifying configuration of your system for working with the SharePoint Framework');
|
|
596
|
+
await this.logMessage(' ');
|
|
601
597
|
let spfxVersion = '';
|
|
602
598
|
let prerequisites;
|
|
603
|
-
const fixes = [];
|
|
604
599
|
try {
|
|
605
|
-
spfxVersion = args.options.spfxVersion ?? await this.getSharePointFrameworkVersion(
|
|
600
|
+
spfxVersion = args.options.spfxVersion ?? await this.getSharePointFrameworkVersion();
|
|
606
601
|
if (!spfxVersion) {
|
|
607
|
-
await
|
|
602
|
+
await this.logMessage(formatting.getStatus(CheckStatus.Failure, `SharePoint Framework`));
|
|
603
|
+
this.resultsObject.push({
|
|
604
|
+
check: 'SharePoint Framework',
|
|
605
|
+
passed: false,
|
|
606
|
+
message: `SharePoint Framework not found`
|
|
607
|
+
});
|
|
608
608
|
throw `SharePoint Framework not found`;
|
|
609
609
|
}
|
|
610
610
|
prerequisites = this.versions[spfxVersion];
|
|
611
611
|
if (!prerequisites) {
|
|
612
|
-
|
|
613
|
-
|
|
612
|
+
const message = `spfx doctor doesn't support SPFx v${spfxVersion} at this moment`;
|
|
613
|
+
this.resultsObject.push({
|
|
614
|
+
check: 'SharePoint Framework',
|
|
615
|
+
passed: true,
|
|
616
|
+
version: spfxVersion,
|
|
617
|
+
message: message
|
|
618
|
+
});
|
|
619
|
+
await this.logMessage(formatting.getStatus(CheckStatus.Failure, `SharePoint Framework v${spfxVersion}`));
|
|
620
|
+
throw message;
|
|
621
|
+
}
|
|
622
|
+
else {
|
|
623
|
+
this.resultsObject.push({
|
|
624
|
+
check: 'SharePoint Framework',
|
|
625
|
+
passed: true,
|
|
626
|
+
version: spfxVersion,
|
|
627
|
+
message: `SharePoint Framework v${spfxVersion} valid.`
|
|
628
|
+
});
|
|
614
629
|
}
|
|
615
630
|
if (args.options.spfxVersion) {
|
|
616
|
-
await this.checkSharePointFrameworkVersion(args.options.spfxVersion
|
|
631
|
+
await this.checkSharePointFrameworkVersion(args.options.spfxVersion);
|
|
617
632
|
}
|
|
618
633
|
else {
|
|
619
634
|
// spfx was detected and if we are here, it means that we support it
|
|
620
|
-
|
|
635
|
+
const message = `SharePoint Framework v${spfxVersion}`;
|
|
636
|
+
this.resultsObject.push({
|
|
637
|
+
check: 'SharePoint Framework',
|
|
638
|
+
passed: true,
|
|
639
|
+
version: spfxVersion,
|
|
640
|
+
message: message
|
|
641
|
+
});
|
|
642
|
+
await this.logMessage(formatting.getStatus(CheckStatus.Success, message));
|
|
621
643
|
}
|
|
622
|
-
await this.checkSharePointCompatibility(spfxVersion, prerequisites, args
|
|
623
|
-
await this.checkNodeVersion(prerequisites
|
|
624
|
-
await this.checkYo(prerequisites
|
|
625
|
-
await this.checkGulp(
|
|
626
|
-
await this.checkGulpCli(prerequisites
|
|
627
|
-
await this.checkTypeScript(
|
|
628
|
-
if (
|
|
629
|
-
await
|
|
630
|
-
await
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
await logger.log(' ');
|
|
644
|
+
await this.checkSharePointCompatibility(spfxVersion, prerequisites, args);
|
|
645
|
+
await this.checkNodeVersion(prerequisites);
|
|
646
|
+
await this.checkYo(prerequisites);
|
|
647
|
+
await this.checkGulp();
|
|
648
|
+
await this.checkGulpCli(prerequisites);
|
|
649
|
+
await this.checkTypeScript();
|
|
650
|
+
if (this.resultsObject.some(y => y.fix !== undefined)) {
|
|
651
|
+
await this.logMessage('Recommended fixes:');
|
|
652
|
+
await this.logMessage(' ');
|
|
653
|
+
for (const f of this.resultsObject.filter(y => y.fix !== undefined)) {
|
|
654
|
+
await this.logMessage(`- ${f.fix}`);
|
|
655
|
+
}
|
|
656
|
+
await this.logMessage(' ');
|
|
636
657
|
}
|
|
637
658
|
}
|
|
638
659
|
catch (err) {
|
|
639
|
-
await
|
|
640
|
-
if (
|
|
641
|
-
await
|
|
642
|
-
await
|
|
643
|
-
for (const f of
|
|
644
|
-
await
|
|
645
|
-
}
|
|
646
|
-
await
|
|
660
|
+
await this.logMessage(' ');
|
|
661
|
+
if (this.resultsObject.some(y => y.fix !== undefined)) {
|
|
662
|
+
await this.logMessage('Recommended fixes:');
|
|
663
|
+
await this.logMessage(' ');
|
|
664
|
+
for (const f of this.resultsObject.filter(y => y.fix !== undefined)) {
|
|
665
|
+
await this.logMessage(`- ${f.fix}`);
|
|
666
|
+
}
|
|
667
|
+
await this.logMessage(' ');
|
|
668
|
+
}
|
|
669
|
+
if (this.output === 'text') {
|
|
670
|
+
this.handleRejectedPromise(err);
|
|
647
671
|
}
|
|
648
|
-
|
|
672
|
+
}
|
|
673
|
+
finally {
|
|
674
|
+
if (args.options.output === 'json' && this.resultsObject.length > 0) {
|
|
675
|
+
await logger.log(this.resultsObject);
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
async logMessage(message) {
|
|
680
|
+
if (this.output === 'json') {
|
|
681
|
+
await this.logger.logToStderr(message);
|
|
682
|
+
}
|
|
683
|
+
else {
|
|
684
|
+
await this.logger.log(message);
|
|
649
685
|
}
|
|
650
686
|
}
|
|
651
|
-
async checkSharePointCompatibility(spfxVersion, prerequisites, args
|
|
687
|
+
async checkSharePointCompatibility(spfxVersion, prerequisites, args) {
|
|
652
688
|
if (args.options.env) {
|
|
653
689
|
const sp = this.spVersionStringToEnum(args.options.env);
|
|
654
690
|
if ((prerequisites.sp & sp) === sp) {
|
|
655
|
-
|
|
691
|
+
const message = `Supported in ${SharePointVersion[sp]}`;
|
|
692
|
+
this.resultsObject.push({
|
|
693
|
+
check: 'env',
|
|
694
|
+
passed: true,
|
|
695
|
+
message: message,
|
|
696
|
+
version: args.options.env
|
|
697
|
+
});
|
|
698
|
+
await this.logMessage(formatting.getStatus(CheckStatus.Success, message));
|
|
656
699
|
return;
|
|
657
700
|
}
|
|
658
|
-
|
|
659
|
-
|
|
701
|
+
const fix = `Use SharePoint Framework v${(sp === SharePointVersion.SP2016 ? '1.1' : '1.4.1')}`;
|
|
702
|
+
const message = `Not supported in ${SharePointVersion[sp]}`;
|
|
703
|
+
this.resultsObject.push({
|
|
704
|
+
check: 'env',
|
|
705
|
+
passed: false,
|
|
706
|
+
fix: fix,
|
|
707
|
+
message: message,
|
|
708
|
+
version: args.options.env
|
|
709
|
+
});
|
|
710
|
+
await this.logMessage(formatting.getStatus(CheckStatus.Failure, message));
|
|
660
711
|
throw `SharePoint Framework v${spfxVersion} is not supported in ${SharePointVersion[sp]}`;
|
|
661
712
|
}
|
|
662
713
|
}
|
|
663
|
-
async checkNodeVersion(prerequisites
|
|
714
|
+
async checkNodeVersion(prerequisites) {
|
|
664
715
|
const nodeVersion = this.getNodeVersion();
|
|
665
|
-
this.checkStatus('Node', nodeVersion, prerequisites.node
|
|
716
|
+
this.checkStatus('Node', nodeVersion, prerequisites.node);
|
|
666
717
|
}
|
|
667
|
-
async checkSharePointFrameworkVersion(spfxVersionRequested
|
|
668
|
-
let spfxVersionDetected = await this.getSPFxVersionFromYoRcFile(
|
|
718
|
+
async checkSharePointFrameworkVersion(spfxVersionRequested) {
|
|
719
|
+
let spfxVersionDetected = await this.getSPFxVersionFromYoRcFile();
|
|
669
720
|
if (!spfxVersionDetected) {
|
|
670
|
-
spfxVersionDetected = await this.getPackageVersion('@microsoft/generator-sharepoint', PackageSearchMode.GlobalOnly, HandlePromise.Continue
|
|
721
|
+
spfxVersionDetected = await this.getPackageVersion('@microsoft/generator-sharepoint', PackageSearchMode.GlobalOnly, HandlePromise.Continue);
|
|
671
722
|
}
|
|
672
723
|
const versionCheck = {
|
|
673
724
|
range: spfxVersionRequested,
|
|
674
725
|
fix: `npm i -g @microsoft/generator-sharepoint@${spfxVersionRequested}`
|
|
675
726
|
};
|
|
676
727
|
if (spfxVersionDetected) {
|
|
677
|
-
this.checkStatus(`SharePoint Framework`, spfxVersionDetected, versionCheck
|
|
728
|
+
this.checkStatus(`SharePoint Framework`, spfxVersionDetected, versionCheck);
|
|
678
729
|
}
|
|
679
730
|
else {
|
|
680
|
-
|
|
681
|
-
|
|
731
|
+
const message = `SharePoint Framework v${spfxVersionRequested} not found`;
|
|
732
|
+
this.resultsObject.push({
|
|
733
|
+
check: 'SharePoint Framework',
|
|
734
|
+
passed: false,
|
|
735
|
+
version: spfxVersionRequested,
|
|
736
|
+
message: message,
|
|
737
|
+
fix: versionCheck.fix
|
|
738
|
+
});
|
|
739
|
+
await this.logMessage(formatting.getStatus(CheckStatus.Failure, message));
|
|
682
740
|
}
|
|
683
741
|
}
|
|
684
|
-
async checkYo(prerequisites
|
|
685
|
-
const yoVersion = await this.getPackageVersion('yo', PackageSearchMode.GlobalOnly, HandlePromise.Continue
|
|
742
|
+
async checkYo(prerequisites) {
|
|
743
|
+
const yoVersion = await this.getPackageVersion('yo', PackageSearchMode.GlobalOnly, HandlePromise.Continue);
|
|
686
744
|
if (yoVersion) {
|
|
687
|
-
this.checkStatus('yo', yoVersion, prerequisites.yo
|
|
745
|
+
this.checkStatus('yo', yoVersion, prerequisites.yo);
|
|
688
746
|
}
|
|
689
747
|
else {
|
|
690
|
-
|
|
691
|
-
|
|
748
|
+
const message = 'yo not found';
|
|
749
|
+
this.resultsObject.push({
|
|
750
|
+
check: 'yo',
|
|
751
|
+
passed: false,
|
|
752
|
+
message: message,
|
|
753
|
+
fix: prerequisites.yo.fix
|
|
754
|
+
});
|
|
755
|
+
await this.logMessage(formatting.getStatus(CheckStatus.Failure, message));
|
|
692
756
|
}
|
|
693
757
|
}
|
|
694
|
-
async checkGulpCli(prerequisites
|
|
695
|
-
const gulpCliVersion = await this.getPackageVersion('gulp-cli', PackageSearchMode.GlobalOnly, HandlePromise.Continue
|
|
758
|
+
async checkGulpCli(prerequisites) {
|
|
759
|
+
const gulpCliVersion = await this.getPackageVersion('gulp-cli', PackageSearchMode.GlobalOnly, HandlePromise.Continue);
|
|
696
760
|
if (gulpCliVersion) {
|
|
697
|
-
this.checkStatus('gulp-cli', gulpCliVersion, prerequisites.gulpCli
|
|
761
|
+
this.checkStatus('gulp-cli', gulpCliVersion, prerequisites.gulpCli);
|
|
698
762
|
}
|
|
699
763
|
else {
|
|
700
|
-
|
|
701
|
-
|
|
764
|
+
const message = 'gulp-cli not found';
|
|
765
|
+
this.resultsObject.push({
|
|
766
|
+
check: 'gulp-cli',
|
|
767
|
+
passed: false,
|
|
768
|
+
message: message,
|
|
769
|
+
fix: prerequisites.gulpCli.fix
|
|
770
|
+
});
|
|
771
|
+
await this.logMessage(formatting.getStatus(CheckStatus.Failure, message));
|
|
702
772
|
}
|
|
703
773
|
}
|
|
704
|
-
async checkGulp(
|
|
705
|
-
const gulpVersion = await this.getPackageVersion('gulp', PackageSearchMode.GlobalOnly, HandlePromise.Continue
|
|
774
|
+
async checkGulp() {
|
|
775
|
+
const gulpVersion = await this.getPackageVersion('gulp', PackageSearchMode.GlobalOnly, HandlePromise.Continue);
|
|
706
776
|
if (gulpVersion) {
|
|
707
|
-
|
|
708
|
-
|
|
777
|
+
const message = 'gulp should be removed';
|
|
778
|
+
const fix = 'npm un -g gulp';
|
|
779
|
+
this.resultsObject.push({
|
|
780
|
+
check: 'gulp',
|
|
781
|
+
passed: false,
|
|
782
|
+
version: gulpVersion,
|
|
783
|
+
message: message,
|
|
784
|
+
fix: fix
|
|
785
|
+
});
|
|
786
|
+
await this.logMessage(formatting.getStatus(CheckStatus.Failure, message));
|
|
709
787
|
}
|
|
710
788
|
}
|
|
711
|
-
async checkTypeScript(
|
|
712
|
-
const typeScriptVersion = await this.getPackageVersion('typescript', PackageSearchMode.LocalOnly, HandlePromise.Continue
|
|
789
|
+
async checkTypeScript() {
|
|
790
|
+
const typeScriptVersion = await this.getPackageVersion('typescript', PackageSearchMode.LocalOnly, HandlePromise.Continue);
|
|
713
791
|
if (typeScriptVersion) {
|
|
714
|
-
|
|
715
|
-
|
|
792
|
+
const fix = 'npm un typescript';
|
|
793
|
+
const message = `typescript v${typeScriptVersion} installed in the project`;
|
|
794
|
+
this.resultsObject.push({
|
|
795
|
+
check: 'typescript',
|
|
796
|
+
passed: false,
|
|
797
|
+
message: message,
|
|
798
|
+
fix: fix
|
|
799
|
+
});
|
|
800
|
+
await this.logMessage(formatting.getStatus(CheckStatus.Failure, message));
|
|
716
801
|
}
|
|
717
802
|
else {
|
|
718
|
-
|
|
803
|
+
const message = 'bundled typescript used';
|
|
804
|
+
this.resultsObject.push({
|
|
805
|
+
check: 'typescript',
|
|
806
|
+
passed: true,
|
|
807
|
+
message: message
|
|
808
|
+
});
|
|
809
|
+
await this.logMessage(formatting.getStatus(CheckStatus.Success, message));
|
|
719
810
|
}
|
|
720
811
|
}
|
|
721
812
|
spVersionStringToEnum(sp) {
|
|
722
813
|
return SharePointVersion[sp.toUpperCase()];
|
|
723
814
|
}
|
|
724
|
-
async getSPFxVersionFromYoRcFile(
|
|
815
|
+
async getSPFxVersionFromYoRcFile() {
|
|
725
816
|
if (this.projectRootPath !== null) {
|
|
726
817
|
const spfxVersion = this.getProjectVersion();
|
|
727
818
|
if (spfxVersion) {
|
|
728
819
|
if (this.debug) {
|
|
729
|
-
await logger.logToStderr(`SPFx version retrieved from .yo-rc.json file. Retrieved version: ${spfxVersion}`);
|
|
820
|
+
await this.logger.logToStderr(`SPFx version retrieved from .yo-rc.json file. Retrieved version: ${spfxVersion}`);
|
|
730
821
|
}
|
|
731
822
|
return spfxVersion;
|
|
732
823
|
}
|
|
733
824
|
}
|
|
734
825
|
return undefined;
|
|
735
826
|
}
|
|
736
|
-
async getSharePointFrameworkVersion(
|
|
737
|
-
let spfxVersion = await this.getSPFxVersionFromYoRcFile(
|
|
827
|
+
async getSharePointFrameworkVersion() {
|
|
828
|
+
let spfxVersion = await this.getSPFxVersionFromYoRcFile();
|
|
738
829
|
if (spfxVersion) {
|
|
739
830
|
return spfxVersion;
|
|
740
831
|
}
|
|
741
832
|
try {
|
|
742
|
-
spfxVersion = await this.getPackageVersion('@microsoft/sp-core-library', PackageSearchMode.LocalOnly, HandlePromise.Fail
|
|
833
|
+
spfxVersion = await this.getPackageVersion('@microsoft/sp-core-library', PackageSearchMode.LocalOnly, HandlePromise.Fail);
|
|
743
834
|
if (this.debug) {
|
|
744
|
-
await logger.logToStderr(`Found @microsoft/sp-core-library@${spfxVersion}`);
|
|
835
|
+
await this.logger.logToStderr(`Found @microsoft/sp-core-library@${spfxVersion}`);
|
|
745
836
|
}
|
|
746
837
|
return spfxVersion;
|
|
747
838
|
}
|
|
748
839
|
catch {
|
|
749
840
|
if (this.debug) {
|
|
750
|
-
await logger.logToStderr(`@microsoft/sp-core-library not found. Search for @microsoft/generator-sharepoint local or global...`);
|
|
841
|
+
await this.logger.logToStderr(`@microsoft/sp-core-library not found. Search for @microsoft/generator-sharepoint local or global...`);
|
|
751
842
|
}
|
|
752
843
|
try {
|
|
753
|
-
return await this.getPackageVersion('@microsoft/generator-sharepoint', PackageSearchMode.LocalAndGlobal, HandlePromise.Fail
|
|
844
|
+
return await this.getPackageVersion('@microsoft/generator-sharepoint', PackageSearchMode.LocalAndGlobal, HandlePromise.Fail);
|
|
754
845
|
}
|
|
755
846
|
catch (error) {
|
|
756
847
|
if (this.debug) {
|
|
757
|
-
await logger.logToStderr('@microsoft/generator-sharepoint not found');
|
|
848
|
+
await this.logger.logToStderr('@microsoft/generator-sharepoint not found');
|
|
758
849
|
}
|
|
759
850
|
if (error && error.indexOf('ENOENT') > -1) {
|
|
760
851
|
throw 'npm not found';
|
|
@@ -765,19 +856,19 @@ class SpfxDoctorCommand extends BaseProjectCommand {
|
|
|
765
856
|
}
|
|
766
857
|
}
|
|
767
858
|
}
|
|
768
|
-
async getPackageVersion(packageName, searchMode, handlePromise
|
|
859
|
+
async getPackageVersion(packageName, searchMode, handlePromise) {
|
|
769
860
|
const args = ['ls', packageName, '--depth=0', '--json'];
|
|
770
861
|
if (searchMode === PackageSearchMode.GlobalOnly) {
|
|
771
862
|
args.push('-g');
|
|
772
863
|
}
|
|
773
864
|
let version;
|
|
774
865
|
try {
|
|
775
|
-
version = await this.getPackageVersionFromNpm(args
|
|
866
|
+
version = await this.getPackageVersionFromNpm(args);
|
|
776
867
|
}
|
|
777
868
|
catch {
|
|
778
869
|
if (searchMode === PackageSearchMode.LocalAndGlobal) {
|
|
779
870
|
args.push('-g');
|
|
780
|
-
version = await this.getPackageVersionFromNpm(args
|
|
871
|
+
version = await this.getPackageVersionFromNpm(args);
|
|
781
872
|
}
|
|
782
873
|
else {
|
|
783
874
|
version = '';
|
|
@@ -795,11 +886,11 @@ class SpfxDoctorCommand extends BaseProjectCommand {
|
|
|
795
886
|
}
|
|
796
887
|
}
|
|
797
888
|
}
|
|
798
|
-
getPackageVersionFromNpm(args
|
|
889
|
+
getPackageVersionFromNpm(args) {
|
|
799
890
|
return new Promise(async (resolve, reject) => {
|
|
800
891
|
const packageName = args[1];
|
|
801
892
|
if (this.debug) {
|
|
802
|
-
await logger.logToStderr(`Executing npm: ${args.join(' ')}...`);
|
|
893
|
+
await this.logger.logToStderr(`Executing npm: ${args.join(' ')}...`);
|
|
803
894
|
}
|
|
804
895
|
child_process.exec(`npm ${args.join(' ')}`, (err, stdout) => {
|
|
805
896
|
if (err) {
|
|
@@ -825,14 +916,28 @@ class SpfxDoctorCommand extends BaseProjectCommand {
|
|
|
825
916
|
getNodeVersion() {
|
|
826
917
|
return process.version.substr(1);
|
|
827
918
|
}
|
|
828
|
-
async checkStatus(what, versionFound, versionCheck
|
|
919
|
+
async checkStatus(what, versionFound, versionCheck) {
|
|
829
920
|
if (versionFound) {
|
|
830
921
|
if (satisfies(versionFound, versionCheck.range)) {
|
|
831
|
-
|
|
922
|
+
const message = `${what} v${versionFound}`;
|
|
923
|
+
this.resultsObject.push({
|
|
924
|
+
check: what,
|
|
925
|
+
passed: true,
|
|
926
|
+
message: message,
|
|
927
|
+
version: versionFound
|
|
928
|
+
});
|
|
929
|
+
await this.logMessage(formatting.getStatus(CheckStatus.Success, message));
|
|
832
930
|
}
|
|
833
931
|
else {
|
|
834
|
-
|
|
835
|
-
|
|
932
|
+
const message = `${what} v${versionFound} found, v${versionCheck.range} required`;
|
|
933
|
+
this.resultsObject.push({
|
|
934
|
+
check: what,
|
|
935
|
+
passed: false,
|
|
936
|
+
version: versionFound,
|
|
937
|
+
message: message,
|
|
938
|
+
fix: versionCheck.fix
|
|
939
|
+
});
|
|
940
|
+
await this.logMessage(formatting.getStatus(CheckStatus.Failure, message));
|
|
836
941
|
}
|
|
837
942
|
}
|
|
838
943
|
}
|
|
@@ -21,6 +21,9 @@ m365 aad user list [options]
|
|
|
21
21
|
## Options
|
|
22
22
|
|
|
23
23
|
```md definition-list
|
|
24
|
+
`--type [type]`
|
|
25
|
+
: Filter the results to only users of a given type: `Member` or `Guest`. By default, all users are listed.
|
|
26
|
+
|
|
24
27
|
`-p, --properties [properties]`
|
|
25
28
|
: Comma-separated list of properties to retrieve
|
|
26
29
|
```
|
|
@@ -29,7 +32,9 @@ m365 aad user list [options]
|
|
|
29
32
|
|
|
30
33
|
## Remarks
|
|
31
34
|
|
|
32
|
-
Using the `--properties` option, you can specify a comma-separated list of user properties to retrieve from the Microsoft Graph. If you don't specify any properties, the command will retrieve user's display name
|
|
35
|
+
Using the `--properties` option, you can specify a comma-separated list of user properties to retrieve from the Microsoft Graph. If you don't specify any properties, the command will retrieve user's display name, account name, id, and mail.
|
|
36
|
+
|
|
37
|
+
When the `properties` option includes values with a `/`, for example: `manager/displayName`, an additional `$expand` query parameter will be included on `manager`.
|
|
33
38
|
|
|
34
39
|
To filter the list of users, include additional options that match the user property that you want to filter with. For example `--displayName Patt` will return all users whose `displayName` starts with `Patt`. Multiple filters will be combined using the `and` operator.
|
|
35
40
|
|
|
@@ -37,30 +42,42 @@ Certain properties cannot be returned within a user collection. The following pr
|
|
|
37
42
|
|
|
38
43
|
## Examples
|
|
39
44
|
|
|
40
|
-
List all users in the tenant
|
|
45
|
+
List all users in the tenant.
|
|
41
46
|
|
|
42
47
|
```sh
|
|
43
48
|
m365 entra user list
|
|
44
49
|
```
|
|
45
50
|
|
|
46
|
-
List all users in the tenant.
|
|
51
|
+
List all guest users in the tenant.
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
m365 entra user list --type Guest
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
List all users in the tenant. For each one return the display name and e-mail address.
|
|
47
58
|
|
|
48
59
|
```sh
|
|
49
60
|
m365 entra user list --properties "displayName,mail"
|
|
50
61
|
```
|
|
51
62
|
|
|
52
|
-
Show users whose display name starts with _Patt_
|
|
63
|
+
Show users whose display name starts with _Patt_.
|
|
53
64
|
|
|
54
65
|
```sh
|
|
55
66
|
m365 entra user list --displayName Patt
|
|
56
67
|
```
|
|
57
68
|
|
|
58
|
-
Show all account managers whose display name starts with _Patt_
|
|
69
|
+
Show all account managers whose display name starts with _Patt_.
|
|
59
70
|
|
|
60
71
|
```sh
|
|
61
72
|
m365 entra user list --displayName Patt --jobTitle 'Account manager'
|
|
62
73
|
```
|
|
63
74
|
|
|
75
|
+
List users from the tenant. For each one return the display name, e-mail address, and manager information.
|
|
76
|
+
|
|
77
|
+
```sh
|
|
78
|
+
m365 entra user list --properties "displayName,mail,manager/*"
|
|
79
|
+
```
|
|
80
|
+
|
|
64
81
|
## Response
|
|
65
82
|
|
|
66
83
|
<Tabs>
|
|
@@ -69,8 +86,10 @@ m365 entra user list --displayName Patt --jobTitle 'Account manager'
|
|
|
69
86
|
```json
|
|
70
87
|
[
|
|
71
88
|
{
|
|
72
|
-
"
|
|
73
|
-
"displayName": "John Doe"
|
|
89
|
+
"id": "1f5595b2-aa07-445d-9801-a45ea18160b2",
|
|
90
|
+
"displayName": "John Doe",
|
|
91
|
+
"mail": "John@contoso.onmicrosoft.com",
|
|
92
|
+
"userPrincipalName": "John@contoso.onmicrosoft.com"
|
|
74
93
|
}
|
|
75
94
|
]
|
|
76
95
|
```
|
|
@@ -79,17 +98,17 @@ m365 entra user list --displayName Patt --jobTitle 'Account manager'
|
|
|
79
98
|
<TabItem value="Text">
|
|
80
99
|
|
|
81
100
|
```text
|
|
82
|
-
userPrincipalName
|
|
83
|
-
|
|
84
|
-
John@contoso.onmicrosoft.com
|
|
101
|
+
id displayName mail userPrincipalName
|
|
102
|
+
------------------------------------ ------------------ ----------------------------------- ------------------------------------------
|
|
103
|
+
1f5595b2-aa07-445d-9801-a45ea18160b2 John Doe John@contoso.onmicrosoft.com John@contoso.onmicrosoft.com
|
|
85
104
|
```
|
|
86
105
|
|
|
87
106
|
</TabItem>
|
|
88
107
|
<TabItem value="CSV">
|
|
89
108
|
|
|
90
109
|
```csv
|
|
91
|
-
|
|
92
|
-
John@contoso.onmicrosoft.com,John
|
|
110
|
+
id,displayName,mail,userPrincipalName
|
|
111
|
+
1f5595b2-aa07-445d-9801-a45ea18160b2,John Doe,John@contoso.onmicrosoft.com,John@contoso.onmicrosoft.com
|
|
93
112
|
```
|
|
94
113
|
|
|
95
114
|
</TabItem>
|
|
@@ -100,12 +119,14 @@ m365 entra user list --displayName Patt --jobTitle 'Account manager'
|
|
|
100
119
|
|
|
101
120
|
Date: 2023-06-02
|
|
102
121
|
|
|
103
|
-
## John Doe
|
|
122
|
+
## John Doe (1f5595b2-aa07-445d-9801-a45ea18160b2)
|
|
104
123
|
|
|
105
124
|
Property | Value
|
|
106
125
|
---------|-------
|
|
107
|
-
|
|
126
|
+
id | 1f5595b2-aa07-445d-9801-a45ea18160b2
|
|
108
127
|
displayName | John Doe
|
|
128
|
+
mail | John@contoso.onmicrosoft.com
|
|
129
|
+
userPrincipalName | John@contoso.onmicrosoft.com
|
|
109
130
|
```
|
|
110
131
|
|
|
111
132
|
</TabItem>
|
|
@@ -113,4 +134,4 @@ m365 entra user list --displayName Patt --jobTitle 'Account manager'
|
|
|
113
134
|
|
|
114
135
|
## More information
|
|
115
136
|
|
|
116
|
-
- Microsoft Graph User properties: [https://
|
|
137
|
+
- Microsoft Graph User properties: [https://learn.microsoft.com/graph/api/resources/user?view=graph-rest-1.0#properties](https://learn.microsoft.com/graph/api/resources/user?view=graph-rest-1.0#properties)
|